Subsections

- Translations
  - VoiceTr
  - ToneTr
  - VoiceVolTr
  - DrumVolTr
- Tweaks
  - Default Voices
  - DrumKit
  - Diminished Chord Type
  - Plectrum Reset On Groove Change
- Xtra Options
  - NoCredit
  - Chords
  - CheckFile
  - Grooves
  - Print
  - Splitting Output
    - Channel Split
    - Track Split
- Debug

#
Fine Tuning and Tweaks

# Translations

A program such as MMA which is intended to be run on various computers and synthesizers (both hardware keyboards and software versions) suffers from a minor deficiency of the MIDI standards: mainly that the standard says nothing about what a certain instrument should sound like, or the relative volumes between instruments. The GM extension helps a bit, but only a bit, by saying that certain instruments should be assigned certain program change values. This means that all GM synths will play a “Piano” if instrument 000 is selected.

But, if one plays a GM file on a Casio keyboard, then on a PC soft-synth, and then on a Yahama keyboard you will get three quite different sounds. The files supplied in this distribution have been created to sound good on the author's setup: A Casio WK-3000 keyboard.

But, what if your hardware is different? Well, there are solutions! Later in this chapter commands are shown which will change the preselected voice and tone commands and the default volumes. At this time there are no example files supplied with MMA , but your contributions are welcome.

The general suggestion is that:

1. You create a file with the various translations you need. For example, the file might be called yamaha.mma and contain lines like:

   VoiceTR Piano1=Piano2 ToneTr SnareDrum2=SnareDrum1 VoiceVolTr Piano2=120 BottleBlow=80 DrumVolTr RideBell=90 Tambourine=120

   Place this file in the directory /usr/local/share/mma/includes.

2. Include this file in your ~/.mmarc file. Following the above example, you would have a line:

   Include yamaha

That's it! Now, whenever you compile a MMA file the translations will be done.

All of the following translation settings follow a similar logic as to “when” they take effect, and that is at the time the VOICE, VOLUME, etc. command is issued. This may confuse the unwary if GROOVES are being used. But, the following sequence:

1. You set a voice with the VOICE command,
2. You save that voice into a GROOVE with DEFGROOVE,
3. You create a voice translation with VOICETR,
4. You activate the previously defined GROOVE.

Wrong! This does not have the desired effect.

In the above sequence the VOICETR will have no effect. For the desired translations to work the VOICE (or whatever) command must come after the translation command.

##
VoiceTr

In previous section you saw how to set a voice for a track by using its standard MIDI name. The VOICETR command sets up a translation table that can be used in two different situations:

- It permits creation of your own names for voices (perhaps for a foreign language),

- It lets you override or change voices used in standard library files.

VOICETR works by setting up a simple translation table of “name” and “alias” pairs. Whenever MMA encounters a voice name in a track command it first attempts to translate this name though the alias table.

To set a translation (or series of translations):

VoiceTr Piano1=Clavinet Hmmm=18

Note that you can additional VOICETR commands will add entries to the existing table. To clear the table use the command with no arguments:

VoiceTr // Empty table

Assuming the first command, the following will occur:

Chord-Main Voice Hmmm

The VOICE for the Chord-Main track will be set to “18” or “Organ3”.

Chord-2 Voice Piano1

The VOICE for the Chord-2 track will be set to “Clavinet”.

If your synth does not follow standard GM-MIDI voice naming conventions you can create a translation table which can be included in all your MMA song files via an RC file. But, do note that the resulting files will not play properly on a synth conforming to the GM-MIDI specification.

Following is an abbreviated and untested example for using an obsolete and unnamed synth:

VoiceTr Piano1=3 \ Piano2=4 \ Piano3=5 \ ... \ Strings=55 \ ...

Notes: the translation is only done one time and no verification is done when the table is created. The table contains one-to-one substitutions, much like macros.

For translating drum tone values, see TONETR.

##
ToneTr

It is possible to create a translation table which will substitute one Drum Tone for another. This can be useful in a variety of situations, but consider:

- Your synth lacks certain drum tones—in this case you may want to set certain TONETR commands in a MMARC file.

- You are using an existing GROOVE in a song, but don't like one or more of the Drum Tones selected. Rather than editing the library file you can set a translation right in the song. Note, do this before any GROOVE commands.

To set a translation (or set of translations) just use a list of drumtone values or symbolic names with each pair separated by white space. For example:

