Grooves, in some ways, are MMA 's answer to macros...but they are cooler, easier to use, and have a more musical name.
Really, though, a groove is just a simple mechanism for saving and restoring a set of patterns and sequences. Using grooves it is easy to create sequence libraries which can be incorporated into your songs with a single command.
A groove can be created at anytime in an input file with the command:
DefGroove SlowRhumba |
Optionally, you can include a documentation string to the end of this command:
DefGroove SlowRumba A descriptive comment! |
A groove name can include any character, including digits and punctuation. However, it cannot include a space character (used as a delimiter) or a '/'6.1, nor can consist solely of digits6.2
In normal operation the documentation strings are ignored. However, when MMA is run with the -Dx command line option these strings are printed to the terminal screen in LATEX format. The standard library document is generated from this data. The comments must be suitable for LATEX: this means that special symbols like ``#'', ``&'', etc. must be ``quoted'' with a preceding `` \''.
At this point the following information is saved:
You can restore a previously defined groove at anytime in your song with:
Groove Name |
At this point all of the previously saved information is restored.
A few cautions:
To make life (infinitely) more interesting, you can specify more than one previously defined groove. In this case the next groove is selected after each bar. For example:
Groove Tango LightTango LightTangoSus LightTango |
would create the following bars:
Note how the groove pattern wraps around to the first one when the list is exhausted. There is no way to select an item from the list, except by going though it.
You might find this handy if you have a piece with an alternating time signature. For example, you might have a 3/4 4/4 song. Rather than creating a 2 bar groove, you could do something like:
Groove Groove34 Groove44 |
For long lists you can use the ``/'' to repeat the last groove in the list. The example above could be written:
Groove Tango LightTango LightTangoSus / |
When you use the ``list'' feature of GROOVEs you should be aware of what happens with the bar sequence number. Normally the sequence number is incremented after each bar is processed; and, when a new groove is selected the sequence number is reset (see SEQ, discussed here). When you use a list which changes the GROOVE after each bar the sequence number is reset after each bar ...with one exeption: if the same GROOVE is being used for two or more bars the sequence will not be reset.6.3
Another way to select GROOVEs is to use a list of grooves with a leading value. This lets you select the GROOVE to use based on the value of a variable ...handy if you want different sounds for repeated sections. Again, an example:
Set loop 1 // create counter with value of 1
Repeat Groove $loop BossaNovaSus BossaNova1Sus BossaNovaFill print This is loop $Loop ... Groove is $_Groove 1 A / Am Inc Loop // Bump the counter value RepeatEnd 4 |
If you use this option, make sure the value of the counter is greater than 0. Also, note that the values larger than the list count are ``looped'' to be valid. The use of ``/''s for repeated names is also permitted. For an example have a look at the file grooves.mma, included in this distribution. You could get the same results with various ``if'' statements, but this is easier.
To make the creation of variations easier, you can use GROOVE in a track setting:
Scale Groove Funny |
In this case only the information saved in the corresponding DEFGROOVE FUNNY for the SCALE track will be restored. You might think of this as a ``groove overlay''. Have a look at the sample song ``Yellow Bird'' for an example.
When restoring track grooves, as in the above example, the SEQSIZE is not reset. The sequence size of the restored track is adjusted to fit the current sequence size setting.
One caution with these ``overlays'' is that no check is done to see if the track you're using exists. Yes, the GROOVE must have been defined, but not the track. Huh? Well, you need to know a bit about how MMA parses files and how it handles new tracks. When MMA reads a line in a file it first checks to see if the first word on the line is a simple command like PRINT, MIDI or any other command which doesn't require a leading trackname. If it is, the appropriate function is called and file parsing continues. If it is not a simple command MMA tests to see if it is a track specific command. But to do that, it first has to test the first word to see if it is a valid track name like Bass or Chord-Major. And, if it is a valid track name and that track doesn't exist, the track is created...this is done before the rest of the command is processed. So, if you have a command like:
Bass-Foo Groove Something |
and you really meant to type:
Bass-Foe Groove Something |
you'll have a number of things happening:
So, be very careful using this command option. Check your spelling. And use the PRINTACTIVE command to verify your GROOVE creations. A basic test is done by MMA when you use a GROOVE in this manner and if the sequence for the named track is not defined you will get a warning.
There are times when you might want MMA to forget about all the GROOVEs in its memory. Just do a:
GrooveClear |
at any point in your input file and that is exactly what happens. But, ``why,'' you may ask, ``would one want to do this?'' One case would be to force the re-reading of a library file. For example, a library file might have a user setting like:
If Ndef ChordVoice
Set ChordVoice Piano1 Endif |
In this case you could set the variable ``ChordVoice'' before loading any of the GROOVEs in the file. All works! Now, assume that you have a repeated section and want to change the voice. Simply changing the variable does not work. The library file isn't re-read since the exisiting GROOVE data is already in memory. Using GROOVECLEAR erases the existing data and forces a re-reading of the library file.
Please note that low-level setting like MIDI track assignments are not changed by this command.
If you are using a groove from a library file, you just need to do something like:
Groove Rhumba2 |
at the appropriate position in your input file.
One minor problem which may arise is that more than one library file has defined the same groove name. This might happen if you have a third-party library file. For the proposes of this example, lets assume that the standard library file ``rhumba.mma'' and a second file ``xyz-rhumba.mma'' both define the groove ``Rhumba2''. The auto-load routines which search the library database will load the first ``Rhumba2'' it finds, and the search order cannot be determined. To overcome this possible problem, do a explicit loading of the correct file. In this case, simply do:
Use xyz-rhumba |
near the top of your file. And if you wish to switch to the groove defined in the standard file, you can always do:
Use rhumba |
just before the groove call. The USE will read the specified file and overwrite the old definition of ``Rhumba2'' with its own.
This issue in covered in more detail on page
of this manual.