Hi, something like this could be very useful for me - I’m very new to Audacity macros, by the way.
I have a filter that I want to run on the whole of a single track in an Audacity file, it can be maybe 40 to 70 minutes long, varies each time. The filter is very intensive, and it fails (crashes no work done) if the time length is too long. It does work if I select a shorter time span, so I can do it in bits, but that’s obviously a pain.
I would like to do a macro to run this macro on successive sections of the track, say from timecode 0 to 10 minutes, 10 minutes to 20 minutes, and so on to complete the track. The thing is that I don’t know how long the track will be each time, so I might be selecting from 50 to 60 minutes of a track that only lasts 45 minutes, or might last 71 minutes, so I don’t know how to end my cycle running it on chunks of the track.
Another option might be to run the filter from 0 to [total time/5], then from [total time/5] to [total time/5*2], and so on, but I can’t find any syntax to do that.
The post that you linked is from 2014, is there a link deeper into the thread to a later version?
I’m processing a track that is 49 minutes
one of two tracks in a wav file that I have imported into Audacity (originally recorded using Voicemeeter)
It has previously had filters Noise Reduction, Change pitch, de-esser run on it
De-clicker default settings running
It starts off with a remaining time of about 5 minutes
The remaining time ticks down more slowly than the elapsed time ticks up
When it says about elapsed 3.05 and remaining 3.45, the dialog with the fill bar disappears, there is no error message, and the track has not been edited and the De-Clicker is not visible in the Undo option, the previous action is.
OK, I can reproduce the problem with a 1 hour stereo track.
Debugging the issue shows the cause of the problem:
The maximum number of sample blocks has been
reached, so audio computation must be terminated.
Probably, your program should not be retaining
so many samples in memory.
I think it’s highly unlikely that the plug-in developer will fix the issue, and the code is absolutely horrible so I have no intention of fixing it for him. As a workaround, you could try this macro: DeClick_5_audio_clips.txt (1.62 KB)
To use the macro, first split the track into 5 clips (add 4 “split lines” at roughly equal intervals: https://manual.audacityteam.org/man/edit_menu_clip_boundaries.html)
Then run the macro.
Then wait … and wait … and wait … and wait … and wait …
(I’m assuming that it will work, but I’m still waiting for it to complete)
My original idea was to process it in n regions by programatically selecting the first 1/n of the track, then the second and so on, and processing each separately. Is there any way to select like that in a macro?
There’s no easy way of doing that. It is “possible”, but you would need to write two Nyquist scripts (see https://manual.audacityteam.org/man/nyquist.html), one to analyse the track and work out the times of the selections, and another to make the selections, then incorporate those two scripts into the macro.
It could be. Audacity prioritises the audio processing over updating the waveform. The waveform should be fully updated once the macro has completed.
My test is now on the final clip so I’ll be able to say if it has worked here in a couple of minutes.
Thanks for all your dedication. I’m on version 3.2.3 and the quick test is happening to the same first clip 5 times, giving an error each time that says, “Fade Out: Could not load settings below. Default settings will be used”.
This is weird. I thought that it was just a problem in an old version, but on further testing I’m getting inconsistent results regardless of the version. Sometimes it works and sometimes it doesn’t, but I don’t see any pattern as to why it works sometimes but not others.
After testing with multiple versions, the only version I have that it’s working reliably and consistently with is Audacity 2.4.2 (the version that I use for production work).
I’ll need to do more testing tomorrow, but it’s looking like a “race condition” bug in multiple versions of Audacity.
I’m not sure what more I can suggest. Audacity is failing to process the macro correctly, which is a regression against much older versions. It bothers me greatly that Audacity has become unreliable when processing macros.
If your “filter” was a built-in effect or any type of plug-in other than a Nyquist plug-in, then this would be simple to do in Nyquist with something like this:
(You can try running this code in the Nyquist Prompt - see: https://manual.audacityteam.org/man/nyquist_prompt.html)