Enhancement for Macros

Steve,

I was working on a macro to take the pause in an audio file (that occurs between a talk and the q/a section or between particular questions and answers) and replace it with a fixed length of room tone and at the same time do a fade-out on the leading audio with a fade-in on the trailing audio. That way all my transitions are consistent.

I was using your MacroStepThrough tool to test the various steps and noticed that if I am using Fade + for the fading that the MacroStepThrough did not perform that step but it was performed in the actual execution of the Macro. The same is true with a Punch-Paste step I have in the Macro using room tone in the fixed clipboard. If I replace the Fade + with Fade-In or Fade-Out and if I replace the Punch-Paste with a Silence-Audio command, all those effects do show up when I do a MacroStepThrough.

I’m wondering if maybe the MacroStepThrough treats Nyquist commands differently than other internal commands.

It’s not a big deal as I’m sure you have plenty of other things to work on. Just thought I would check.

Thanks,

Mike

Yes it does. This is a limitation of running macro commands from Nyquist - you can’t run a Nyquist plug-in from a Nyquist plug-in.

For example:
You can run the normal “Fade In” or “Fade Out” effects from Nyquist, and you can run a macro that contains “Fade In” or “Fade Out” from Nyquist,
but,
You cannot run “Studio Fade” or “Adjustable Fade” (both of which are Nyquist effects) from Nyquist, and you cannot run a macro that contains “Studio Fade” or “Adjustable Fade” from Nyquist. In this case the “Studio Fade” or “Adjustable Fade” step will silently fail.

Unfortunately there is currently no way round this limitation.

A new version of “Macro Step Through”.
Unfortunately it still has the same limitation as described in my previous post (Nyquist effects don’t run), but it has some additional “Actions”.

  • Step: This is the normal step-through mode. Performs one step of a macro.
    Each time this runs it automatically moves onto the next command in the macro.
  • Restart: Resets and runs the first step of the macro.
    You would normally run this once only and then change to the normal “Step” action.
  • Skip Step: Skips one command step and runs the next one.
  • Repeat Step: Runs the last step again.
  • Run All: Runs the entire macro from start to end.
    (as always, any Nyquist effects in the macro fail silently)
  • Reset: Reset (only).

Note that as with all Nyquist effects, it defaults to the last selected settings, so, for example, if you run “Action: Reset”, then repeating “Macro Step Trough” will simply reset again. To go back to stepping through a macro you need to run it with the GUI and select “Action: Step”.
MacroStepThrough.ny (2.31 KB)
Feedback and bug reports welcome.

Steve,

Thanks for this update - it will definitely come in handy.

I was testing a simple macro that has three steps:

  • select 0-5 minutes


  • select 5-10 minutes


  • select 10-15 minutes

When I start the macro and select skip step, the macro executes the third step but I’m expecting it to skip over the first step and execute step 2, i.e., select 5-10 minutes.

If I’m about to execute step 2 and select skip step, it does go to step three. So maybe there is a glitch at the first step?

Also, it would be nice to have a counter in the dialog box that indicates which step of the macro was either just executed or will be executed next - especially for longer macros. I guess that might be a bit complicated to program if you are using repeat and skip a lot.

Thanks,

Mike

I’ve probably used a count starting from 0 in one place, and starting from 1 in another.
Should be an easy fix.


I considered that, but it could be annoying, or at least slower if you have to dismiss a message dialog after each step:
_____________
Executed step 1
of “My Test Macro”.
[OK]

I guess there could be an option in the GUI:
Display Step Number: (choice) [Yes | No]

Steve, or could it just be a notification that says “Step 1 Executed” without needing a reply?

If it’s a pop-up window displaying a result from the Nyquist plug-in, then it has to be dismissed before you can do anything else.
Try this in the Nyquist Prompt:

(print "I am a message window.")

Could it be a part of the “Action (Step XX):” or even part of the title of the dialog - “Macro Step Through - Step XX”?

Capture.JPG

The available GUI options for Nyquist plug-ins are quite limited.

The interface is created on the fly by Audacity before the Nyquist code runs.
The plug-in code only knows which line of the file it is on when the code runs.
so it is not possible for the plug-in code to modify the GUI in any way.

Something that I’d like to see in the future is the ability for the plug-in code to define the GUI. On launching a Nyquist effect, part of the Nyquist code runs first to create the GUI, then on clicking “OK” the effect itself runs. We don’t have this yet.

Possible solution - I could print the line number to the debug output.

The debug output is visible in one of two ways:

  1. Run the effect with the “Debug” button (rather than the “OK” button).
  2. Run the effect with the “OK” button and look in the Audacity log window.

I expect that the Audacity log window would normally be preferable as you can open it (from “Help menu > Diagnostics > Show Log”) and leave it open while using Audacity.

Steve,

Thanks for thinking about this - not having the line number is not an insurmountable issue. I just thought, if it was easy, it would be nice.

If the debug output option is not a big deal, that would certainly work.

Thanks,

Mike

Looks straightforward, and I can probably add some other useful information there as well.

Here’s a new version to try.
As I wrote previously, you can either run with the “Debug” button, or open the Audacity log to view additional information.
MacroStepThrough.ny (3.23 KB)

Thanks Steve - works great!

The notifications in the Audacity Log and Debug option will be useful - thanks for doing this.

Mike