Grooves, in some ways, are MMA's answer to macros...but we think they are 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! |
This is identical to the combination commands:
DefGroove Polka4 |
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 `` \''.
The Documentation String chapter has details on documentation strings
().
At this point the following information is saved:
You can restore a previously defined groove a anytime in your song with:
Groove Name |
At this point all of the previously saved information is restored.
A few cautions:
A ``DefGroove'' command saves the names and the actual data associated with each pattern in memory. A short example:
Drum Define Foo 1 1 100; 3 1 90 |
Drum Sequence Foo Bar Foo Bar |
DefGroove Mozart |
Drum Define Foo 1 1 120 |
At this point the drum track will use the new ``Foo''.
Groove Mozart |
Since the pattern information active when ``Mozart'' was defined has been restored, the drum track will use the old ''Foo'' pattern.
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.
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'' and a second file ``xyz-rhumba'' 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.