next up previous
Next: Sequences Up: Reference Manaul Previous: Tracks and Channels

Subsections


Patterns

MMA builds its output based on patterns and sequences supplied by you. These can be defined in the same file as the rest of the song data, or can be included (see chapter 19) from a library file.

A pattern is a definition for a voice or track which describes what rhythm to play during the current bar. The actual notes selected for the rhythm are determined by the song bar data (Chapter 8).

Defining a Pattern

The formats for the different tracks vary, but are similar enough to confuse the unwary.

Each pattern definition consists of three parts:

In the following sections we show the definitions in continuation lines; however, it is quite legal to mash all the information onto a single line.

The following concepts are used when defining a pattern:

Start
When to start the note. This is expressed as a beat offset. For example, to start a note at the start of a bar you use ``1'', the second beat would be ``2'', the fourth ``4'', etc. You can easily use off-beats as well: The ``and'' of 2 is ``2.5'', the ``and ahh'' of the first beat is ``1.75'', etc. Using a beat offset greater than the number of beats in a bar or less than ``1'' is not permitted. See Time ([*]).

Duration
The length of a note is somewhat standard musical notation. Since it is impractical to draw in graphical notes or even to use fractions like 1/4 MMA uses a shorthand notation detailed in the following table:

Notation Description
1 Whole note
2 Half
4 Quarter
8 Eighth
16 Sixteenth
32 Thirtysecond
64 Sixtyfourth
3 One note of an eight note triplet
0 A single MIDI tick

The last note length, ``0'' is a special value often used in drum tracks where the actual ``ringing''length appears to be controlled by the MIDI synth, not the driving program. Internally, a ``0'' note length in converted to a single MIDI tick.

Lengths can have a single or double dot appended. For example, ``2.'' is a dotted half note and ``4..'' adds an eight and sixteenth value to a quarter note.

Note lengths can be combined using ``+''. For example, to make a dotted eight note use the notation ``8+16'', a dotted half ``2+4'', and a quarter triplet ``3+3''.

It is permissible to combine notes with ``dots'' and ``+''s. The notation ``2.+4'' would be the same as a whole note.

The actual length of the note will be adjusted by the Articulate value ([*]).

Volume
The MIDI velocity4.1 to use for the specified note. For a detailed explanation of how MMA calculates the volume of a note, see chapter 12.

MIDI velocities are limited to the range 0 to 127. However, MMA does not check the volumes specified in a pattern for validity. This is a feature. If you want to ensure that a note is always sounded use a very large value (eg. 1000) for the volume. That way, future adjustments will maintain a large value and this large value will be clipped to the maximum permitted MIDI velocity.

In most cases velocities in the range 50 to 100 are useful.

Offset
The offset into the current chord. If you have, for example, a C minor chord (C, E$\flat$, and G) has 3 offsets: 0, 1 and 2. Note that the offsets refer to the chord not the scale. For example, a musician refer to the the ``fifth''--this means the fifth note of a scale ...in a major chord this is the third note, which has an offset of 2 in MMA.

Patterns can be defined for Bass, Walking, Chord, Arpeggio, Chord and Drum tracks. All patterns are shared by the numbered tracks--Chord1 and Chord2 share the patterns for Chord. As a convenience, MMA will permit you to define a pattern for a numbered track, but remember that it will be shared by all similar tracks. For example:

Drum Define S1 1 0 50

and

Drum5 Define S1 1 0 50

Will generate identical outcomes.

Bass

A bass pattern is defined with:

Position Duration Offset Volume ; ...

Each group consists of an beat offset for the start point, the note duration, the note offset and volume.

The note offset is the offset into the current chord. So, given a major chord, 0 would play the root, 1 the 3rd (the 2nd note in the chord), and 2 the 5th (the 3rd note in the chord).

Example 4.1: Bass Definition


Bass Define Broken8 1 8 0 90 ; \
    2 8 2 80 ; \
    3 8 0 90 ; \
    4 8 2 80



Sheet Music Equivalent



\includegraphics[width=.9\textwidth]{mupex/bassb8.ps}

Example 4.1 defines 4 bass notes (probably staccato eight notes) at beats 1, 2, 3 and 4 in a 4/4 time bar. The first note is the root of the chord, the second is the third (note offset 2); the third note is the root; the last note is the third. The volumes of the notes are set to a MIDI velocity of 90 for beats 1 and 3 and 80 for beats 2 and 4.

Chord

A Chord pattern is defined with:

Position Duration Volume1 Volume2 .. ; ...

