Running a certain macro code from a Nyquist

Running a certain macro code from a Nyquist request, how do you do it? Thank you very much and sorry for the ignorance.

If the macro contains any Nyquist effects, then it cannot be run from a Nyquist script.

If it does not contain any Nyquist effects, then the macro can be called using AUD-DO

Thank you for your kind help
Could you please add an example of how I use this command to run a certain macro?
For example, I want the Nyquist code to command it to execute a macro named BKR, what is the correct syntax for this purpose? I tried in several ways and couldn’t, even in the documentation of the command I didn’t find an example of running a macro. Thank you very much

The name of that macro as it appears in the Macro Manager will be something like BKR (Macro_BKR). The first part, BKR, is the display name, The second part in parentheses, Macro_BKR, is the “code” name. It is the code name that you need for the AUD-DO command.

Using the Nyquist Prompt, you just need:

(aud-do "Macro_BKR")
""

Note 1: Check the actual name of the macro as it appears in the list of available macro commands.

Note 2: The two double quotes on the last line are required as they tell Audacity that there will not be anything else returned to it from Nyquist. If that is missing, a silent error is raised that may prevent the command working.

I tried with and without the quotes.
But there was no effect.
It should be noted that I use the Nyquist board a lot, without any problems.
Thank you for the kind wish

I have to tell you, that your code did work with commands placed in the macro, when the instructions were: new strip, select all, and more.
What doesn’t work for me is a macro code with the command: ‘select time’ split’
TY

Perhaps you could export your macro and attach it to your reply so that I can test it here to see what might be going wrong.

SelectTime:End="60" RelativeTo="SelectionStart" Start="60"
Split:

================
Although this is a very short macro, I intend to repeat it in a loop many times, so it is important for me to understand the possibility of how it can be integrated into the Nyquist code

That macro requires Nyquist to run as a “tool”.
Try this version:

;type tool
(aud-do "Macro_BKR")
""

Hooray! most wonderful
It promotes me a lot.
The next obvious question is how do I put it in a loop?
For example if I want it to repeat X times.

I tried like this:
;type tool
(do (i 1 5)
(aud-do “Macro_BKR”)
“”
But it didn’t work
When debugging it gave the following error message:
error: unexpected EOF
Function: #<Subr-(null): #000001A595849898>
Arguments:
#<File-Stream: #000001A588172EF8>
#(
1>

Why would you want to apply “Split” in the same place multiple times?

Not in the same place. I instruct him to move forward X seconds, and perform a split. and advance another X seconds to perform another additional split in the next place, and so on

later on. Although for this specific need I found a solution from another direction without using a macro, using the aud-do commands as you suggested above, and this is the idea:
(
dotimes (i 5 )

(aud-do “SelectTime : End=60 RelativeTo=SelectionStart Start=60”)
(aud-do “Split:”)
)
But I’m asking in principle how it is possible to make a loop for running a macro, in case the macro is more complex, and it also needs to be flexible to change it if necessary, what is the correct syntax then for making a macro inside a loop.
thanks

If you want to split a track at regular intervals of 60 seconds, the better (faster) way to do it is:

  1. Regular Interval Labels
  2. “Edit menu > Labeled Audio > Split”

Excellent!
How simple!

This topic was automatically closed after 30 days. New replies are no longer allowed.