Clicking Enter as part of a macro

Questions, discussion and recipes for scripting and batch processing in Audacity.
See also the "Scripting" section of the Audacity manual.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
joedale
Posts: 11
Joined: Wed Jun 02, 2021 1:02 pm
Operating System: Windows 10

Re: Clicking Enter as part of a macro

Post by joedale » Wed Jun 02, 2021 6:16 pm

Hi Steve,

Thank you so much for your help so far. Yes that's the idea to have one macro which works on any track in a multi-track session.

Best wishes

Joe

joedale
Posts: 11
Joined: Wed Jun 02, 2021 1:02 pm
Operating System: Windows 10

Re: Clicking Enter as part of a macro

Post by joedale » Wed Jun 02, 2021 7:13 pm

Yes, that's right Steve. Ideally I would like to be able to click near the section I want to replace with room tone, run the macro which will then grab the 5 seconds of room tone at the beginning of the track, put the cursor back in the same position as before the macro was run so I can select the error and use the hot key to run Punch Paste. It would be great to do this with one macro rather than two.

Best wishes

Joe

steve
Site Admin
Posts: 81356
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Clicking Enter as part of a macro

Post by steve » Wed Jun 02, 2021 7:13 pm

To avoid problems with the new version (which I'll post shortly), you should reset Audacity's effects.
To do that:
  1. Ensure that Audacity is not running.
  2. Open the hidden folder: Users\<username>\AppData\Roaming\audacity\
    (where "<username>" is your computer log-in name).
  3. Delete these two files:
    pluginregistry.cfg
    pluginsettings.cfg
Then go to: Users\<username>\AppData\Roaming\audacity\Plug-Ins and delete "PunchCopy.ny" and "PunchPaste.ny".

After that you will need to re-enable any custom plug-ins that you have installed (they will be listed as "New" plug-ins in the Plug-in Manager).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81356
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Clicking Enter as part of a macro

Post by steve » Wed Jun 02, 2021 7:21 pm

Here's the macro that I've tested with:
PunchCopyPaste.txt
(215 Bytes) Downloaded 19 times
and here are the new plug-ins:
PunchCopyPaste.ny
(10.08 KiB) Downloaded 17 times
PunchPaste.ny
(6.21 KiB) Downloaded 17 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

joedale
Posts: 11
Joined: Wed Jun 02, 2021 1:02 pm
Operating System: Windows 10

Re: Clicking Enter as part of a macro

Post by joedale » Wed Jun 02, 2021 7:39 pm

Hi Steve,

I downloaded both the new plugins and enabled them, but they are not appearing in the effects menu. Shift O and Shift P are still working to enable Punch Copy/Paste and Punch Paste. I imported the txt file for the macro, but when I ran it, it selected both tracks and cleared them / replaced them with room tone. Any idea what the issues are?

Best wishes

Joe

joedale
Posts: 11
Joined: Wed Jun 02, 2021 1:02 pm
Operating System: Windows 10

Re: Clicking Enter as part of a macro

Post by joedale » Wed Jun 02, 2021 8:03 pm

Hi Steve,

I've just noticed that the Punch Copy/Paste and Punch Paste are now in the Tools menu. What have I done wrong?

Best wishes

Joe

steve
Site Admin
Posts: 81356
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Clicking Enter as part of a macro

Post by steve » Wed Jun 02, 2021 8:32 pm

joedale wrote:
Wed Jun 02, 2021 8:03 pm
I've just noticed that the Punch Copy/Paste and Punch Paste are now in the Tools menu. What have I done wrong?
That's correct. Is that a problem?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

joedale
Posts: 11
Joined: Wed Jun 02, 2021 1:02 pm
Operating System: Windows 10

Re: Clicking Enter as part of a macro

Post by joedale » Wed Jun 02, 2021 8:40 pm

Hi Steve,

I was just surprised to see the Punch Copy/Paste and Punch Paste plug-ins in the Tools menu as they've always been in the Effects menu. Are all new custom plug-ins placed in the Tools menu in 3.0.2? I've removed the Punch Paste step from the macro by the way and it's working how I wanted it so thank you so much!

Just another thought, would it be possible to select a mistake in a track, run a similar macro and have the mistake replaced with room tone taken from the first five seconds of the track? That would require fewer clicks if possible. I really appreciate all your help today by the way.

Best wishes

Joe

steve
Site Admin
Posts: 81356
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Clicking Enter as part of a macro

Post by steve » Wed Jun 02, 2021 8:56 pm

joedale wrote:
Wed Jun 02, 2021 8:40 pm
I was just surprised to see the Punch Copy/Paste and Punch Paste plug-ins in the Tools menu as they've always been in the Effects menu.
I should have mentioned that change. Pleased that you found it, and hope that it did not cause you too much bother.
I also updated the code to the current version.
joedale wrote:
Wed Jun 02, 2021 8:40 pm
Are all new custom plug-ins placed in the Tools menu in 3.0.2?
No. Usually:
  • Plug-ins that process the selected audio are in the "Effect" menu.
  • Plug-ins that generate audio are in the "Generate" menu.
  • Plug-ins that analyze the selected audio are in the "Analyze" menu.
  • Other plug-ins that are not of the above three types are in the "Tools" menu.
These two plug-ins are sort of "Edit" type, but we can't put plug-ins in the "Edit" menu, so the "Tools" menu seemed to me like the best option.

joedale wrote:
Wed Jun 02, 2021 8:40 pm
Just another thought, would it be possible to select a mistake in a track, run a simialr macro and have the mistake replaced with room tone taken from the first five seconds of the track? That would require fewer clicks if possible.
The plug-ins and macro are not fussy what audio you select. Whatever you select, when you run the macro, it will replace the selected audio with audio from the first 5 seconds of the track.
Note also that if the first 5 seconds is not "silence", the plug-ins and macro don't care about that either. They will paste whatever is in the first 5 seconds.

Have fun, and let me know how you get on.
In particular, let me know if you find any bugs in the new effects (I've done some testing, but I didn't want to keep you waiting too long ;))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

joedale
Posts: 11
Joined: Wed Jun 02, 2021 1:02 pm
Operating System: Windows 10

Re: Clicking Enter as part of a macro

Post by joedale » Wed Jun 02, 2021 9:05 pm

Hi Steve,

I've just re-added the Punch Paste element into the macro and ran it having made a selection and it replaced it with room tone e.g. from the first five seconds of the track. Thank you so much. This is going to save me hours! Really, really appreciate your expertise and advice.

Best wishes

Joe

Post Reply