ToneTR SnareDrum2=SnareDrum1 HandClap=44

will use a “SnareDrum1” instead of a “SnareDrum2” and the value “44” (actually a “PedalHiHat”) instead of a “HandClap”.

You can turn off all drum tone translations with an empty line:

ToneTR

The syntax and usage of TONETR is quite similar to VOICETR.

##
VoiceVolTr

If you find that a particular voice, i.e., Piano2, is too loud or soft you can create an entry in the “Voice Volume Translation Table”. The concept is quite simple: MMA checks the table whenever a track-specific VOLUME command is processed. The table is created in a similar manner to the VOICETR command:

VoiceVolTr Piano2=120 105=75

Each voice pair must contain a valid MIDI voice (or numeric value), an “=” and a volume adjustment factor. The factor is a percentage value which is applied to the normal volume. In the above example two adjustments are created:

1. Piano2 will be played at 120% of the normal value,

2. Banjo (voice 105) will be played at 75% of the normal value.

The adjustments are made when a track VOLUME command is encountered. For example, if the above translation has be set and MMA encounters the following commands:

Begin Chord Voice Piano2 Volume mp Sequence 1 4 90 End

the following adjustments are made:

1. A look up is done in the global volume table. The volume “mf” is determined to be 85% for the set MIDI velocity,

2. the adjustment of 120% is applied to the 85%, changing that to 102%.

3. Assuming that no other volume adjustments are being made (probably there will be a global volume and, perhaps, a RVOLUME) the MIDI velocity in the sequence will be changed from 90 to 91. Without the translation the 90 would have been changed to 76.

This is best illustrated by a short example. Assume the following in an input file:

Solo Voice TenorSax Solo Volume f Print Solo Volume set to $_Solo_Volume VoiceVolTr TenorSax=90 Solo Volume f Print Solo Volume set to $_Solo_Volume

which will print out:

Solo Volume set to 130 Solo Volume set to 117

The second line reflects that 90% of 130 is 117.

To disable all volume translations:

VoiceVolTr // Empty table

##
DrumVolTr

You can change the volumes of individual drum tones with the DRUMVOLTR translation. This command works just like the VOICEVOLTR command described above. It just uses drum tones instead of instrument voices.

For example, if you wish to make the drum tones “SnareDrum1” and “HandClap” a bit louder:

DrumVolTr SnareDrum1=120 HandClap=110

The drum tone names can be symbolic constants, or MIDI values as in the next example:

DrumVolTr 44=90 31=55

All drum tone translations can be disabled with:

DrumVolTr // Empty table

#
Tweaks

Some minor values can be adjusted via the TWEAKS command. Each item is set as an OPTION=VALUE pair. Currently the following are valid:

## Default Voices

DEFAULTDRUM or DEFAULTTONE
  Set the default (initial) voice to use in DRUM, SOLO and MELODY tracks. You can use a numeric value, a mnemonic name, or even an extended voice name (see here). Examples:

  Tweaks DefaultDrum=22

  or

  Tweaks DefaultDrum=8.9.22

  and, assuming you have set up a PATCH SET (see here):

  Tweaks DefaultDrum=MyDrumKit

  Be careful when using this option with Solo/Melody tracks set to DRUMTYPE. If you set a VOICE (to use a different drum set) before setting a SOLO or MELODY track as DRUMTYPE this option will overwrite your changes.

DefaultVoice
  Sets the default (initial) voice to use in tracks other than drum. The same extended voicing options as detailed for DEFAULTDRUM apply. Examples:

  Tweaks DefaultVoice=99

  or

  Tweaks DefaultVoice=MyFunkyPiano

##
DrumKit

This option sets the default DRUMKIT to use for this MMA file. For a list of the known mnemonic names, please refer to the appendix. For consistency with the VOICE command (see here) you can append “Kit” to a name.

You can also use an integer value from 0 to 127.

Valid examples, all resulting in the same setting, include:

Tweaks DrumKit=Jazz

Tweaks DrumKit=JazzKit

Tweaks DrumKit=32

##
Diminished Chord Type

Dim
  Set the type of chord produced with the “dim” chordtype. By default a diminished chord is a “dim7”. However you can toggle this behaviour with:

  Tweaks Dim=3

  or

  Tweaks Dim=7

## Plectrum Reset On Groove Change

PlectrumDoRest
  By default a PLECTRUM track will not turn off its sounding strings when a GROOVE is changed. This can be toggled with:

  Tweaks PlectrumReSet=True

  Use False to restore the default.

