Manage Macros

From Audacity Development Manual
Revision as of 15:51, 6 March 2018 by PeterSampson (talk | contribs) (Apply Macro to Files...: Use the {{button|Files...}} button to apply the selected Macro to selected external audio files that are in a single directory. If you already have audio in the current project window, you must save and close that project usi)
Jump to: navigation, search
Peter 06Mar18:
Advice N.B. This page has multiple anchors in places. This is to deal with the 2.3.0 functionality where Macros replaced Chains - but also to deal with older pre-existing links in the Forum which still will link to the chain anchors.
Peter 29Jun15: ToDo-2P Placeholder to remind us that if the list of effects changes we also need to update the image on the this page.
Other languages
English
Manage Macros allows you to edit, remove or rename existing Macros or add a new Macro and to apply Macros to you project or a set of files. Any built-in, LADSPA, LV2, Nyquist, VST or Audio Unit (Mac) effect shown in the Effect Menu can be added to a Macro. You can also add plug-ins in any format that are shown in the Generate or Analyze Menus (including Vamp analysis effects), the built-in Find Clipping analyzer and a number of export commands.

Macros may be applied to either the entirety of the current project or to a selection of files using the Tools > Macros... command.

It is possible to use Noise Reduction in Macros but see Noise Reduction Tips for how the Noise Profile is captured.

Accessed by: Tools > Macros...
ManageMacros.png


For help with what the Macro effects do and how to set their parameters, see Effect Menu

Select Macro

Select Macro contains a list of already defined Macros. You can define the name of a new Macro and select which Macro is active.

  • Add: Add a new Macro to the list.
  • Remove: Remove the selected Macro from the list.
  • Rename: Rename the selected Macro.

Macro

Macro lists the sequence of commands in order of first to last (End) for the Macro selected in the "Select Macros" box to left. Here you can add or remove commands for the selected Macro, change the order in which the commands execute in the Macro, or edit the parameters for some effects in the Macro.

  • Delete: Delete the currently selected command from the list.
  • Move Up: Move the currently selected command up in the list.
  • Move Down: Move the currently selected command down in the list.
  • Defaults: This button is only active when the "MP3 Conversion" Maco is selected in the "Select Macros" list on the left, and will reset this Macro to its default values.</ul>

Editing an existing command

To edit an existing command double-click it, or use the Up or Down keyboard arrow to select it then press Space. The "Select Command" dialog appears as below, but with the command name and any current parameters displayed and editable (using the Edit Parameters button - or you can specify any previously created user preset with the Use Preset for use with the effect). If you want to replace the current command in its current order in the sequence with another command, double-click the new command (or select it then use Space) then choose OK.

Inserting a new command

To insert a new command in a Macro, left-click or use the Up or Down keyboard arrow to select an existing command; the new command to be inserted will be placed above this selected command. Then press Insert.

  • The "Select Command" dialog appears, listing all the available commands. Double-click a command from the list to insert it in the "Command" box, as shown in the image below after inserting "Normalize".
Alternatively, use the Up or Down keyboard arrow to select the command, then press Space.
Edit Chains select command.png
  • If the command has editable parameters, the Edit Parameters button will be active. Clicking this button will bring up the dialog box for the effect where you can set the parameters as if you were applying the standalone effect.
  • If you have previously created user presets for an effect you can use the Use Preset to select one for use with that effect in the Macro.
  • Choose OK in the effect dialog to accept the parameters you entered, or Cancel to revert to the default parameters.
  • Choose OK in the "Select Command" dialog to add the command to the Macro.
Tip Macros will work on pre-existing selections you make in your project prior to running the Macro. But the selection can be over-ridden by your Macro itself as there are macro commands available to effect selections in the audio. In particular All(Select All) will select the entire project and Select which is parameterizable (see the provided Fade Ends Macro for an example where the first and last one seconds of the audio are selected for the fades).

Export commands

  • There are four basic export commands available: Export as WAV, Export as MP3, Export as FLAC and Export as Ogg.
    • The file name created by any of the four export commands consists of the date and time.
  • The Export as MP3 56k before and Export as MP3 56k after commands can be used respectively to export "before" and "after" MP3 files at 56 kbps bit rate at any point in the Macro processing. This allows you to compare the result of one or more effects, or provide files for different purposes with and without a particular effect.
    • The name of the MP3 exported by the "Export as MP3 56k before" command is prefixed by "MasterBefore_" followed by the date and time. The name of the MP3 exported by the "Export as MP3 56k after" command is prefixed by "MasterAfter_" followed by the date and time.
