Creating a cassette converter plug-in

Hey guys, I’m doing a project, which is to create a plug-in that converts cassette to mp3.

Currently I wanna find out, is it possible to write a code that can call another plug-in? For example, I want my plug-in that calls another plug-in to add reverb or compression.

Any help will be greatly appreciated!

a plug-in that converts cassette to mp3.

I’m foggy on the goal. Most people have trouble getting a cassette machine to play music into a Windows laptop at all. That’s not a software problem. The hardware is basically incompatible.

What is a plugin going to do to solve that problem? After the show is inside Audacity, you can leave it just as it is and burn it to a CD or other media. I’m fixing a combo machine for a friend that has a cassette player and a CD burner in the same box. No software or hardware needed.

Koz

Nyquist plug-ins can not call other plug-ins.
Audacity has “Chains” Audacity Manual

The goal of this project, is basically so that any Tom, Dick and Harry can convert their tapes into mp3s, with only just their tapes, a tape recorder and an aux. output into their laptop, while using Audacity with a plug-in.
The functionalities I’m trying to include are:

  • Auto record when the tape is played
  • Do compression/noise reduction to the whole recorded track
  • Look for gaps in the track, and use them as cues to cut into smaller songs
  • Tag them with ID3.

The problem here is that the output from the cassette player sends a line level signal - whereas most (but not entirely all) laptops only have a mic input which is expecting a signal much smaller than line level, so you would be sending far too hot a signal to the PC. To circumvent this you need an external USB sound card, the Behringer UCA-202 is often recommended on this forum.

WC

Compression is rarely if ever necessary for recording from tapes because the dynamic range of tape is already quite small. Compression just reduces the dynamic rage further.

Noise reduction is often beneficial. It would be useful (simpler to use) here if the noise reduction effect had a generic “tape noise” profile so as to save having to run “Get Noise Profile” in Noise Removal. The possibility of “preset” noise profiles for the “Noise Removal” effect has been considered, and there is currently someone (Paul L) working on improvements to the Noise Removal effect, but no guarantee that presets will be added any time soon. Adding that functionality to the existing Noise Removal effect is not something that can be done with a plug-in, it requires changing the Audacity source code.

One option would be to make a new “tape noise reduction” effect as a plug-in.

I don’t see that “auto record” is really necessary - it’s only a matter of pressing the record button. The hard part is physically connecting the player to the computer, setting the correct input to record from and setting the recording level. I don’t see how that can be automated unless you are using dedicated hardware (both player and computer designed specifically for recording tapes).

Being able to run noise reduction, then (accurately) label tracks, then Export Multiple, as an automatic sequence when the recording is complete, would simplify the task. To do that requires that each step is able to run with minimal user input. So you would want:

  • Noise reduction that uses a generic noise profile.
    It may still need to have an “amount” control so that more noise reduction can be applied to noisy tapes and less to “clean” tapes, unless you design a new effect that can automatically determine a suitable amount of noise removal by automatically scanning the recording to determine how much noise is present in “gaps”.
  • We currently have “Sound Finder” (and “Silence Finder”) for labelling tracks. I don’t think the current effect is accurate enough for a high level of automation, so that would need improving. Again it would be useful if the improved effect could automatically detect the required “threshold” level. I’ve done some work on this and I think that it is definitely possible to provide a high degree of accuracy for (music) tape transfers, but there is still work to be done here.
  • The tagging (Metadata Editor) window already pops up by default. I don’t see how that can be automated further unless it had “tune recognition”, but I’m not aware of any open-source tune recognition software/database that works reliably.

Once you have all of those features, you would then need to “script” the sequence of events. That could be done using the optional “Mod Script Pipe” module for Audacity. Mod script pipe is not installed by default - it needs to be built from the source code at the same time (the same day) as building Audacity from the source code.

Probably the most realistic approach would be to concentrate on one aspect of the task and develop that - for example, a fully automatic noise reduction plug-in for recordings from tape.

Hey guys thanks for all the replies! I do have some follow-up questions though. I’m still VERY new to Nyquist so please bear with me.

So what you’re saying here is while there are noise removal effects, there aren’t any for tape noise reduction specifically? Would it be possible for me to just use an existing noise removal plug-in?

Going back to the functionality I wanted to include:

  • Auto record when the tape is played - Is there any way to make this possible? I agree that it isn’t necessary, it would just be a nice addition to simplify the process for the user

  • Do compression/noise reduction to the whole recorded track - So now compression is not necessary, as for noise reduction, going back to what I was saying earlier, would it be possible to just use an existing noise removal plug-in?

  • Look for gaps in the track, and use them as cues to cut into smaller songs - Let me explain this further. Essentially after recording the entire cassette, the plug-in could automatically cut them into tracks (for example the whole cassette has 12 tracks, the plug-in will be able to cut the whole recorded track into 12 tracks) The only way I thought this was possible was by finding gaps between songs and using them as markers to cut. I don’t quite understand “Sound Finder”. Could you maybe explain that a little further for me?

  • Tag them with ID3. - So a window will automatically pop up after the cutting is done? If it does then this part right here shouldn’t be a problem at all.

