In the previous chapter on TRIGGERS we discussed how you can set an event to occur when a certain chord change occurred. This chapter, AFTER, discusses a similar concept: setting an event to occur after a certain number of bars have been processed.
The AFTER command is used to set a MMA command at some point in the future. This can be handy when you have set a portion of your song up in a macro and wish to make changes to volume, tempo, etc. during the expansion of the macro.
For example, let's assume you have a short piece of music set up in the macro $LNS:
Mset Lns
Am C Dm E EndMset |
and we incorporate this into a MMA script in a number of places. However, at some point we want the TEMPO to slow for the final two bars. Using AFTER we can do:
After Count=2 Tempo *.9
$LNS |
And have the command TEMPO *.9 inserted between the second and third bars.
AFTER has a number of options, all of which are set in option=value pairs:
|
Anything left on the command line after processing the options is assumed to be a valid MMA command. Important: all options must be on the command line before the actual command to execute. So, this will work:
After Repeat=1 Print Testing |
but this will not:
After Print Testing Repeat=1 ¡¡Wrong!! |
since the “Repeat=1” is considered to be part of the command.
A number of short examples of are contained in the egs/after directory.
You can have any number of AFTER event lines. Each is checked in the order found before every line of your MMA file is processed.
Events using the COUNT and BAR options are automatically deleted once they have been used. Events created with the REPEAT option will continue to be active until they are removed with a REMOVE command.
Using the command line options -e and -r and copious PRINT statements (yes, you can use AFTER for this!) will help you determine the exact event locations.