Audacity’s “Change Tempo” macro only provides the “Percentage Change” option, but if you need to use “To Length”, then Nyquist can convert from lengths to percentage before calling the effect with AUD-DO.
To convert lengths to percent:
Percent change = 100 * ((current-duration - target-duration) / target-duration)
The AUD-DO command is:
(aud-do “ChangeTempo: Percentage= SBSMS=<0 or 1>”)
For the SBSMS (“high quality” option), 1 = true, 0 = false.
Hello Steve. This plug-in you made is amazing. It runs really well as an effect.
However, when I add it into a ‘normal macro’ it didn’t respond. (I was using 2.3.1-alpha)
Is there anything I could do to make it work? I need to process a large batch of file. I’d be really grateful if you could help.
Thanks!
My Macro :
01 Select All
02 Trim Silence min-end-silence=“0.05” min-start-silence=“0.05” threshold=“-10”
03 Select All
04 Stretch to length sbsms=“Yes” target=“0.33”
05 Select End=“0.01” Mode=“Set” RelativeTo=“ProjectStart” Start=“0”
06 Insert Silence
07 Select End=“0.01” Mode=“Set” RelativeTo=“ProjectEnd”
08 Silence
09 Select All
10 Normalize ApplyGain=“1” PeakLevel=“-10” RemoveDcOffset=“1” Stereolndependent=“0”
11 Export as WAV
12 -END-
It worked fine if I do these steps manually one by one.
Therefore, I created a ‘test’ Marco to check the steps one by one.
The step breakdown at 04.
Thank you!
If you make a macro with only the “Stretch to Length” command, and apply the macro to the current project, does that work for you?
How long is the track that you are processing?
Thank you for your prompt reply.
Tracks are on average 1 second long and usually 200ms - 500ms long after “Trim silence”.
If I only use “select all → stretch to length” or just “stretch to length”, nothing happens (nothing observable changed) except the track is selected (if “select all” goes first).
This only occurs when “stretch to length” is applied in Macro though, it works well as effect (double checked).
Well I’ve tested Stretch-to-length in a macro in both Linux and Windows 10, and it works for me.
I’ve also tried installing TrimSilence and InsertSilence so that I can run your macro, and it runs.
Perhaps there’s a problem with one of the files that you are trying to apply the macro to (?)
I presume that you are using an unmodified version of “stretch-to-length.ny” from the first post (?)
I tried it on multiple audio files one by one (.mp3) it didn’t work.
May I ask if I should get the right version of “stretch-to-length.ny” from the first post of this topic?
Does it have anything to do with the version of Audacity? I installed 2.3.0 before I get a zip version of 2.3.1-alpha-Oct 22 2018. But then I uninstalled 2.3.0 and only use 2.3.1 it still doesn’t work.
Please find the screenshots of before & after I apply ‘stretch to length’ as effect & applied as Macro.
Thank you.
I’m not able to test, but it’s possible that your version of 2.3.1-alpha is too early. The version that I was using was from January.
There is due to be a “release candidate” for Audacity 2.3.1, hopefully in the next few days, so I’d suggest that you try that when it becomes available.
I don’t know if this is still the best solution, but i just followed this thread and somehow got it working perfectly. just wanted to say thanks all these years later
I’m pleased to hear that it still works, though this plug-in isn’t really necessary now. I added a similar feature to Audacity’s “Change Tempo” effect, so you can now specify the required length directly into the Change Tempo effect without requiring additional plug-ins.