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:
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.
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:
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.
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:
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.
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:
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.
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:
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:
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 |
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 |
Some minor values can be adjusted via the TWEAKS command. Each item is set as an OPTION=VALUE pair. Currently the following are valid:
Tweaks DefaultDrum=22 |
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.
Tweaks DefaultVoice=99 |
Tweaks DefaultVoice=MyFunkyPiano |
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 |
Tweaks Dim=3 |
Tweaks Dim=7 |
Tweaks PlectrumReSet=True |
Use False to restore the default.
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.
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.
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.
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.
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.
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 |
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.
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.
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.
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.