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 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:
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
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:
A special case option is the use of EOF as a pseudo line number. In this case the command is appended to the end of the current file. You can not delete an event set with BAR=EOF. You might think of this as a dynamic MMAEND (here). For a ``real life'' example of this option, see the qriff plugin supplied with this version of MMA .
Any other commands will be ignored. A warning will be printed.
|After Repeat=4 Print another four bars|
will display a silly message after every four bars are processed.
Anything left on the command line after processing the options is assumed to be a valid MMA command.27.1
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.