Difficulty Creating a Macro

Help for Audacity on macOS.
Forum rules
ImageThis forum is for Audacity on macOS 10.4 and later.
Please state which version of macOS you are using,
and the exact three-section version number of Audacity from "Audacity menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
kozikowski
Forum Staff
Posts: 68902
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Difficulty Creating a Macro

Post by kozikowski » Fri Mar 08, 2019 12:25 pm

putting the "#" at the start makes it easier for a person to identify.
And guards against typing a valid command by mistake.
We assume.
Koz

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

Re: Difficulty Creating a Macro

Post by steve » Fri Mar 08, 2019 12:30 pm

kozikowski wrote:
Fri Mar 08, 2019 12:19 pm
I'm going on extrapolation of forum comments. I don't know that Python comments is supported.
I'm waiting for someone to argue with me.
"Normal" Macros are not Python. They are just a list of plain text "strings", which Audacity parses. The syntax is very simple. It's a command name with a colon at the end, followed by zero or more keyword arguments

Code: Select all

Command-name: keyword=value keyword=value  ...
The values may be numbers, strings (text) or keywords (enums), as indicated in the Scripting Reference.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

kozikowski
Forum Staff
Posts: 68902
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Difficulty Creating a Macro

Post by kozikowski » Fri Mar 08, 2019 12:31 pm

@deborah1217

So there you have it. When you post audiobook-mastering.txt Macro on the forum, include a line at the top starting with a hash character (#) and including version, date, etc.

Thanks,

Koz

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

Re: Difficulty Creating a Macro

Post by steve » Fri Mar 08, 2019 12:31 pm

kozikowski wrote:
Fri Mar 08, 2019 12:25 pm
And guards against typing a valid command by mistake.
Yes it would, though it's pretty unlikely that you would "accidentally" type a valid command.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

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

Re: Difficulty Creating a Macro

Post by steve » Fri Mar 08, 2019 12:34 pm

I've not tested, but I'd be cautious about using any "special" characters in a comment. I don't know if Macro "txt" files will handle mult-byte Unicode characters safely. Normal printable ascii characters should all be OK.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

waxcylinder
Forum Staff
Posts: 14574
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Difficulty Creating a Macro

Post by waxcylinder » Fri Mar 08, 2019 12:43 pm

kozikowski wrote:
Fri Mar 08, 2019 12:19 pm
Indeed, I think you're right Koz.
This wasn't an exhaustive search. I just know someone is going to ask how to post a Macro and I should know where they are.
I believe that James (Mr Macros-dev) has plans for adding Export and Import buttons to the manage Macros dialog.

I would certainly like to see that.

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

waxcylinder
Forum Staff
Posts: 14574
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Difficulty Creating a Macro

Post by waxcylinder » Fri Mar 08, 2019 12:44 pm

steve wrote:
Fri Mar 08, 2019 12:21 pm
waxcylinder wrote:
Fri Mar 08, 2019 12:10 pm
And that's not in the Manual (yet) either ...
It is not really a "feature". It works because the Macro ignores invalid commands, and "#Example by koz 2019-03-08" is not a valid command.
You could just enter (on it's own line) "Example by koz 2019-03-08", but putting the "#" at the start makes it easier for a person to identify.
Thanks for that clarification Steve.

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

billw58
Forum Staff
Posts: 5565
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Difficulty Creating a Macro

Post by billw58 » Fri Mar 08, 2019 6:21 pm

I think we've forgotten deborah1217 and her initial problem. The Equalization effect is flaky when it comes to recalling presets.

See bug 1722 and bug 2031 .

Her experience may point to further quirks in the preset system for the Equalization effect.

In the meantime, is there some alternative we could offer her, such as using the High Pass Filter effect?

-- Bill

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

Re: Difficulty Creating a Macro

Post by steve » Sat Mar 09, 2019 11:13 am

billw58 wrote:
Fri Mar 08, 2019 6:21 pm
I think we've forgotten deborah1217 and her initial problem.
Given that deborah1217 has not written back, I assume that this post solved the problem: viewtopic.php?p=365475#p365475
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

deborah1217
Posts: 39
Joined: Fri Feb 15, 2019 10:02 pm
Operating System: macOS 10.15 Catalina or later

Re: Difficulty Creating a Macro

Post by deborah1217 » Sun Mar 10, 2019 6:41 am

I haven't responded yet because it's been crazy busy around here - lol!

So here's what I sent Koz in an email.

I was a bit surprised by your email because all I did was use your own stuff. I did have to find a workaround for step one, though, so here's my exact process for creating a macro that will do the ACX steps in order as though you had done them individually. I've written every single thing I did so you can see exactly what I did (which means it will be tedious for you, I'm sure. But there it is.)

STEP 1: Review the process instructions for the ACX test (viewtopic.php?f=64&t=96103). I've copy-pasted them here:

Select the whole reading or chapter by clicking just right of the up arrow button (on the left).
1. Effect > Equalization > Select Curve: Low roll off for speech, Length of Filter: about 5000 > OK.
2. Effect > RMS Normalize: Target RMS Level -20dB > OK.
3. Effect > Limiter: Soft Limit, 0, 0, -3.5dB, 10, No > OK.


Basically, I just put each one of these as a step in a macro, although I had to find a workaround for the first one.

Record 10 seconds of speech and apply all of the above settings and run the ACX test (plug-in previously downloaded and enabled). Your clip should pass. After it's passed, revert your file back to its original recorded state. (This is so you can test whether your macro works.)

STEP 2: Create a new macro by going to Tools > Macros.
1. In Manage Macros window, select New and name your macro. (I named mine ACX Magic Macro.)
2. Select Insert to open Select Command window.
3. Select Equalization as per the first of the three steps in bold above.
  • The Parameters field will populate with this: CurveName = "unnamed" FilterLength="5000" InterpolateLIN="0" InterpolationMethod="cubic".
    This will be a problem because you need "unnamed" to be "low roll off for speech" for it to work.
  • You can select edit and then select low roll off for speech from the curve dropdown list. However, it won't stick. It will immediately revert to "unnamed" so you can't edit the Parameters field to reflect the exact choices in the first step of the ACX Process. (I tried to leave it like this and my recording failed the ACX test later.)

APPLY THE WORKAROUND.
Do everything in the step immediately above, but this time, choose any curve EXCEPT low roll off for speech. Then change it to low roll off for speech. (I know, I know. You should be able to go straight to low roll off to speech, but it doesn't alter the settings at all. It was only after I picked something else first that I could then immediately select low roll off to speech and see the settings actually change.)
1. Select Manage > Save Preset.[/list]
2. Save Preset window opens with a blank field for the name (I called mine Low Roll Off for Speech) and select OK to save.
3. This takes you back to the Equalization window. Select OK.
4. This takes you back to the Select Command window. Select Use Preset to open Select Preset window.
5. Select Type (User Presets) and Preset (Low Roll Off for Speech).
6. This will take you back to the Select Command window where the Parameters field will now read: Use_Preset="User Preset":"Low Roll Off for Speech."
7. Select OK to return to Manage Macros window. You will see Use_Preset="User Preset":"Low Roll Off for Speech" as the first command in your macro.

Select Insert to open Select Command window again.

1. Select RMS Normalize from the choices. The Parameters field should populate with this (if your last use was the setting in step 2 of the ACX Process): mode="independently" target="-20" (If it wasn't, enter the appropriate setting info.)
2. Select OK to return to Manage Macros window. You will see mode="independently" target="-20" as the second command in your macro.

Select Insert to open Select Command window again.

1. Select Limiter from the choices. The Parameters field should populate with this (if your last use was the setting in step 3 of the ACX Process): gain-L="0" gain-R="0" hold="10" makeup="No" thresh="-3.5" type="SoftLimit". (If it wasn't, enter the appropriate setting info.)
2. Select OK to return to Manage Macros window. You will see gain-L="0" gain-R="0" hold="10" makeup="No" thresh="-3.5" type="SoftLimit" as the third and final command in your macro.
3. Select OK in Select Command window to save your macro.[/list]

Apply your new macro.

1. Select your recorded audio.
2. Go to Tools > Apply Macro > ACX Magic Macro
3. Go to Analyze > ACX Check (Nyquest plug-in uploaded and enabled prior to this process.)
4. Scream, "Yeeeeeeees!" because it worked and you passed all three parts of the test.

I ran this macro on three different audio files that don't pass the ACX test in their edited state. (This was before I found the 3-step ACX process. They only passed after I did each of the 3 steps individually.) I saved these files as copies for my demo but kept the edited originals. When I opened these edited originals today, I analyzed them with the ACX test and they all failed (of course). This was good, I needed to make sure they were in need of the ACX Process to confirm my macro worked. And it did. (I did this as scientifically as possible. I urge you to try it on your own files and see how it works before proclaiming to the world that I've got a solution.)

If this works out, can I have a shout-out for it so I can feel Super Special? :D

P.S. I found a way to make a comment or note in a Macro!

Tools > Macros > Manage Macros > Insert > Select Message from the list of choices.

(I put a # in front of my text just in case, though, Koz!) ;)

I ran a test on it, and the message did not interfere with the macro's commands.

This is what the macro looks like in the library:

Equalization:Use_Preset="User Preset:Low roll off for speech"
RmsNormalize:mode="Independently" target="-20"
Limiter:gain-L="0" gain-R="0" hold="10" makeup="No" thresh="-3.5" type="SoftLimit"
Message:Text="#ACX Magic Macro; Deborah Nolan; 3-10-19"

As pointed out earlier, a user would have to first create a preset using step 1 of the ACX pass process and put that preset into the macro as step one. But once they do that, they should be home free to create the macro. :D
Last edited by deborah1217 on Sun Mar 10, 2019 7:45 am, edited 2 times in total.

Post Reply