MOD2MIDI.DOC The MODfile to MIDIfile converter. Written and designed by Alexander Stock. CONTENTS MOD2MIDI.EXE -- the program. MOD2MIDI.DOC -- this file. GUITAROU.MOD -- a sample MODfile. GUITAROU.MID -- the finished product. GUITAROU.SET -- the saved settings file. INTRODUCTION Soon after my introduction to MODfiles, a mere two years ago, I became aware of their limitations. Not the least of these is their incompatibility with standard musical notation. They are also limited by the quality of their recording, and the hardware used to play them back. But there is a lot of good music in mod format, and I wanted to have access to it. I felt the need for a program to convert these MODfiles into MIDIfiles that I could play on my sound card. This would give me better quality sound, as well as allow me to view the music in standard notation, and manipulate it using the music software provided with my card. From this simple idea grew a quite complicated algorithm, with many added features. This is its first incarnation. FLOWCHART ÉÍÍÍÍÍÍÍÍÍÍÍÍ» FILE.MOD => ºMOD2MIDI.EXEº => FILE.MID [FILE.SET] => ÈÍÍÍÍÍÍÍÍÍÍÍͼ => [FILE.SET]  User input ÄÙ MOD2MIDI takes as input a 15 or 31 sample MODfile, and, with data from the user, generates a type one MIDIfile, with six tracks and fourty-eight ticks per crotchet. In addition, it generates a settings file, to save the user information, and loads this file if the same MODfile is ever worked on again. USAGE MOD2MIDI [file[.mod]] MOD2MIDI can be run from the command line. It can accept the name of a MODfile as a parameter, but if the name is not given, or the file does not exist, a window will come up, asking for the name of the MODfile. Enter the path and name of the file, as requested, and press Enter or Return. The '.MOD' extension is assumed, but if another extension is specified, the program will look for that file. If the file does not exist, another window will appear and ask you to try again. Once the MODfile has been located, a table will appear containing information on the five midi tracks. These tracks are ... Track One Track Two Correspond to the four MOD tracks. Track Three Instrumental samples are sent to these tracks. Track Four Percussion Rhythm and sound effect samples are sent to this track. You must enter the data by using the cursor keys to move the cursor onto the field you want to change, and pressing return. A window will appear below the table, asking you for the new information. The columns of the table are ... Channel The midi channel on which each track appears. Each of the four instrumental tracks must be set to different instrumental channels of your sound card. The percussion track must be set to the rhythm and sound effect channel of your sound card. Channels are numbered from 1 to 16. Pan The balance or panpot associated with each track. Pan position is from -7 on the far right, to 7 on the far left. Pan does not apply to the percussion track. Name The name of each track. This is a sixteen character string saying anything you like. Most midi players will show track names. The default settings are ... Track Pan Name ----- --- ---------------- Track One 2 7 Track Two 3 -7 Track Three 4 -7 Track Four 5 7 Percussion 10 N/A Once the table is to your satisfaction, press Escape when no window is asking for more information. After a short while, another table will appear, with information on the samples. You must complete this table in the same way. Only eight of the fifteen or thirty-one samples are displayed at once. Use Page Up and Page Down to view the previous or next eight samples. Samples that are not valid are filled in yellow. The columns of this table are ... Name Twenty two characters, identifying the sample. These are taken from the MODfile, and are not used in the MIDIfile.They cannot be changed by the user. Percussion Whether the sample is a percussion sample or an instrumental sample. Instrumental samples are played on the channel corresponding to the track on which they occur. Percussion samples are played on the rhythm and sound effect channel. Their pitch is ignored by the converter, and Chord and Transpose do not apply. Program Which midi program or percussion effect is to be played in the place of the sample. Consult your sound card manual for the full list of programmes and effects available to you. Midi programmes are different from percussion effect, and are used differently by the converter, but are entered in the same column, in the same way. Program is a number from 0 to 127. Volume Some samples are not recorded at normal volume. In the midi file, they may dominate the music, or be hidden by other samples. Volume allows you to change the volume at which the midi programmes are played. A Volume of 37 will mean that the program is always played at maximum volume, and a Volume of -73 means that the program will always be played with zero volume. A Volume change of 10 will double the playing volume, clipping it to maximum, and a Volume of -10 will halve the playing volume. Chord Some samples are not simple notes, but are chords. If chord is set to Minor, the converter will build a minor triad, rather than a single note whenever that sample appears. Likewise, if Chord is set to Major, the sample will be played as a major triad, and if Chord is set to Fifth, a perfect fifth. Chord is not applicable to percussion samples. Transpose Some samples are not recorded at the pitch at which they will be played. Mostly they will need to be transposed up or down an octave (12 semitones). Some will need to be transposed by other intervals to make them sound right. Transpose is the number of semitones (-128 to 127) by which the sample will be transposed when it is played. Transpose is not applicable to percussion samples. The default settings for each valid sample are ... Percussion Program Chord Transpose ---------- ------- ----- --------- No 0 None 0 When you have finished adjusting this table, press Escape. You will then be asked whether you want to save your settings. Press any key to toggle your choice, and return to choose. If you indicate Yes, a settings file will be generated, so that you can re-start from where you left off if you want to convert the MODfile again. If you indicate No, you will have to start from the previously saved, or default settings you started with last time, if you ever want to work on this MODfile again. You will next be asked if you want to continue with the conversion. If you indicate Yes, the program will begin conversion. A window will appear, indicating which pattern is being converted, and a status bar indicates the program's progress. When this is done, the program is finished, and a MIDIfile with the same name as the MODfile will be generated, as you have specified. HOW IT WORKS Once all the parameters have been specified, MOD2MIDI generates six temporary files in the directory where it is run from. Four are the four instrumental midi channels, one is the percussion midi channel, and one is the midi channel for tempo changes. These temporary files are used to save memory in favour of disk space, and they limit the speed of the program by the speed of the disk drive. It is best to run MOD2MIDI from a hard disk. MOD2MIDI runs through each pattern in the MODfile in the order in which they would be played and converts the information to midi data. As the MODfile is converted, the midi data is added to the appropriate files. Once all the patterns have been converted, the six files are copied, adding headers and tails, into a single MIDIfile. The temporary files are then deleted. FEATURES MOD2MIDI does not support all of the features of a MODfile, but it provides some features available to MIDIfiles. MODfile Features Pitch Bend Up -- Not Supported Pitch Bend Down -- Not Supported Pitch Bend to Note -- Not Supported Vibrato -- Not Supported Volume Slide -- Not Supported Position Jump -- Treated as Pattern Break. Set Volume -- Supported for instrumental samples and for the first time percussion samples are played. Pattern Break -- Supported Set Speed -- Supported MIDIfile Features Track Pan Track Name Of the features not carried into the MIDIfile, the pitch bends are the most significant. These would be very difficult to support, because of the quantum nature of midi data, which cannot be overcome in the same way that mod-players overcome the same problem with mod data. Vibrato and volume slides are hardly ever used. Position jump is a method by which a MODfile can be made to repeat endlessly. This cannot be supported by the midi format, so Position Jumps are ignored, and treated like Pattern Breaks. This should not produce any strange discontinuities in most cases. Position jumps are also hardly ever used. Pan in MODfiles is available to those of us with a stereo D/A converter, or a SoundBlaster Pro. However, two tracks are always played full left, and the other two are always played full right. The converted MIDIfile has each track panned to any one of fifteen different positions, at your specification. The Pan position is a property of each instrumental track, and can not be made to change during the playing of the MIDIfile. Each track can also be named. The names will usually be displayed by the midi player. LIMITATIONS AND PROBLEMS MOD2MIDI is limited in many ways by incompatibilities between the different music formats, and the capabilities of your sound card. MOD2MIDI requires a lot of information from the user, and the resulting MIDIfile is rarely perfect. These are some of the problems that can occur. Since samples can only be assigned to midi programmes or percussion effects, samples of speech or phrases of music can not be adequately represented. Some sound cards can play sound effects on the percussion channel, which, with a little imagination, can cope with some complicated samples. Because pitch bends are not supported, MODfiles using pitch bends may sound wrong in places. This can be fixed if you convert the MIDIfile to the format of your music software, and put the pitch bends in yourself. Most music software comes with a midi conversion program. This is a method for fixing most problems with the MOD2MIDI MIDIfiles. There are also editors for the midi format, which can solve some of these problems. The midi format requires each note to be turned on, and turned off again, whereas the MODfile format only requires that each note be turned on. MOD2MIDI only knows that a note should be turned off when the next note arrives on the same track. This causes problems when a track is left alone and assumed to be silent. Some mod samples do not sustain, and die away quickly if another note is not played. If a sustaining program has been chosen for such a sample, it will continue to play until the track would be used again. This can be solved by converting the MIDIfile, or by editing it, and moving the note off signal to the correct place. Samples may be recorded too loud or too soft, or at the wrong pitch. They sound right in the MODfile, but not in the MIDIfile. Wrong pitch or wrong volume can be solved by changing the transpose or volume properties of the sample before conversion. This is a process of trial and error. Midi data can only be fed to a sound facility at a certain rate, which is too slow in some cases. Very fast music, or music with a lot of effects, will be slowed down by the midi player, because too much information has to transmitted at once. If MOD2MIDI is caused to halt unnaturally, the temporary files may still exist. You can delete them if you want, or leave them there. HINTS -- Get to know the MODfile well before you try to convert it. This will tell you what each sample sounds like, and how it is used. -- Try to assign, if possible, programmes that have no sustain to samples that do not sustain, to avoid notes sustaining when they should be silent. This isn't always possible. -- If your sound card doesn't have a Percussion track, you can assign percussion samples to rhythm effects on the instrumental channels. -- You don't need to find programmes or effects that sound exactly like the sample. Other programmes will sound different, but still sound good. Be imaginative. -- String samples often need to be transposed up an octave. Bass guitar samples sometimes need to be transposed down an octave. Once again, it's a case of trial and error. That's why you can save your settings. -- It is usually a good idea to reduce the volume of chord samples, so that the extra notes don't sound overstated. -- To achieve the discordant effect of some electric guitar samples, try adding a fifth to the note. This doesn't sound quite right, but works fairly well if you don't have the right sample. -- Sometimes, invalid samples are used to silence sustaining samples. These work fine on MOD2MIDI, but sometimes valid samples are used for the same purpose. If you come across a silence sample, don't bother about setting a program. Just set the volume to -73, so that the sample will always be played silently. TESTING Note on Guitarous: GUITAROU.MID is the MIDIfile created from GUITAROU.MOD, by MOD2MIDI. The instrument settings are in GS standard format. If your sound card is not GS standard, then re-convert the file. You will only need to change the program settings. GUITAROU.MOD was composed by The WARLOCK / Grace S. Apologies that they could not be notified of its inclusion in this package before release. These are the conclusions of the MODfiles I have tested MOD2MIDI on. SIMPSONS.MOD POWER.MOD -- Don't bother with these. They contain too much WASTE.MOD -- digitised speech and complex samples. TOUCHME.MOD etc. POPCORN.MOD -- Worked perfectly. One of the first MODfiles I ever converted. Very simple. Only the strings sample needed to be transposed. AXELF.MOD -- Midi format could not improve much on the original MODfile. Lots of problems with note sustain. BREATH.MOD -- Worked perfectly, and demonstrated the success of the Chord feature. I originally wanted to use this for the demonstration of MOD2MIDI, because it worked so well. LAMBADA.MOD -- Not bad. Problems with the volume of samples were solved with the Volume control. The chords and volume changes sounded good. FAIRLITE.MOD -- Ended up different, but worked well. GREENSL1.MOD -- Because of the numerous volume changes, the midi signals seemed to be arriving late in places. One of the samples had to be transposed by an amount that I never got quite right, but I found an acceptable substitute for the two speech samples. ALIVE.MOD -- Although the pitch bends were lost, this MODfile still made a good MIDIfile. HOUSE_OF.MOD -- Big problems with sustaining samples and pitch bends. There was also a percussion effect that was played at more than one pitch, so I had to assign it to an instrumental program. SDMC.MOD -- This one came out quite good, but there were problems with a sample that seemed to need to be transposed two different ways. BB2.MOD -- The MIDIfile provided a much better sound, but without the pitch bends, the brass sounded out of tune in many places. SHADOWFI.MOD -- Without pitch bends, I had to use my imagination, but all the volume changes came through, and the effect was preserved. It came out rather good in the end. OXYGENE.MOD -- It lost a few volume slides, but they weren't needed. A sound effect was used to replace the wind sample, and I had to be imaginative with most of the other samples. The string chords needed to be hushed quite a bit. All the other volume effects worked well, and it sounded better as a MIDIfile. GUITAROU.MOD -- This one used everything MOD2MIDI had, and it sounded quite good. There was a pitch bend or two, but the music lived without them. HIGHER THINGS Here are some features that may or may not appear in later versions of MOD2MIDI. -- The rest of the MOD effects; pitch bends, etc. -- A PWM routine to play the samples when you choose the settings. -- A midi routine to play the midi programmes while you choose the settings. -- Pan as a property of samples instead of tracks. -- A library of sample attributes and settings. -- MIDI2MOD. CREDITS Programmer: Alexander Stock 51 Wilpena Street Eden Hills 5050 South Australia email: ajstock@teaching.cs.adelaide.edu.au March to October 1993, 1994 Assistance: Daniel Steer - lots of help with programming and supply of software utilities and MODfiles. email: 9129317s.lux.levels.unisa.edu.au March to October 1993, 1994 Geoffrey Bennett - supply of important information and beta testing. email: geoffrey@tafe.sa.edu.au Always valid Much thanks also to these accomplished programmers, whose software was in constant use during the making of MOD2MIDI. Mark J. Cox m.j.h.cox@bradford.ac.uk Modplay Pro Version 2.19b Norman Lin norlin@mailhost.ecn.uoknor.edu ModEdit v2.0 ModEdit v3.0 Harald Thunem thunem@kjemi.unit.no HTSCREEN.TPU LEGALITIES MOD2MIDI is Copyright (c) 1992,1993 by Alexander Stock. This program is shareware. You are permitted and encouraged to distribute this software freely, provided it is not altered in any way. You may use this software, without charge, for a trial period of thirty days. After this time, you are obliged to register by sending $20 to the author, at the above address. Registration of this software entitles the registeree to receive a updated version of MOD2MIDI as soon as one becomes available. Please indicate 3.5" or 5.25" disk. No responsibility is taken by the author for any loss or damage to property or person caused by this program. MOD2MIDI may not be used for any commercial purpose, without written permission from the author. The people credited above are all entitled to a free copy of this program, with no ethical obligation, and will be sent one as soon as possible. MOD2MIDI has been rigorously tested on a Roland LAPC-1 sound card, and a Roland Sound Canvas. MOD2MIDI.EXE was written in TurboPascal, using the HTScreen unit, by Harald Thunem. I will not distribute the source code to MOD2MIDI unless I am deeply flattered by words of appreciation, or by lots of money. Please contact me, and let me know what you think.