Enhancement for Macros

Hi,

Not sure if this has been brought up before (or if there is a way to do it that I haven’t found), but it would be nice if we could step through a macro one command at a time or execute a certain number of steps and then stop. It would help in design of longer Macros.

Thanks,

Mike

That is exactly how I create Macros.

First I work out the steps by manually applying each step in turn. If it’s a lot of steps, I write the steps down on paper.
I then add the first step to the macro, test, then undo, then add the next step, test, undo, add the next step…

Personally I find this approach much easier than trying to debug a long complex macro that doesn’t work as expected.

i do something similar too but i also can see a lot of value in this suggestion.

sometimes you can have something complex that seems like it’s working and it’s not until later that you run into an unanticipated scenario in which it does not behave as expected. in that kind of case this could be very handy.

babag

I expect that the GUI for macros will improve over time (it’s rather basic at the moment, but at least it is usable).
For now, it would probably be possible to create a plug-in that takes the name of an existing Macro as its input, and allows you to step through the commands in that Macro one at a time.

I’ve not yet tested this, but I’m considering what is currently possible, and I think something like this could work:

  1. Launch a “Step through Macro” effect.
  2. Enter the name of an existing Macro in the “Step through Macro” effect GUI and click the “OK” or “Debug” button.
  3. The effect reads the first command from the Macro file and runs it.
  4. Press “Ctrl + R” to run the “Step through Macro” effect again. This time it reads the second line from the Macro file and runs that.
  5. Repeat step 4 until the end of the Macro file is reached. The plug-in then resets.

There would also need to be some way to reset the plug-in.

Does that idea sound like it has legs?

while i do think this sounds like a good idea, i haven’t been around audacity closely enough to have a good sense of how it develops. i’d hate to see you go and do a bunch of work only to have it superceded by the next release. if macros are getting attention, it might not be the time to be putting as bunch of work into community enhancements. it does seem like there’s a lot that has been and could be done from the developer end of things.

thanks,
babag

Audacity tends to develop quite slowly. It’s a very small team of volunteers. There are no major changes to macros in the next version, so I think this could be worth the time investment. I’ll see if I can create a “proof of concept” and then we can take it from there.

Steve,

That approach would be great for stepping through and troubleshooting a Macro! I would welcome that as a solution to the suggestion I brought up!

I don’t want to push my luck, but as long as your in the “Macro mood”, … maybe the ability to create a copy of a Macro. That way when troubleshooting, you could keep the original and have a working copy to play with.

If I want a copy now, I go to the Macro folder and copy the Macro I want to work on to a new name. That works fine, but I need to exit Audacity, go to the folder, copy and rename the Macro, and then re-start Audacity. Not a big deal, but a copy button, or a copy Macro plug-in would be helpful.

Thanks again for the quick feedback.

Mike

Unfortunately I overlooked a problem, so there is a limitation.

“Ctrl+R” will repeat the last “Effect”, but it only works for “Effects” and not “Tools” (or Generators or Analyze plug-ins).

“Effect” type plug-ins require an audio selection, otherwise you just get an error message telling you to make a selection.

Macros do not require an audio selection, and some Macros may contain one or more steps where there is no selection.

A possible workaround would be if I make this a “Tool” type plug-in, but then you would need to create a custom shortcut rather than “Ctrl+R”. (I’ve not tried that yet).

The next version of Audacity will have “Import” and “Export” buttons.
Until then, just manually copy the files in:
Users**\AppData\Roaming\audacity\Macros**
as you are doing now.

Here’s the plug-in:
MacroStepThrough.ny (1.38 KB)
When installed it will appear in the Tools menu.

The way that I’m using it is to set a keyboard shortcut ("Ctrl + ", but for no other reason than it’s available).
To step through requires two key pressess: "Ctrl + " then “Enter”.

On completion of the Macro, the plug-in automatically resets.
To force a reset before the Macro has completed, either enter an invalid Macro name, or leave the Macro name empty.

Steve,

This is great - it will come in very handy and is much appreciated!

It’s easy to work with and really allows control over the Macro development process without having to create multiple test Macros by adding and deleting lines successively. It will really be a time saver.

Thanks!

Mike

MacroMan.JPG

Hi Steve,

this looks most interesting.

So are you planning to get this included in Audacity’s shipped tools (or will it remain an under-the-counter item for the cognoscenti) ?

Peter.

@Mike: if we had a “Like” button I’d have clicked it for your Macro Man image :slight_smile:

I think it’ll remain under the counter due to the awkwardness of not being able to repeat the last “Tool” effect. (It has to be a “Tool” type effect to be able to run without an audio selection).

Steve,

Is there a list of those under-the-counter tools/effects around somewhere?

I think that generally I see them pop up in various posts when someone asks a question about a need they have, e.g., one I remember recently was moving the bottom track up to be under the current track with the focus. So I’m thinking that there may be tools/effects under-the-counter that are the answer to a question I/we haven’t even thought to ask about yet.

Thanks,

Mike

There are the quasi-official plug-ins on the Audacity wiki: Missing features - Audacity Support

Other than that, there’s plug-ins that are (mostly) in these forum boards:

There’s no index for those plug-ins.
For those plug-ins to be uploaded to the wiki, they need to be tested to ensure that they work as advertised, sufficiently documented so that they don’t generate a lot of support requests, and coded in a sufficiently maintainable manner that they can be updated / fixed if necessary.

Unfortunately the way that the wiki works, it’s a rather tedious process to upload them.

Steve,

So I did a search on the Macros and Scripting Forum for “*.NY” to locate all of the Nyquist Plugins that were referenced. I got only 14 matches and the new Plugin that you have in this thread (MacroStepThrough.NY) was not one of the matches that I got.

Can you tell be if I’m doing something wrong?

Thanks,

Mike

Search1.png

Search2.png

The forum search is pretty good if you are looking for one specific thing with the advanced search. For example search for “popmute” posted by “steve” in “Nyquist” forum.
I find the forum search pretty poor for more general searches, and find that Google search works better.

Try Google search for:

site:forum.audacityteam.org ".ny"

I’ve just tested with Audacity 3.0.0 (release candidate).
In this version of Audacity there is an option to create a keyboard shortcut for “Repeat last tool”. I’ve set “Ctrl + Shift + R”.
“Macro Step Through” works brilliantly with the shortcut :slight_smile:

Steve,

Thanks for adding that option and thanks for pointing it out - that will be nice!

Mike

Glad to hear this. :wink: