Grooves
Keywords: mma

Subsections

- Creating A Groove
- Using A Groove
  - Extended Groove Notation
  - Groove Search Summary
  - Overlay Grooves
- Groove Aliases
- AllGrooves
- Deleting Grooves
- Sticky
- Library Issues

#
Grooves

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.

# Creating A Groove

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), a colon “:” or a '/'.6.1

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:

- Current Sequence size,
- The current sequence for each track,
- Time setting (quarter notes per bar),
- “Accent”,
- “Articulation” settings for each track,
- “Compress”,
- “Direction”,
- “DupRoot”,
- “Harmony”,
- “HarmonyOnly”,
- “HarmonyVolume”,
- “Invert”,
- “Limit”,
- “Mallet” (rate and decay),
- “MidiSeq”,
- “MidiVoice”,
- “MidiClear”
- “NoteSpan”,
- “Octave”,
- “Range”,
- “RSkip”,
- “Rtime”,
- “RDuration”,
- “Rvolume”,
- “Scale”,
- “SeqRnd”, globally and for each track,
- “SeqRndWeight”, globally and for each track,
- “Strum”,
- “SwingMode” Status and Skew,
- “Time Signature”,
- “Tone” for drum tracks,
- “Unify”,
- “Voice”,
- “VoicingCenter”,
- “VoicingMode”,
- “VoicingMove”,
- “VoicingRange”,
- “Volume” for tracks and master,
- “VolumeRatio”.

# Using A Groove

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.

If the specified groove is not in memory MMA will search the library files on disk for a file containing it. The search is done in the files in the LIBPATH directory here. Please note, the search ends with the first matching groove name found. The search begins with stdlib and continues though the other directories in your library (in alphabetical order). If you have two grooves with the same name in different directories or files, please read the section below on extended groove notation.

A few cautions:

- Pattern definitions are not saved in grooves. Redefining a pattern results in a new pattern definition. Sequences use the pattern definition in effect when the sequence is declared. In short, if you do something like:

  Chord Define MyPat 1 2.2 90

  and use the pattern “MyPat” in a chord sequence and save that pattern into a groove you should be careful not to redefine “MyPat”.

  On the other hand, if you dynamically define patterns for your sequences:

  Chord Sequence {1 2.2 90}

  you'll be safe since you can't change these kind of settings (other than by issuing a new SEQUENCE command.

- The “SeqSize” setting is restored with a groove. The sequence point is also reset to bar 1. If you have multi-bar sequences, restoring a groove may upset your idea of the sequence pattern.

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:

1. Tango
2. LightTango
3. LightTangoSus
4. LightTango
5. Tango
6. ...

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. For example, this:

Groove G1 G1 G1 G3 G3 G4 G4

could be written as:

Groove G1 / / G3 / G4

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 exception: if the same GROOVE is being used for two or more bars the sequence will not be reset.6.2

Another way to select GROOVEs is to use a list of grooves with a leading value. In its simplest form the leading value will just select a groove from this list:

Groove 3 Grv1 Grv2 Grv3 Grv4

will select GRV3 which gives the identical result as:

Groove Grv3

But, if you use a VARIABLE, you can select the GROOVE to use based on the value of that 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.

##
Extended Groove Notation

In addition to only loading a new groove by using the name of a GROOVE you can also set the specific file that the GROOVE exists in by using a filename prefix:

Groove stdlib/rhumba:rhumbaend

would load the “RhumbaEnd” groove from the file rhumba.mma file located in the stdlib directory. In most cases the use of an extended groove name is only required once (if at all) since the command forces the file containing the named groove to be completely read and all grooves defined in that file will now be in memory and available with simple GROOVE commands.

Extended groove names, in just about all cases, eliminate the need for the USE command. For a complete understanding you should also read the PATHS section, here, of this manual.

Important: The filename to the left of the “:” is a system pathname, not a MMA variable. As such it must match the case for the filename/path on your system. If, for example, you have a file casio/poprock1.mma and attempt to access it with GROOVE Casio/Poprock1:PopRock1End it will not work. You must use the form GROOVE casio/poprock1:PopRock1End. The case of the data to the right of the “:” is not important. Do not use quotation marks when specifying a filename.

When using an extended name, you (probably) only need to use the full name once ... the entire file is read into memory making all of its content available. For a, contrived, example:

1. Assume you have two files, both called swing.mma. One file is in stdlib; the other in mylib. Both directories can be found in PATHLIB.

2. stdlib/swing.mma defines grooves “g1”, “g2”, “g3” and “gspecial”.

3. mylib/swing.mma defines grooves “g1”, “g2” and “g3”. It does not define “gspecial”.

4. Near the top of your song file you issue:

   Groove mylib/swing:g1

   The file mylib/swing.mma is read and the groove “g1” is enabled.

5. Later in the file you issue the command:

   Groove g2

   Since this groove is already in memory, it is enabled.

6. Next:

   groove Gspecial

   Since this groove is not in memory (it wasn't in the file mylib/swing.mma) MMA now searches its database files and finds the requested groove in stdlib/swing.mma. The file is read and “Gspecial” is enabled.

7. Now you want to use groove “g1” again:

   Groove g1

   Since the file stdlib/swing.mma has been read the “g1” groove from mylib/swing.mma has been replaced. You, probably, have the wrong groove in memory.

To help find problems you may encounter managing multiple libraries, you can enable the special warning flag (see here):

Debug Groove=On

which will issue a warning each time a GROOVE name is redefined. You must enable this option from within a file; it is not available on the command line.

A further, and most useful, method of dealing with multiple libraries is to specify the groove name relative to the library name. In this case we will assume you have a library directory “casio” and wish to load the groove “80sPopIntro”. That particular groove is in the file casio/80spop and you could load it using:

Groove casio/80spop:80sPopIntro

however, you'll find it easier to use the shorter notation:

Groove casio:80sPopIntro

In this case the name on the left side of the “:” is taken to be the name of the library and the various files in that, and only that, library are searched. The only caution is that if you have more than one file containing a groove named “80sPopIntro” in the casio library, the first one found will be loaded ... and you will not be informed of other matches.

Again, note that the name to the left of the “:” is a system directory name and must be in the appropriate case for your filesystem. Casio and casio are not the same.

## Groove Search Summary

Whenever a GROOVE command is issued a search for the named groove is done. To help the unweary, here's a brief summary of the logic (or, perhaps, lack thereof) of the method used:

1. When a simple groove name, i.e., “swing”, is used MMA first looks in memory for that groove name. If found, it is activated. If not found, MMA will look for a library file containing that groove. The library files are examined in alphabetical order, except for stdlib which is always searched first.

2. If an extended name with a filename is used, i.e., “casio/80spop:80sPopIntro”, is used the library file 80spop will be loaded and the groove will be enabled.

3. If the extended name is a directory name, i.e., “casio:80sPopIntro”, the files in the library directory casio will be checked for the groove. The first file found containing the groove will be loaded.

For the last two cases, above:

- The groove will always be replaced (reloaded) by one from the file each time it is requested. All other duplicated groove names in memory will be re-read as well.

- You can simply use the non-extended version in subsequent calls.This avoids reloading the file.

##
Overlay Grooves

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:

1. The track Bass-Foo will be created. This is not an issue to be concerned over since no data will be created for this new track unless you set a SEQUENCE for it.

2. As part of the creation, all the existing GROOVEs will have the Bass-Foo track (with its default/empty settings) added to them.

3. And the current setting you think you're modifying with the Bass-Foe settings will be created with the Bass-Foo settings (which are nothing).

4. Eventually you'll wonder why MMA isn't working.

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.

In most cases you will find the COPY command detailed here to be more robust.

# Groove Aliases

In an attempt to make the entire groove naming issue simpler, an additional command has been added. More complication to make life simpler.

You can create an alias for any defined GROOVE name with:

DefAlias NewAlias SomeGroove

Now you can refer to the groove “SomeGroove” with the name “NewAlias”.

A few rules:

- the alias name must not be the name of a currently defined groove,
- when defining a new groove you cannot use the name of an alias.

Groove aliases are a tool designed to make it possible to have a standard set of groove names in MMA usable at the same time as the standard library.

There is a major difference between a groove alias and the simple act of assigning two names to the same groove. Consider this snippet:

...define some things ... Defgroove Good Defgroove Good2

You now have both “good” and “good2” assigned to the same set of sequences, etc. Now, let's change something:

Groove Good Chord Voice Accordion ...

Now, the groove “good” has an accordion voicing; “good2” still has whatever the old “good” had. Compare this with:

...define some things ... DefGroove Good DefAlias Good2 Good

Now, make the same change:

Groove Good Chord Voice Accordion

By using an alias “good2” now points to the changed “good”.

# AllGrooves

There are times when you wish to change a setting in a set of library files. For example, you like the Rhumba library sounds, but, for a particular song you'd like a punchier bass sound. Now, it is fairly easy to create a new library file for this; or you can set the new bass settings each time you select a different GROOVE.

Much easier is to apply your changes to all the GROOVEs in the file. For example:

Use Rhumba Begin AllGrooves Bass Articulate 50 Bass Volume +20 Walk Articulate 50 Walk Volume +10 End ...

The ALLGROOVES command operates by applying its arguments to each GROOVE currently defined. This includes the environment you are currently in, even if this is not a defined GROOVE.

Everything after ALLGROOVES is interpreted as a legitimate MMA command. The syntax definition for ALLGROOVES is “Allgrooves MMA-Command”, so

AllGrooves Chord Octave 5

sets the OCTAVE to 5 for track Chord (and only Chord, not Chord-Foo etc) in all grooves.

Note: this is different from the ALLTRACKS, here, command which lets you specify tracks for track types. Or course, there is nothing to stop you from combining these with something like:

ALLGROOVES ALLTRACKS CHORD OCTAVE 5

the results of which are left as an exercise for the reader.

A warning message will be displayed if the command had no effect. The warning “No tracks affected with ...” will be displayed if nothing was done. This could be due to a misspelled command or track name, or the fact that the specified track does not exist.

If you want to “undo” the effect of the ALLGROOVES just import the library file again with:

Use stdlib/rhumba Groove Rhumba

or remove all the current GROOVEs from memory with:

GrooveClear Groove Rhumba

In both cases you'll end up with the original GROOVE settings.

A few notes:

- This command only effects GROOVEs which have been loaded into memory either by loading a library file or otherwise creating a GROOVE.

- The in memory grooves can all have different sequence sizes. Special code inhibits the printing of warning messages when you use a too long list of commands. For example, “AllGrooves Chord Octave 3 4 5 6” will not generate a warning with a groove with a sequence size of 2, it will just be truncated.

- Be careful what commands you use since they are applied rather blindly. For example, the command:

  AllTracks BeatAdjust 2

  will insert 2 additional beats for each GROOVE you have. So, if you have 10 GROOVEs you would insert 20 beats. Not what you intended. TEMPO and other commands will cause similar problems. Actually, BEATADJUST is not permitted in ALLGROOVES, but it's a cool example.

- You can disable all warning messages with might be displayed when applying this command by using the command modifier NOWARN as the first argument. For example:

  AllGrooves Bass Sequence B11

  will display a warning message (it's not recommended to change all sequence definitions like this), but:

  AllGrooves NoWarn Bass Sequence B11

  will complile cleanly. We recommend you get your file working properly before adding this modifier.

# Deleting Grooves

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 existing 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 settings like MIDI track assignments are not changed by this command.

Groove aliases are also deleted with this command.

#
Sticky

In most cases the method used to save and restore grooves works just fine. However, you may want a certain track be invisible to the groove mechanism. You may find this option convenient if you creating a “click track” or if you are using triggers (see here) across different grooves.

Setting a track as STICKY

Drum-Testing Sticky True

solves the problem.

The command takes a single value of “True” or “False”. “On”, “1”, “Off” and “0” may also be used. The only way a sticky track can become un-sticky is with a command like:

Drum-Testing Sticky False

You can set the sticky bit from a TRIGGER command as well. The results are the same.

Note: Sticky tracks are not deleted with the SEQCLEAR command.

# Library Issues

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, let's 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 here in this manual. Most problems of this kind are easily avoided by using the extended groove notation, detailed above.

#### Footnotes

... '/'.6.1
  The '/' and ':' are used in extended names.
... reset.6.2
  Actually, MMA checks to see the next GROOVE in the list is the same as the current one, and if it is then no change is done.