I understand what you’re saying, but isn’t there anyway for this to be possible without an audio interface? I myself do personally own one, but the goal of this project is to be able to convert tapes without using it.

There has to be some sort of interface, even if it the mic socket on the side of your laptop. What waxcylinder is saying is that the mic socket on the side of many laptops are designed only for computer microphones (expecting a much smaller signal than that from a tape player, and mono). In other words, using the mic socket on a laptop “may” work, but the sound quality will often be trash and mono. The difference in signal level between “mic level” and “line level” is similar to the difference between a 1.5 volt battery and 250 volt mains.

Not specifically, though yes, other noise removal effects will usually work to a greater or lesser extent.

Sure you can use existing noise reduction effects, but you can’t call another effect from within a Nyquist script.
You could perhaps include a noise reduction effect in a “Chain” Audacity Manual

Audacity has “Sound Activated Recording”, which is about as close as Audacity gets to this feature: Audacity Manual

You could also consider scripting a sequence of actions using AutoHotKey or similar (http://www.autohotkey.com/).
Linux has similar functionality in “AutoKey” Google Code Archive - Long-term storage for Google Code Project Hosting.
Mac OS X probably has something similar (AppleScript? AppleScript - Wikipedia)


See these links:
http://manual.audacityteam.org/o/man/silence_finder_and_sound_finder.html
http://manual.audacityteam.org/o/man/silence_finder_setting_parameters.html
http://manual.audacityteam.org/o/man/splitting_a_recording_into_separate_tracks.html
Audacity Manual

Okay how about this. Without using a plug-in I can use Audacity to get the noise profile of the track and then apply noise reduction throughout the entire track right? (Using Effect > Noise Removal… > Get Noise Profile) Is it possible to create my own plug-in that does this? Or will just using an existing noise reduction plug-in be better.

What about silence in between tracks? Would it stop recording and then continue when the music starts again? I wouldn’t want that to happen.

So going back to what i think is the flow of this project which is:

  1. Auto record
  2. Record entire track
  3. Perform noise reduction
  4. Divide the main track into songs
  5. Tag each song with ID3

Which of these can I actually code with Nyquist to do?

It would certainly be possible to implement noise reduction as a Nyquist plug-in, but that would be a complex (difficult) task. Noise reduction effects are not simple.

I think that is answered in the documentation?

As previously stated, detecting gaps between songs and labelling them can be implemented in Nyquist. There is already Sound Finder and Silence Finder, and both of these can be improved.

See the thing is, this project is actually for my final year project of my degree. I’m supposed to design a plug-in that would simplify the task of converting tapes into mp3s. Having said that, what can I actually code with Nyquist to do that then?

Is this a computing/programming degree?
Audacity also supports other types of plug-ins. In particular, “modules” (wxWidgets plug-ins). These are integrated more closely into the Audacity code and are able to access more features in Audacity. They are generally written in C++ (though I think it is possible to write them in other languages). There is a limited amount of documentation about modules, much of which is incomplete or out of date, but there are two functional example plug-ins of this type in the Audacity SVN source code.

“Mod-script-pipe” is probably most relevant for your purposes. This module allows Audacity to be controlled by an external script via named pipes.

I think that much of your original proposal could be implemented as a “module” type plug-in.

Some documentation:

http://manual.audacityteam.org/o/man/scripting.html

http://manual.audacityteam.org/index.php?title=Scripting

Yes, it’s an IT degree.
So you’re saying a better way of doing this is by using Audacity Modules, specifically Mod-script-pipe? I did do some reading prior to starting this project, I chose Nyquist because it seems to be the most used plug-in? Or at least it seems easier to get info on Nyquist anyway.
I did initially wanted to use a plug-in that mainly uses C++, but since it says it’s still a work in progress I decided not to look into it any further.

Actually you know what, let’s not get into that for now. I think for now I wanna go with chains. How would I go about adding all my functionalities into a chain?

This should answer most of your questions about Chains: Audacity Manual

It seems like I can only use chains for noise removal. Is there anyway to use sound finder in the chain?

Chains only support “Effects”. Fortunately, Sound Finder will still work correctly if it is defined as an “Effect”. To do that, you need to change the plug-in header so that the “type” is set to “process”. See here for more details: http://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference#type_process

So I’ve been on break for a while and now I’m restarting my project.

Just to recap, this project is basically to create a fully automated way for Audacity to record, split and tag tracks. The hardware involved at the moment doesn’t matter. The key importance is:

  1. User just needs to enter the song information either before or after the process is done, and play the album. This should be the only thing the user has to do.
  2. Audacity records automatically when the song starts, and stops when the album ends.
  3. Splits the entire track into individual songs.
  4. Saves with the ID3 tags that were already set by user.

At the end of phase 1, I actually got nowhere near the progress I would’ve liked.
Now that I’m going into phase 2, it looks like from what you say Mod-script-pipe is the way to go. Is there another subforum you could lead me to that specializes in that? I think I would need a really detailed guide on how to do this… And a lot of help.