Each group consists of an beat offset for the start point, the note duration, and the volumes for each note in the chord. If you have fewer volumes than notes in a chord, the last volume will apply to the remaining notes.

Example 4.2: Chord Definition


Chord Define Straight4+3 1 4 100 ; \
    2 4 90 ; \
    3 4 100 ; \
    4 3 90 ; \
    4.3 3 80 ; \
    4.6 3 80



Sheet Music Equivalent



\includegraphics[width=.9\textwidth]{mupex/chord43.ps}

Example 4.2 defines a 4/4 pattern in a quarter, quarter, quarter, triplet rhythm. The quarter notes sound on beats 1, 2 and 3; the triplet is played on beat 4. The example assumes that you have C major for beats 1 and 2, and G major for 3 and 4.

Using a volume of ``0'' will disable a note. So, you you want only the root and third of a chord to sound, you could use something like:

Chord Define Dups 1 8 90 0 90 0; 3 8 90 0 90 0

Arpeggio

An Arpeggio pattern is defined with:

Position Duration Volume ; ...

The arpeggio tracks play notes from a chord one at a time. This is quite different from chords where the notes are played all at once--refer to the Strum directive ([*]).

Each group consists of an beat offset, the note duration, and the note volume. You have no choice as to which notes of a chord are played (however, they are played in alternating ascending/descending order.4.2Volumes are selected for the specific beat, not for the actual note.

Example 4.3: Arpeggio Definition


Arpeggio Define 4s 1 4 100; \
    2 4 90; \
    3 4 100; \
    4 4 100



Sheet Music Equivalent



\includegraphics[width=.9\textwidth]{mupex/arp4s.ps}

Example 4.3 plays quarter note on beats 1, 2, 3 and 4 of a bar in 4/4 time.

Walk

A Walking Bass pattern is defined with:

Position Duration Volume ; ...

Walking bass tracks play up and down the the first part of a scale, paying attention to the ``color''4.3of the chord. Walking bass lines are very common in jazz and swing music. The appear quite often as an ``emphasis'' bar in marches.

Each group consists of an beat offset, the note duration, and the note volume. MMA selects the actual note pitches to play based on the current chord (you cannot change this).

Example 4.4: Walking Bass Definition


Walk Define Walk4 1 4 100 ; \
    2 4 90; \
    3 4 90


Example 4.4 plays a bass note on beats 1, 2 and 3 of a bar in 3/4 time.

Scale

A scale pattern is defined with:

Position Duration Volume ; ...

Each group consists of an beat offset for the start point, the note duration, and volume.

Example 4.5: Scale Definition


Scale Define S1 1 1 90
Scale Define S4 S1 * 4
Scale Define S8 S1 * 8


Example 4.5 defines three scale patterns: ``S1'' is just a single whole note, not that useful on its own, but it used as a base for ``S4'' and ``S8''.

``S4'' is 4 quarter notes and ``S8'' is 8 eight notes. All the volumes are set to a MIDI velocity of 90.

Scale patterns are quite useful in endings. More options for scales detailed in the ScaleDirection ([*]) and ScaleType ([*]) sections.

Drum

Drum tracks are a bit different from the other tracks discussed so far. Instead of having each track saved as a separate MIDI track, all the drum tracks are combined onto MIDI track 10.

A Drum pattern is defined with:

Position Duration Volume; ...

Example 4.6: Drum Definition


Drum Define S2 1 0 100; \
    2 0 80 ; \
    3 0 100 ; \
    4 0 80


Example 4.6 plays a drum sound on beats 1, 2, 3 and 4 of a bar in 4/4 time. The MIDI velocity (volume) of the drum is 100 on beats 1 and 3; 80 on beats 2 and 4.

In this example we have used the special duration of ``0'' which indicates 1 MIDI tick.


Drum Tone

Essential to drum definitions is the Tone directive.

When a drum pattern is defined, there is no drum tone or note specified in the pattern.. By default, all drum patterns use a snare drum sound. But, this can (and should) be changed using the Tone directive. This is normally issued at the same time as a sequence is set up (see chapter 5).

Tone is a list of drum sounds which match the sequence length. Here's a short, concocted example (see the library files for many more):

Drum Define S1 1 0 90
Drum Define S2 S1 * 2
Drum Define S4 S1 * 4
SeqClear
SeqSize 4
Drum Sequence S4 S2 S2 S4
Drum Tone SnareDrum1 SideKick LowTom1 Slap

Here we first define the drum patterns ``S2'' to sound a drum on beats 1 and 3 and ``S4'' to sound on beats 1, 2, 3 and 4 (see section 4.3 for details on the ``*'' option). Next we set a sequence size of 4 bars and set a drum sequence to use this pattern. Finally, we instruct MMA to use a SnareDrum1 sound in bar 1, a SideKick sound in bar 2, a LowTom1 in bar 3 and a Slap in bar 4. If the song has more than four bars, this sequence will be repeated.

In most cases you will probably use a single drum tone name for the entire sequence, but it can be useful to alternate the tone between bars.

To repeat the same ``tone'' in a sequence list, use a single ``/''.

The ``tone'' can be specified with a MIDI note value or with a symbolic name. For example, a snare drum could be specified as ``38'' or ``SnareDrum1''. Appendix A.3 lists all the defined symbolic names.

Including Existing Patterns in New Definitions

When defining a pattern, you can use an existing pattern name in place of a definition grouping. For example, if we have already defined a chord pattern (which is played on beats 1 and 3) as:

Chord Define M13 1 4 80; 3 4 80

We can create a new pattern which plays on same beats and adds a single push note just before the third beat:

Chord Define M1+3 M13; 2.5 16 80 0

A few points to note:

This is a powerful shortcut in creating patterns. See the included library files for examples.


Multiplying Patterns

Since most pattern definitions are, internally, repetitious, you can create complex rhythms by multiplying a copy of an existing pattern. For example, if you have defined a pattern to play a chord on beats 1 though 4 (a quarter note strum), you can easily create a similar pattern to play eighth note chords on beats 1, 1.5, etc. though 4.5 with a command like:

Track Define NewPattern OldPattern * N

where ``Track'' is a valid track name (``Chord'', ``Walk'', ``Bass'', ``Arpeggio'' or ``Drum'', as well as ``Chord2'' or ``DRUM3'', etc.).

The ``*'' is absolutely required.

``N'' can be any integer value between 2 and 100.

Example 4.7: Multiply Define


Drum Define S1 1 1 100
Drum Define S2 S1 * 2
Drum Define S4 S2 * 2
Drum Define S8 S4 * 2
Drum Define S16 S8 * 2
Drum Define S32 S16 * 2
Drum Define S64 S1 * 64


In example 4.7 we start by defining a Drum pattern which plays a drum tone on beat 1 (assuming 4/4 time). We then derive a new pattern, ``S2'' which is the old ``S1'' multiplied by 2. This new pattern will play a tone on beats 1 and 2.

Next, ``S4'' is created. This plays 4 notes on the each half-beat.

Note the definition for ``S64''. We could have multiplied ``S32'' by 2, but for illustrative purposes have used ``S1'' and multiplied it by 64.

When MMA multiplies an existing pattern it will (usually) do what you expect. The start positions for all notes are adjusted to the new positions; the length of all the notes are adjusted (quarter notes become eighth notes, etc.). No changes are made to note offsets or volumes.

Example 4.8 shows how to get a swing pattern which might be useful on a snare drum.

Example 4.8: Swing Beat Drum Definition


Begin Drum Define
    SB8 1 2+16 0 90 ; 3.66 4+32 80
    SB8 SB8 * 4
End



Sheet Music Equivalent, Normal Notation



\includegraphics[width=.9\textwidth]{mupex/swingdrum8.ps}



Sheet Music Equivalent, Actual Rhythm

\includegraphics[width=.9\textwidth]{mupex/swingdrum8-3.ps}

To see the effects of multiplying patterns, create a simple test file and process it though MMA with the ``-p'' option.


Shifting Patterns

An existing pattern can be modified by shifting it a beat, or portion of a beat. This is done in a MMA definition with the Shift directive. Example 4.9 shows a triplet pattern created to play on beat 1, and then a second pattern played on beat 3.

Example 4.9: Shift Pattern Definition


Chord Define C1-3 1 3 90; \
    1.33 3 90; 1.66 3 90


\includegraphics[width=.9\textwidth]{mupex/trip1.ps}



Chord Define C3-3 C1-3 Shift 2

\includegraphics[width=.9\textwidth]{mupex/trip3.ps}

Note that the shift factor can be a negative or positive value. It can be fractional. Just be sure that the factor doesn't force the note placement to be less than 1 or greater than the Time setting.



Footnotes

... velocity4.1
MIDI ``note on'' events are declared with a ``velocity'' value. Think of this as the ``striking pressure'' on a piano.
...4.2
See the Direction command ([*]).
...4.3
The color of a chord are items like ``minor'', ``major'', etc. The current walking bass algorithm really does need some work! Currently only the first 4 notes of a minor, major and diminished scale are used.

next up previous
Next: Sequences Up: Reference Manaul Previous: Tracks and Channels
2004-04-19