I have a macro written for adding 20 ms silence at any given cursor position of the currently selected track. But when I launch it it keeps applying the 20ms on the first track, not on the selected one.
Anyone know how to solve this ?
Use the “SelectTime:” command rather than the “Select:” command.
Thanks a lot, Steve. Exactly what I needed. It works like a charm.
You didn’t say what was in your macro, but I guessed that you ran into this bug which I have now logged: https://github.com/audacity/audacity/issues/2658
Oh, sorry for that. Here attached is the updated macro. The bug was I had a “Select” instead of the “Select Time”, so the macro was always handling only on the first track, not the selected one.
Thanks again.
A more concise version:
SelectTime:End="0.02" RelativeTo="SelectionStart" Start="0"
Repeat:Count="1"
SelectTime:End="0.02" RelativeTo="SelectionStart" Start="0"
Silence:
That’s right, it works the same. Excellent.
Although I must say I don’t quite get what each instruction does exactly in the macro…
Thanks again.
Select 0.2 seconds from the cursor / start of selection:
SelectTime:End="0.02" RelativeTo="SelectionStart" Start="0"
Apply the “Repeat” effect (https://manual.audacityteam.org/man/repeat.html)
Repeat:Count="1"
The 0.2 seconds has now been repeated so that it occurs twice.
Select the first 0.2 seconds again:
SelectTime:End="0.02" RelativeTo="SelectionStart" Start="0"
and silence it:
Silence:
OK. I would have thought the first Select of 20 ms would have been enough for then shoot the Silence instruction. How come the Repeat is needed and then another Select of 20ms ? Just for my understanding.
That would just silence 20 ms of the audio.
To “add” 20 ms of silence, you need to add 20 ms, then silence it.
I see. And is it the Repeat instruction which by itself insert the new 20ms to be silenced?
Yes. After “Repeat:Count="1"” there is the original 20 ms AND the repeated 20 ms, both selected.
I understand now. Thanks a lot for your precious help, as always.