Advice Parameters for export formats cannot be set in "Manage Macros". To configure export parameters for the Macro, click File > Export > Export Audio... to access the Export Audio Dialog, click Options, set the parameters, press OK then Cancel the export. An audio track must be on screen in order to open the Export Audio Dialog.

Batch command not recognized error

This error may sometimes occur for one or more commands in a Macro when updating from a previous Audacity version. The error may also occur if users sharing Macro have different Audacity versions or different versions of the plug-ins used in the Macro. The error will occur if:

  • any command in the Macro uses a different text format than that recognized by the version of Audacity in use
  • any plug-ins listed in the Macro are missing, in an incorrect location or are incompatible with the version of Audacity in use.

To resolve these errors, ensure you have compatible versions of all required plug-ins and that the plug-ins are installed correctly. If necessary, use the "Manage Macros" dialog to delete the command that fails then insert a replacement command for the same effect from the "Select Command" dialog.


Apply Macro to

Apply Macro to enables you to make a Macro operate on:

  • Your current open project
  • A set of selected external files
Peter 05Mar18: ToDo-1 consider using this as the main "Apply" text - with a link back to here from Apply Macro - or maybe t'other way around

Apply Macro to Project

Use the Project to apply the selected Macro to the current project window.

The typical purpose of this option is effect automation - apply a sequence of effects to the project, using effect parameters and an order of applying the effects that you have found to work well for the type of audio you are processing. This saves time and provides consistency in your workflow.

The effects in the Macro are applied to the selected region of waveform in the selected audio tracks. Usually the selected Macro would not include an export command so as to use the greater flexibility of the Export Audio Dialog.

If an export command is included in the Macro, the entire project audio is exported irrespective of track or region selection. Therefore if the project contains multiple audio tracks, they will be mixed together, unless any of the tracks are muted on the Track Control Panel.

The exported files will be saved in a folder named "cleaned".

  • If the audio in the project came from an imported file or files, the "cleaned" folder will be inside the directory from which the first file was imported. The original files are not altered.
  • Otherwise, a message prompt will indicate the location of the "cleaned" folder that will contain the exported file. The "cleaned" folder will be in the last location that the Macro process exported to. If the Macro process has never been used for export before, the "cleaned" folder will be in the location at which the File Export Dialog currently opens.

Apply Macro to Files...

Use the Files... button to apply the selected Macro to selected external audio files that are in a single directory. If you already have audio in the current project window, you must save and close that project using File > Close before applying a Macro to files.

The typical purpose of this option is batch processing - apply the Macro to multiple audio files so as to apply one or more effects to them, and/or convert them to another file format. You can convert from any file format supported by Audacity to WAV, MP3, OGG or FLAC. The selected Macro must include an "export" step, or the processed audio will not be saved.
Tip It is recommended not to process more than 500 files at a time.
  • A standard File Open dialog box will appear. Choose a directory then you can select one or any number of supported audio files in that directory, but not Audacity AUP project files. You cannot select files outside that directory, and files in folders inside that directory will not be processed. It is convenient therefore to first put all the audio files you want to process into one folder before applying the Macro.
  • After selecting the audio files you want to process, choose "Open".
  • Each file will be imported into Audacity and processed, exported to the format you chose in the Macro, then the processed audio will be removed so as to clear the temporary disk space that had been used.
  • The exported files will be saved in a folder named "cleaned" in the same folder that the original files came from. The original files are not altered.
When a Macro is applied to files, the only option is to import and process the entire file. Thus the entire file will be exported unless an effect in the Macro (such as Truncate Silence or Repeat) performs audio removal or insertion. Some optional Nyquist plug-ins have parameters to trim or extend audio by a specific length and so could be used for this purpose in a Macro.


Sharing a Macro

Peter 06Mar18: ToDo-1 when the import export buttons work this can be upgraded.

Each Macro is automatically saved as a separate text file with TXT extension in the "Macros" folder in Audacity's folder for application data. This allows you to copy a Macro and send it to another user, or to copy another user's Macro into this folder so as to add to your own list of Macros. An updated list of Macros will be available next time you open "Manage Macros" in Audacity.


Shrink - reduced Apply Macro dialog

Use the Shrink button to show a reduced Apply Macro dialog with a simple list of the existing Macros.

Apply Macro draft.png

For more details see the Apply Macro page.

Using the Expand button on this reduced dialog will return you to the full Manage Macros dialog.


Macros Examples

See the Macros Examples page for examples of using Macros.


<  Back to: Macros