Difficulty Creating a Macro

I’m trying to create a Macro using the ACX test steps. However, I’m getting busted on the very first step (Effect > Equalization > Select Curve: Low rolloff for speech, Length of Filter: about 5000 > OK).

The first command is Equalization, and what you get in the parameters field is this: CurveName = “unnamed” FilterLength=“5000” InterpolateLIN=“0” InterpolationMethod=“cubic”.

When you select Edit, it opens up the Equalization window. But, as usual (whenever I select Low rolloff for speech), the field reverts to its default “Unnamed” as though I’ve not selected anything. The result here is that I cannot change the CurveName to Low rolloff for speech.

Is there a way I can fix this?

Thanks!

Ensure that you are using the current version of Audacity (https://www.audacityteam.org/download/mac/)

Ensure that the Equalization effect is in “Draw” mode (https://manual.audacityteam.org/man/equalization.html)

I’m trying to create a Macro using the ACX test steps.

Probably not. You’re automating the Audiobook Mastering steps. Testing is already a single tool.

You’re going to post the Macro on the forum when you’re done, right? You’d be the biggest hero since Flynwill developed ACX Check.

I don’t remember if you can comment in Macros, but if you can, include your name (if you wish), date, version and other authorship info. There’s just nothing like two (or more) similarly-named apps with no version or date info.

Koz

I found where Audacity keeps Macros.


Screen Shot 2019-03-08 at 3.51.31.png
I don’t think it says that anywhere in the instructions.

So Macros are text files. some-job.txt

Is there a comment process? Any line that starts with two semis is ignored? (I’m making this up).

;;example_by_koz_2019-03-08

Koz

Oop. Here it is. Hash. I assume CR LF ends the comment.

#Example by koz 2019-03-08

Koz

Indeed, I think you’re right Koz. I can fix that (but not for the soon to be upcoming 2.3.1 Manual).

I’ve made a “note-to-self” to do that for the 2.3.2 Manual (an ednote in the manual)

Peter

Indeed - which means that expert users can edit the txt files directly - and copy and paste between Macros and between Maro users.

That’s not in the Manual (yet) either.

Peter

Well, well - I never knew that.

And that’s not in the Manual (yet) either …

Peter.

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.

Hash. I assume CR LF ends the comment. And that’s not in the Manual (yet) either …

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.


No. Wait. Don’t put a hash character in there, you’ll [dense explosion].

Koz

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.

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

“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

Command-name: keyword=value keyword=value  ...

The values may be numbers, strings (text) or keywords (enums), as indicated in the Scripting Reference.

@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

Yes it would, though it’s pretty unlikely that you would “accidentally” type a valid command.

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.

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.

Thanks for that clarification Steve.

Peter.

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

Given that deborah1217 has not written back, I assume that this post solved the problem: Difficulty Creating a Macro - #2 by steve

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 (https://forum.audacityteam.org/t/audiobook-mastering-version-4/45908/1). 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? :smiley:

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!) :wink:

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. :smiley: