Subsections

- AllTracks
- Articulate
- Copy
- Comment
- Debug
- Delete
- Direction
- Mallet
  - Rate
  - Decay
- Octave
- Off
- On
- Print
- PrintActive
- ScaleType
- Seq
- Strum
- Synchronize
- Transpose
- Unify

#
Other Commands and Directives

In addition to the “Pattern”, “Sequence”, “Groove” and “Repeat” and other directives discussed earlier, and chord data, MMA supports a number of directives which affect the flavor of your music.

The subjects presented in this chapter are ordered alphabetically.

#
AllTracks

Sometimes you want to apply the same command to all the currently defined tracks; for example, you might want to ensure that no tracks have SEQRND set. Yes, you could go though each track (and hope you don't miss any) and explicitly issue the command:

Bass SeqRnd Off ... Chord SeqRnd Off

But,

AllTracks SeqRnd Off

is much simpler. Similarly, you can set the articulation for all tracks with:

AllTracks Articulate 80

You can even combine this with a BEGIN/END like:

Begin AllTracks Articulate 80 SeqRnd Off Rskip 0 End

This command is handy when you are changing an existing GROOVE.

There are two forms of the ALLTRACKS command. The first, as discussed above, applies to all tracks that are currently defined. Please note that SOLO, MELODY and ARIA tracks are not modified.

The second form of the command lets you specify one or more track types. For example, you may want to increase the volume of all the DRUM tracks:

AllTracks Drum Volume +20

Or to set the articulation on BASS and WALK tracks:

AllTracks Bass Walk Articulate 55

If you specify track types you can use any of BASS, CHORD, ARPEGGIO, SCALE, DRUM, WALK, MELODY, SOLO and ARIA tracks.

#
Articulate

When MMA processes a music file, all the note lengths specified in a pattern are converted to MIDI lengths.

For example in:

Bass Define BB 1 4 1 100; 2 4 5 90; 3 4 1 80; 4 4 5 90

bass notes on beats 1, 2, 3 and 4 are defined. All are quarter notes. MMA , being quite literal about things, will make each note exactly 192 MIDI ticks long--which means that the note on beat 2 will start at the same time as the note on beat 1 ends.

MMA has an ARTICULATE setting for each voice. This value is applied to shorten or lengthen the note length. By default, the setting is 90. Each generated note duration is taken to be a percentage of this setting, So, a quarter note with a MIDI tick duration of 192 will become 172 ticks long.

If ARTICULATE is applied to a short note, you are guaranteed that the note will never be less than 1 MIDI tick in length.

To set the value, use a line like:

Chord-1 Articulate 96

ARTICULATE values must be greater than 0 and less than or equal to 200. Values over 100 will lengthen the note. Settings greater than 120 will generate a warning.

You can specify a different ARTICULATE for each bar in a sequence. Repeated values can be represented with a “/”:

Chord Articulate 50 60 / 30

Notes: The full values for the notes are saved with the pattern definition. The articulation adjustment is applied at run time. The ARTICULATE setting is saved with a GROOVE.

Articulate settings can easily be modified by prefacing the values with a “+” or “-” which will increment or decrement the existing values. For example:

Chord Articulate 80 85 90 95 Chord Articulate +10 -10

results in the CHORD ARTICULATE setting of: “90 75 100 85”. Having fewer values that the current sequence size is fine. The inc/dec values get expanded to the sequence size and are applied to the existing settings.

#
Copy

Sometimes it is useful to duplicate the settings from one voice to another. The COPY command does just that:

Bass-1 Copy Bass

will copy the settings from the Bass track to the Bass-1 track.

The COPY command only works between tracks of the same type.

The following settings are copied:

- Articulate
- Compress
- Direction
- Harmony
- Invert
- Octave
- RSkip
- RTime
- RVolume
- ScaleType
- Strum
- Voice or Tone
- Volume

Warning: You are probably better off to use internal macros for this.

#
Comment

As previously discussed, a comment in MMA is anything following a “//” in a line. A second way of marking a comment is with the COMMENT directive. This is quite useful in combination the BEGIN and END directives. For example:

Begin Comment This is a description spanning several lines which will be ignored by MMA. End

You could achieve the same with:

// This is a description spanning // several lines which will be // ignored by MMA.

or even:

Comment This is a description spanning Comment several lines which will be Comment ignored by MMA.

One minor difference between // and COMMENT is that the first is discarded when the input stream is read; the more verbose version is discarded during line processing.

Quite often it is handy to delete large sections of a song with a BEGIN COMMENT/END on a temporary basis.

#
Debug

To enable you to find problems in your song files (and, perhaps, even find problems with MMA itself) various debugging messages can be displayed. These are normally set from the command line command line.

However, it is possible to enable various debugging messages dynamically in a song file using the DEBUG directive. In a debug statement you can enable or disable any of a variety of messages. A typical directive is:

Debug Debug=On Expand=Off Patterns=On

Each section of the debug directive consists of a mode and the command word ON or OFF. The two parts must be joined by a single “”. You may use the values “0” for “Off” and “1” for “On” if desired.

The available modes with the equivalent command line switches are:

> Mode | Command Line Equivalent
> Debug | -d | debugging messages
> Filenames | -o | display file names
> Patterns | -p | pattern creation
> Sequence | -s | sequence creation
> Runtime | -r | running progress
> Warnings | -w | warning messages
> Expand | -e | display expanded lines

The modes and command are case-insensitive (although the command line switches are not).

The current state of the debug flags is saved in the variable $_Debug and the state prior to a change is saved in $_LastDebug.

#
Delete

If you are using a track in only one part of your song, especially if it is at the start, it may be wise to free that track's resources when you are done with it. The DELETE command does just that:

Solo Delete

If a MIDI channel has been assigned to that track, it is marked as “available” and the track is deleted. Any data already saved in the MIDI track will be written when MMA is finished processing the song file.

#
Direction

In tracks using chords or scales you can change the direction in which they are applied:

Scale Direction UP

The effects differ in different track types. For SCALE and ARPEGGIO tracks:

> UP | Plays in upward direction only
> DOWN | Plays in downward direction only
> BOTH | Plays upward and downward (default)
> RANDOM | Plays notes from the chord or scale randomly

> When this command is encountered in a SCALE track the start point of the scale is reset.

A WALK track recognizes the following option settings:

> BOTH | The default. The bass pattern will go up and down a partial scale. Some notes may be repeated.
> UP | Notes will be chosen sequentially from an ascending, partial scale.
> DOWN | Notes will be chosen sequentially from a descending, partial scale.
> RANDOM | Notes will be chosen in a random direction from a partial scale.

> All four patterns are useful and create quite different effects.

The CHORD tracks DIRECTION only has an effect when the STRUM setting has a non-zero value. In this case the following applies:

> UP | The default. Notes are sounded from the lowest tone to the highest.
> DOWN | Notes are sounded from the highest to the lowest.
> BOTH | The UP and DOWN values are alternated for each successive chord.
> RANDOM | A random direction is selected for each chord.

You can specify a different DIRECTION for each bar in a sequence. Repeated values can be represented with a “/”:

Arpeggio Direction Up Down / Both

The setting is ignored by BASS, DRUM and SOLO tracks.

# Mallet

Some instruments (Steel-drums, banjos, marimbas, etc.) are normally played with rapidly repeating notes. Instead of painfully inserting long lists of these notes, you can use the MALLET directive. The MALLET directive accepts a number of options, each an OPTION=VALUE pair. For example:

Solo-Marimba Mallet Rate=16 Decay=-5

This command is also useful in creating drum rolls. For example:

Begin Drum-Snare2 Tone SnareDrum1 Volume F Mallet Rate=32 Decay=-3 Rvolume 3 Sequence z z z 1 1 100 End

The following options are supported:

## Rate

The RATE must be a valid note length (i.e., 8, 16, or even 16.+8).

For example:

Solo-Marimba Mallet Rate=16

will set all the notes in the “Solo-Marimba” track to be sounded a series of 16th notes.

- Note duration modifiers such as articulate are applied to each resultant note,

- It is guaranteed that the note will sound at least once,

- The use of note lengths assures a consistent sound independent of the song tempo.

To disable this setting use a value of “0”.

## Decay

You can adjust the volume (velocity) of the notes being repeated when MALLET is enabled:

Drum-Snare Mallet Decay=-15

The argument is a percentage of the current value to add to the note each time it is struck. In this example, assuming that the note length calls for 4 “strikes” and the initial velocity is 100, the note will be struck with a velocity of 100, 85, 73 and 63.

Important: a positive value will cause the notes to get louder, negative values cause the notes to get softer.

Note velocities will never go below 1 or above 255. Note, however, that notes with a velocity of 1 will most likely be inaudible.

The decay option value must be in the range -50 to 50; however, be cautious using any values outside the range -5 to 5 since the volume (velocity) of the notes will change quite quickly. The default value is 0 (no decay).

#
Octave

When MMA initializes and after the SEQCLEAR command all track octaves are set to “4”. This will place most chord and bass notes in the region of middle C.

You can change the octave for any voice with OCTAVE command. For example:

Bass-1 Octave 3

Sets the notes used in the “Bass-1” track one octave lower than normal.

The octave specification can be any value from 0 to 10. Various combinations of INVERT, TRANSPOSE and OCTAVE can force notes to be out of the valid MIDI range. In this case the lowest or highest available note will be used.

You can specify a different OCTAVE for each bar in a sequence. Repeated values can be represented with a “/”:

Chord Octave 4 5 / 4

Octave settings can easily be modified by prefacing the values with a “+” or “-” which will increment or decrement the existing values. For example:

Bass Octave 2 3 4 5 Bass Octave +1 +2 -1 -3

results in the BASS OCTAVE setting of: “3 5 3 2”. Having fewer values that the current sequence size is fine. The inc/dec values get expanded to the sequence size and are applied to the existing settings.

#
Off

To disable the generation of MIDI output on a specific track:

Bass Off

This can be used anywhere in a file. Use it to override the effect of a predefined groove, if you wish. This is simpler than resetting a voice in a groove. The only way to reset this command is with a ON directive.

#
On

To enable the generation of MIDI output on a specific track which has been disabled with an OFF directive:

Bass On

Attempts to enable tracks disabled with the -T command line option generate a warning (the command is ignored).

# Print

The PRINT directive will display its argument to the screen when it is encountered. For example, if you want to print the file name of the input file while processing, you could insert:

Print Making beautiful music for MY SONG

No control characters are supported.

This can be useful in debugging input files.

# PrintActive

The PRINTACTIVE directive will the currently active GROOVE and the active tracks. This can be quite useful when writing groove files and you want to modify and existing groove.

Any parameters given are printed as single comment at the end of the header line.

This is strictly a debugging tool. No PRINTACTIVE statements should appear in finalized grooves or song files.

#
ScaleType

This option is only used by SCALE tracks. It can be set for other tracks, but the setting is not used.

By default, the SCALETYPE is set to AUTO. The settings permissible are:

> CHROMATIC | Forces use of a chromatic scale
> AUTO | Uses scale based on the current chord (default)

When this command is encountered in a SCALE track the start point of the scale is reset.

#
Seq

If your sequence, or groove, has more than one pattern (i.e., you have set SeqSize to a value other than 1), you can use this directive to force a particular pattern point to be used. The directive:

Seq

resets the sequence counter to 1. This means that the next bar will use the first pattern in the current sequence. You can force a specific pattern point by using an optional value after the directive. For example:

Seq 8

forces the use of pattern point 8 for the next bar. This can be quite useful if you have a multi-bar sequence and, perhaps, the eight bar is variation which you want used every eight bars, but also for a transition bar, or the final bar. Just put a SEQ 8 at those points. You might also want to put a SEQ at the start of sections to force the restart of the count.

If you have enable sequence randomization with the SEQRND ON command, the randomization will be disabled by a SEQ command.24.1 However, settings of track SEQRND will not be effected. One difference between SEQRND OFF and SEQ is that the current sequence point is set with the latter; with SEQRND OFF it is left at a random point.

Note: Using a value greater than the current SEQSIZE is not permitted.

This is a very useful command! For example, look at the four bar introduction of the song “Exactly Like You”:

Groove BossanovaEnd seq 3 1 C seq 2 2 Am7 seq 1 3 Dm7 seq 3 4 G7 / G7#5

In this example the four bar “ending groove” has been used to create an interesting introduction.

#
Strum

When MMA generates a chord,24.2 all the notes are played at the same time.24.3

To make the notes in a chord sound like something a guitar or banjo might play, use the STRUM directive. For example:

Chord-1 Strum 5

sets the strumming factor to 5 for track Chord-1. The strum factor is specified in MIDI ticks. Usually values around 10 to 15 work just fine. The valid range for STRUM is -300 to 300 (just under the duration of a quarter note).

In the previous example the first note in the chord will be played on the beat indicated by the pattern definition, the second note will be played 5 ticks later, etc.

You can specify a different STRUM for each bar in a sequence. Repeated values can be represented with a “/”. Assuming that there are four bars in the current sequence:

Chord Strum 20 5 / 10

To make the effect of STRUM more random (and human) you can set a range for the delay. For example:

Chord Strum 20,25

will cause MMA to select a value between 20 and 25 ticks for each successive note. You can have a different range for each bar in your sequence. In most cases a small range is adequate. Large values can create “odd” effects. Note that the syntax calls for exactly two values and a comma, no spaces are permitted.

STRUM can be used in all tracks except for DRUM. Since tracks other than CHORD only generate single notes, the command will only effect notes added via a HARMONY or HARMONYONLY directive. Judicious use of STRUM can add depth and a “cascading” effect.

Notes:

- When notes in a CHORD track have both a STRUM and INVERT applied, the order of the notes played will not necessarily be root, third, etc. The notes are sorted into ascending order, so for a C major scale with and INVERT of 1 the notes played would be “E G C”.

- The strumming direction of notes in a CHORD track can be changed with the DIRECTION command.

- The DIRECTION directive only effects STRUM timing in CHORD tracks.

- In tracks other than CHORD the strum delays apply to notes after the initial note. In the case of HARMONYONLY tracks the delay will apply to the first generated note.

#
Synchronize

The MIDI tracks generated by MMA are perfectly “legit” and should be playable in any MIDI file player. However, there are a few programs and/or situations in which you might need to use the SYNCHRONIZE options.

First, when a program is expecting all tracks to start at the same location, or is intolerant of “emptiness” at the start of a track, you can add a “tick note” at the start of each track.24.4

Synchronize START

will insert a one tick note on/off event at MIDI offset 1. You can also generate this with the “-0” command line option.

Second, some programs think (wrongly) that all tracks should end at the same point.24.5 Adding the command:

Synchronize END

will delete all MIDI data past the end of the last bar in your input file and insert MIDI “all notes off” events at that point. You can also generate this effect with the “-1” command line option.

The commands can be combined in any order:

Synchronize End Start

is perfectly valid.

# Transpose

You can change the key of a piece with the “Transpose” command. For example, if you have a piece notated in the key of “C” and you want it played back in the key of “D”:

Transpose 2

will raise the playback by 2 semi-tones. Since MMA 's author plays tenor saxophone

Transpose -2

which puts the MIDI keyboard into the same key as the horn, is not an uncommon directive

You can use any value between -12 and 12. All tracks (with the logical exception of the drum tracks) are effected by this command.

# Unify

The UNIFY command is used to force multiple notes of the same voice and pitch to be combined into a single, long, tone. This is very useful when creating a sustained voice track. For example, consider the following which might be used in real groove file:

Begin Bass-Sus Sequence 1 1 1 90 4 Articulate 100 Unify On Voice TremoloStrings End

Without the UNIFY ON command the strings would be sounded (or hit) four times during each bar; with it enabled the four hits are combined into one long tone. This tone can span several bars if the note(s) remain the same.

The use of this command depends on a number of items:

- The VOICE being used. It makes sense to use enable the setting if using a sustained tone like “Strings"; it probably doesn't make sense if using a tone like “Piano1”.

- For tones to be combined you will need to have ARTICULATE set to a value of 100. Otherwise the on/off events will have small gaps in them which will cancel the effects of UNIFY.

- Ensure that RTIME is not set for UNIFY tracks since the start times may cause gaps.

- If your pattern or sequence has different volumes in different beats (or bars) the effect of a UNIFY will be to ignore volumes other than the first. Only the first NOTE ON and the last NOTE OFF events will appear in the MIDI file.

You can specify a different UNIFY for each bar in a sequence. Repeated values can be represented with a “/”:

Chord Unify On / / Off

But, you probably don't want to use this particular feature.

Valid arguments are “On” or “1” to enable; “Off” or “0” to disable.

#### Footnotes

... command.24.1
  A warning message will also be displayed.
... chord,24.2
  In this case we define “chord” as two or more notes played at the same time.
... time.24.3
  An exception to this are notes generated if RTIME 13.3 is set.
... track.24.4
  Timidity truncates the start of tracks up to the first MIDI event when splitting out single tracks.
... point.24.5
  Seq24 does strange looping if all tracks don't end identically.