Using ModPlug Tracker (old version) and being very happy with it, I still needed a param editor to manage effects. So I've just made one myself : VolFX Manager.
* Copy a track in ModPlug Tracker (Ctrl C). * Click IN : PASTE in VolFX Manager. * Select the effects you want to edit : v, p, Z(00-7F), Z(80-FF), O, X, V, and draw multiple envelopes on top of the track. * Click OUT : VOLFX (or hit Enter) and paste the edited track in ModPlug Tracker.
Features :
* editing restrictions : every rows / 1st-or-2nd every 2 / notes only. 1st every 2 (or 3, or 4) is usefull to mix two (or more) effects on the same column. * other effects can be protected or not.
* Select only one instrument (1-199) to be edited. * Select only one note (C0-B9) to be edited (usefull for drum kits).
* Z(00-7F) and Z(80-FF) are considered like 2 different effects. * you can select a maximum for the Offset effect.
* Save and load your edited tracks (without the notes). Usefull to quickly try different envelopes. * the window is resizable and can stay on top, usefull to integrate it inside the ModPlug window. * F4 for fullscreen.
* Randomize the current effect (1-100 percent). * Erase the current effect. * Define a function to set the values of the current effect :
variables : x represents the number of the row from 0 to max 255 y represents the current effect's values from 0 to 64 (Vol column) or from 0 to 255 (FX column).
Examples : 40 --> (all values = 40) 2*y --> (double all values) 4*x --> (fade in) 16*sin(x*pi/16) + 32 --> (sine centered on the value 32)
If you want to write a complex algorythm, start with y; and go on. It will be interpreted like this : y:=y; so no change is made to the y value and you can write anything after that :
y; if x<=32 y:=10*sqrt(x) else y:=64--x
Anything wrote in gml (game maker 6.1) should work as long as it makes sense. If you want more control over the internal variables, ask me and I'll tell you how to access the name of the note, the number of the instrument, and other useful things...
This is a quick guide (in progress) supposed to help game developers reduce the size of their music files, using impulse tracker modules.
Chiptune tracker music
How to reduce the size of game music.
Requirements * Modplug Tracker : to create modules and edit instruments. * GM Bassmod (if you're using game maker) : a music dll/extention to play tracker modules.
Introduction :
Although mp3 or ogg files are great for high quality game music, they take a lot of disk space wich doesn't make sense when it comes to chiptune music. Using tracker modules is the best way to create low size music for your game and can be played in game maker with the GM Bassmod dll/extension.
We will look at various ways to reduce the size of tracker modules :
1) Multiple tunes in one module. 2) Instrument optimization. 3) Sample optimization.
***
1) Multiple tunes in one module.
Instead of creating multiple modules for each level of your game (level_01.it, ..., level_08.it, etc.) containing more or less the same samples, you can save a lot of space by managing only one module (with one set of samples) for your entire game with several tunes following each other in it.
Let's say for example : - the level_01 tune starts at pattern order 00 of the module, and ends at 07. - the level_02 tune : 08-15. - the level_03 tune : 16-24. - etc.
To make the level_01 tune loop instead of going on with the next tune, write the effect "B00" at the last row of the pattern order 07 to make the music jump to pattern order 00 and restart the tune. - B08 at the end of order 15 for the level_02 tune. - B16 at the end of order 24 for the level_03 tune. - etc, do the same at the end of each tune to make them loop.
In Game Maker, with the GM Bassmod dll/extension, you can start a module from any position in the song with the function bmod_play_ext(index,order,row). Select the correct order to start the tune you wish to play : - Level_01 : bmod_play_ext(index,0,0); - Level_02 : bmod_play_ext(index,8,0); - Level_03 : bmod_play_ext(index,16,0);
Note : When you are finished and happy with your tunes, don't forget that the most basic way to lower the size of a module is to get rid of all the unused patterns, samples and instruments. Modplug Tracker has an option to do this (edit -> cleanup the song).
***
2) Instrument optimization.
You can create a lot of very different instruments with only one sample. You can map multiple samples in only one instrument. You can combine the two techniques.
In the impulse tracker format (*.it modules), the score is played by instruments controling the way the samples are played. An intrument is composed of :
- 3 envelops (volume, panning, and pitch or filter). - a CutOff Frequecy (filter). - a resonance factor. - An association of each note of the keyboard from C0 to B9 with a sample and a note.
All this data is optionnal, so one instrument is usually associated with one sample, played the same note as the note pressed on the keyboard, fading out when the note is released. But the 3 envelops and the note-sample association are essential to create the best sound quality and variety with the lowest size possible.
a) Multiple instruments from the same sample.
If you load a simple wave sample (typically less than 100 octets) you can then create a lot of different instruments to play this sample in many different ways. That's basically how chiptune music was produced in the beginning.
Here is a quick example : one_sample.zip (4 Ko) It contains 10 instruments with only 1 sample.
You can hear the 56 kbps mp3 version of it below (783Ko) :
It could be better, but there's everything needed : bass, drums, lead, chords, fx,... You could make an entire soundtrack with one sample.
But tracker modules usually contain more than one sample, so this technique can be combined with the next one :
b) Multiple samples in the same instrument.
Usually a sample will sound good only over 3 or 4 octaves while the other octaves are never played. Then if two instruments have basically the same envelops for two different samples, you can use just one instrument with the first sample mapped to the first octaves (from C0 to B4) and the second sample mapped to the last otavs (from C5 to B9). Then erase the second instrument (its sample won't be erased as it is now mapped to the first instrument).
Let's say you have created some really good envelops for an instrument, one way to add variety to your music without adding any octet is to map 2 or 3 of the other samples to it. Or, if you want to create a drum kit instrument, you can also map one sample per note.
Another reason to do this is to bypass the limit of 199 instruments by module : there is no limit to the number of samples, so you can virtually double or triple the number of instruments with this method. It sounds a bit ambitious but you might want to work with a large set of instruments to create your tunes with more freedom (199 instruments, without samples, = only 124 Ko).
***
2) Sample optimization.
There is two main solutions to reduce the size of samples : - Sound quality reduction. - Sound decomposition.
a) Quality reduction
One way to reduce the size of a sample is to "shrink" the definition of the wave signal by half (the [><] button in the sample editor of Modplug). The loss of quality and brilliance can be problematic but you can apply a high value for the CutOff filter to reduce the noise and add some resonance to regain brilliance in the instrument editor.
b) Sound decomposition : attack, loop and volume envelop.
Very often, recorded instrument sounds can be analized as a highly recognizable attack resolving in a standard sinewave decreasing in volume. Pianos, organs, vibraphones, bells, guitars, flutes and other instruments can usually be decomposed this way.
Look at this piano sample :
1. Try to find the first sinewave in the sample after the attack and create a loop with it (see above, highlited in gray and below, zoomed in). Listen carefully to the pitch of the loop (the frequency is in opposite ratio of the loop length) : it must be in tune with the rest of the sample. Also notice that the vertical coordinate of the wave must be the same at the beginning and at the end of the loop, otherwise the sound will be altered.
2. Then in the instrument editor, create a volume envelop that will copy the decrease of the original sample. You can also add a decreasing filter envelop to simulate the piano harmonics fading down.
3. If it sounds good you can erase the rest of the sample after the loop and save a lot of space (Modplug can automatically erase the part after the loop with the option : edit -> cleanup samples). Here our original 32Ko piano sample is cut down to a 2Ko sample, decomposed in an attack and a loop :
4. You can also add a light and slow vibrato in the sample editor (depth 1, rate 12) to simulate a more realistic and warm sound. This can be combined also with loops in the volume or filter envelops to obtain a really sophisticated sound.
***
Here is a compilation of 100 impulse tracker instruments, sorted by category, inside a 130Ko module. All samples and instruments have been heavily edited to maintain high quality for an average of 1Ko per instrument :
If you want to use any of those instruments in your tunes, go to the instrument editor of the module, press the save to disk button and don't forget to select the *.iti format otherwise you will loose all the filter data :