- You can place several TWEAK commands on a single line; they are processed in order.

- In most cases the best place to apply these tweaks, if needed, is in your mmarc file.

#
Xtra Options

MMA has a number of options designed to help you in discovering the chords in your file, aid in debugging files, and massaging the form of the final MIDI file. These options are all accessed from the command line in the format -XCOMMAND OPTIONS.

##
NoCredit

By default, each MIDI file created by MMA has the text “Generated my MMA. Input filename: ...” in the MIDI Meta data. Not only does this information give credit to our favorite little program, it can also help you in the future to see where the file came from! However, there are times when it may be appropriate to suppress this (for example, you may be combining a series of separate tracks into one).

We request that you not use this option and give credit where credit is due. Thanks.

##
Chords

MMA has a large internal vocabulary of chord names, and it is quite easy to extend using the DEFCHORD command, details here. But, it's sometimes nice to check before entering chord names into a file. This command takes each chord name listed and checks to see if MMA recognizes it. For example:

$ mma -x chords C B A q

will generate:

Error: Illegal/Unknown chord name: 'q' VALID: A, B, C

You could easily incorporate this into a program which automatically generates MMA files.

##
CheckFile

This command will open the input filename and attempt to find all the chord names it contains and check each found to see if it is recognized by MMA . As it progresses any chord names not found are displayed in the format:

$ mma -x checkfile test Error: <Line 143> Illegal/Unknown chord name: 'q' Valid chords: Ab, Ab6, Abm6, Abm7

At the end of run, valid chords are listed in alphabetical order. This can be a great aid in seeing what chords are in the file (and seeing if any look “odd”). This command does not verify other commands and syntax in the file.

##
Grooves

This command will display all the GROOVES known to MMA . For this to work, the MMA library database must be up-to-date via the -g (or -G) command line option. For example:

$ mma -x Grooves alexis/hiphop:HIPHOP alexis/hiphop:HIPHOPEND alexis/hiphop:HIPHOPINTRO .... many, many more! zoom/trip:TRIP02 zoom/trip:TRIP03 zoom/trip:TRIP04

-X GROOVES (from a terminal) will display each groove name found in alphabetical order. This list can be quite long, you you might want to spool it to a scratch file or use a pager like “grep”.

If an optional name is included, only those GROOVES matching that name will be displayed.

$ mma -x Grooves trip casio/triphop:TRIPHOP casio/triphop:TRIPHOPEND .... lots more zoom/trip:TRIP03 zoom/trip:TRIP04

The names are listed in extended groove notation (here). These names can be easily cut/pasted into the MMA -V option.

##
Print

This command will display all the value of any system variable at initialization. Please note that this is processed before reading any RC files (ie. .mmarc). The use of a leading $ is optional (but if you use it you will need to escape it to protect it from the underlying shell). Example:

mma -xPrint _libpath \$_Volume

will display something like:

$_LIBPATH = /home/bob/src/bv/mma/lib $_VOLUME = 100

## Splitting Output

MMA can split the generated MIDI into separate files for later processing using other user supplied programs. This can be useful if, for example, you wish to set volume levels for specific tracks or use different synth engines for channels ... the choices are limitless.

- Please note that when using either channel or track splitting, no options other than the filename and the actual option are permitted.

###
Channel Split

Using the -XCSPLIT command causes MMA to generate a different MIDI file for each generated channel. Assuming your file wonders.mma generates data in channels 9, 10 and 16 the files wonders09.mid, wonders10.mid and wonders16.mid will be created.

###
Track Split

Using the -XTSPLIT command causes MMA to generate a different MIDI file for each internal track. So, for your file wonders.mma you may end up with files such as wonders-DRUM-SNARE.mid, wonders-DRUM-KICK.mid, wonders-BASS.mid, etc.

- Note that the splitting is done by repeatedly calling MMA for each track. The program name given on the command line (sys.argv[0]) is used as the executable name. Since the file is processed multiple times, we recommend that you include a command to make all randomizations predictive. The command “RNDSEED 1”, here, works nicely.

#
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
> Plectrum |  | display Plectrum chord shapes
> Roman |  | display Roman numeral chord conversions
> Groove |  | issue a warning when a Groove is redefined

The modes and command are case-insensitive (although the command line switches are not). The options for PLECTRUM, GROOVE and ROMAN are not accessible from the command line.

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