Macros

From Audacity Development Manual
Revision as of 18:47, 5 March 2018 by PeterSampson (talk | contribs) (Macro Examples: Macro morphing)
Jump to: navigation, search
James 19Feb18: ToDo-1 Chains is massively expanded and rebranded as Macros (more functions) with the upcoming Automation for 2.3.0 We will need some examples pages, e.g. showing how to fade in and fade out automatically at start and end of tracks
  • There are extra buttons in the edit chains/macros dialog, so you can for example apply a chain/macro from there.
  • Clicking on the list of steps now goes direct to editing the parameters.
  • Some commands in the select command dialog now have the scripting id in brackets after the name, e.g. "Cut (CutLabels)".
    • The rule is a little involved. It is basically "Where needed to disambiguate".
    • The actual rule is based on whether the scripting id typically could or could not be easily deduced from the name, and is done by looking at the lengths. If scripting id is a lot longer, it's needed!
  • The select command dialog has a new 'Details' Textbox that shows the ScriptingID of the command, and its type. (maybe in time for 2.3.0 we will have some help information there too)
Other languages
English
Macros - for batch processing and effects automation

A Macro is a sequence of preconfigured commands in a set order (mainly effects) that can be applied automatically to projects or audio 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.

This ednote will automagically be replaced by the Annotated menu File-Chains.png, when it is ready


Peter 05Mar18: ToDo-1 image/imagemap of Tools > Macros menu required.
This ednote will automagically be replaced by the Annotated menu Tools-Macros.png, when it is ready


How to use Macros

The two uses of Macros are for:

  • Batch processing (where many audio files are processed unattended with one or more effects then exported to a new file)
  • Effects automation (where the selected audio in the track or tracks in the current project is subjected to the same prescribed sequence of effects, and optionally, a file exported from the entire audio.)

Look first at Edit Chains to determine if an existing Chain will suit your needs (Audacity only ships with one) or to create a new chain. Next, use Apply Chain to perform the action on your selected audio.

See the examples below.

Manage Macros

Use Tools > Macros if you need to create a new Macro or to edit an existing Macro.

  • The Macro can include a number of common Audacity functions and effects to be executed in any order you specify.
  • To create an audio file as part of the Macro process you must include an "Export" command (such as ExportWAV).
  • In many cases the parameters for each command in the Macro can be specified within the manage Macros dialog.
Edit Chains 2-2-2.png

The left hand box in the dialog (labeled Select Macros) contains a list of already defined Macros. Until you add a new Macro, it only has a single built-in "MP3 Conversion" Macro. You can:

  • Use the Add button to create a new Macro
  • Use left-click (or use the Up or Down arrow on the keyboard) to select the Macro you want to work on
  • Delete any user-added Macro with the Remove button
  • Rename any user-added Macro with the Rename button
The Remove and Rename buttons are grayed out when the MP3 Conversion Macro is selected.

The right-hand box (labeled Macro) lists the ordered sequence of commands for the Macro selected in the "Select Macros" box on the left. You can:

  • Add or remove commands for the selected Macro
  • Change the order in which the commands execute in the Macro
  • Edit the parameters for some effects in the Macro

For further details on creating, editing and sharing Macros, see the Manage Macros page.

Apply Macro

Use the Shrink button to show a reduced dialog with a simple list ofthe existing Macros. Select the Macro you require by using left-click (or using the Up or Down arrow on the keyboard) to select the Macro you want to work on, then either:

  • choose Apply to Current Project to run the Macro on the entire project in the current window or
  • choose Apply to Files... to run the Macro on selected external audio files in a single directory
Apply Chain 2-2-2.png
Advice 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.

For more details see the Apply Macro page.

Macro Examples

In this section we look at a couple of examples of how a Macro might be used. In the image below we have added two additional Macros.

Chain examples full window 2-2-2.png


Example 1: Loud MP3

A batch processing Macro to compress and normalize WAV files then convert them to MP3:

  1. Insert Compressor to reduce the dynamic range of each WAV, also normalizing them to maximum amplitude of 0 dB
  2. Insert Export as MP3 to convert them to MP3 format
  3. Click OK to close the "Manage Macros" window
  4. Finally, choose Tools > Macros > Apply Macro..., select the "Loud MP3" Macro then click Apply to Files... where you can select the files on which to run the Macro.


Example 2: NR&EQ

An effects automation Macro for the current project that applies noise reduction and equalization:

  1. Insert Normalize with settings of:
    1. Remove any DC offset
    2. -10 dB (to allow for boosting frequencies later in the Macro without clipping)
  2. Insert Noise Reduction
  3. Insert Equalization (to perform the frequency adjustment)
  4. Insert another Normalize at different settings (without offset removal, setting a final amplitude of -1 dB)
  5. Click OK to close the "Edit Chains" window
  6. Finally, choose Tools > Macros > Apply Chain..., select the "NR&EQ" Macro then click Apply to Current Project to apply the Macro to the selected track(s) in the current project window.
Tip
  • If a Noise Profile exists, that Noise Profile will be used. It is often best to capture a suitable Noise Profile before running a Macro.
  • If a Noise Profile does not exist:
    • If the Macro is applied to the current project (as above), the current selection is used to create the Noise Profile. Therefore, other effect commands in the Macro will also only apply to that selection. If an export command is added, the entire file will be exported.
    • If the Macro is applied to files, the first file (all of it) is used to create the Noise Profile. It may be useful to prepare a file containing a suitable Noise Profile and name it so that it is alphabetically the first file of those to be run in the Macro.


<  Back to: File Menu