Blame | Last modification | View Log | Download | RSS feed
Path: pdxgate!usenet.ee.pdx.edu!ogicse!network.ucsd.edu!usc!wupost!uunet!pipex!marble.uknet.ac.uk!uknet!edcastle!iantwFrom: iantw@castle.ed.ac.uk (Ian Tweedie)Newsgroups: comp.sys.ibm.pc.demosSubject: Re: Does anyone have the MOD file format?Message-ID: <33868@castle.ed.ac.uk>Date: 5 Apr 93 11:48:50 GMTReferences: <lru8ebINN79h@earth.cs.utexas.edu> <LESHER.93Apr4142851@vega.cs.bucknell.edu>Organization: Edinburgh UniversityLines: 542lesher@vega.cs.bucknell.edu (Tim Lesher) writes:>I don't have it, but I seem to remember that there's a really good>tutorial packaged with the Mac mod player "The Sound Trecker". You>can get if from wuarchive.wustl.edu, /mirrors/info-mac/sound/st.Here is the Amiga (ProTracker) module format document. The first partI got from a BBS, the second part I got from Mark Cox (author ofModPlay, etc).*********************************************************************Protracker 1.1B Song/Module Format:Offset Bytes Description0 20 Songname. Remember to put trailing null bytes at the end...Information for sample 1-31:Offset Bytes Description20 22 Samplename for sample 1. Pad with null bytes.42 2 Samplelength for sample 1. Stored as number of words.Multiply by two to get real sample length in bytes.44 1 Lower four bits are the finetune value, stored as a signedfour bit number. The upper four bits are not used, andshould be set to zero.Value: Finetune:0 01 +12 +23 +34 +45 +56 +67 +78 -89 -7A -6B -5C -4D -3E -2F -145 1 Volume for sample 1. Range is $00-$40, or 0-64 decimal.46 2 Repeat point for sample 1. Stored as number of words offsetfrom start of sample. Multiply by two to get offset in bytes.48 2 Repeat Length for sample 1. Stored as number of words inloop. Multiply by two to get replen in bytes.Information for the next 30 samples starts here. It's just like the info forsample 1.Offset Bytes Description50 30 Sample 2...80 30 Sample 3......890 30 Sample 30...920 30 Sample 31...Offset Bytes Description950 1 Songlength. Range is 1-128.951 1 Well... this little byte here is set to 127, so that oldtrackers will search through all patterns when loading.Noisetracker uses this byte for restart, but we don't.952 128 Song positions 0-127. Each hold a number from 0-63 thattells the tracker what pattern to play at that position.1080 4 The four letters "M.K." - This is something Mahoney & Kaktusinserted when they increased the number of samples from15 to 31. If it's not there, the module/song uses 15 samplesor the text has been removed to make the module harder torip. Startrekker puts "FLT4" or "FLT8" there instead.Offset Bytes Description1084 1024 Data for pattern 00....xxxx Number of patterns stored is equal to the highest patternnumberin the song position table (at offset 952-1079).Each note is stored as 4 bytes, and all four notes at each position inthe pattern are stored after each other.00 - chan1 chan2 chan3 chan401 - chan1 chan2 chan3 chan402 - chan1 chan2 chan3 chan4etc.Info for each note:_____byte 1_____ byte2_ _____byte 3_____ byte4_/ / / /0000 0000-00000000 0000 0000-00000000Upper four 12 bits for Lower four Effect command.bits of sam- note period. bits of sam-ple number. ple number.Periodtable for Tuning 0, NormalC-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113To determine what note to show, scan through the table until you findthe same period as the one stored in byte 1-2. Use the index to lookup in a notenames table.This is the data stored in a normal song. A packed song starts with thefour letters "PACK", but i don't know how the song is packed: You canget the source code for the cruncher/decruncher from us if you need it,but I don't understand it; I've just ripped it from another tracker...In a module, all the samples are stored right after the patterndata.To determine where a sample starts and stops, you use the sampleinfostructures in the beginning of the file (from offset 20). Take a lookat the mt_init routine in the playroutine, and you'll see just how itis done.Lars "ZAP" Hamre/Amiga Freelancers--------------------------Found that document...Mark J Cox ------------------------------------------- m.j.h.cox@bradford.ac.ukUniversity of Bradford ---------------------------- bc732@cleveland.freenet.eduMarkEFFECT COMMANDS---------------Effect commands on protracker shouldbe compatible with all other trackers.0 - None/Arpeggio 8 - * NOT USED *1 - Portamento Up 9 - SampleOffset2 - Portamento Down A - VolumeSlide3 - TonePortamento B - PositionJump4 - Vibrato C - Set Volume5 - ToneP + VolSlide D - PatternBreak6 - Vibra + VolSlide E - Misc. Cmds7 - Tremolo F - Set SpeedE - COMMANDS------------The E command has been altered tocontain more commands than one.E0- Filter On/Off E8- * NOT USED *E1- Fineslide Up E9- Retrig NoteE2- Fineslide Down EA- FineVol UpE3- Glissando Control EB- FineVol DownE4- Vibrato Control EC- NoteCutE5- Set Finetune ED- NoteDelayE6- Patternloop EE- PatternDelayE7- Tremolo Control EF- Invert LoopCmd 0. Arpeggio [Range:$0-$F/$0-$F]-----------------------------------Usage: $0 + 1st halfnote add+ 2nd halfnote addArpeggio is used to simulate chords.This is done by rapidly changing thepitch between 3(or 2) different notes.It sounds very noisy and grainy onmost samples, but ok on monotone ones.Example: C-300047 C-major chord:(C+E+G or C+4+7 halfnotes)C-300037 C-minor chord:(C+D#+G or C+3+7 halfnotes)Cmd 1. Portamento up [Speed:$00-$FF]------------------------------------Usage: $1 + portamento speedPortamento up will simply slide thesample pitch up. You can NOT slidehigher than B-3! (Period 113)Example: C-300103 1 is the command,3 is the portamentospeed.NOTE: The portamento will be called asmany times as the speed of the song.This means that you'll sometimes havetrouble sliding accuratly. If youchange the speed without changing thesliderates, it will sound bad...Cmd 2. Portamento down [Speed:$00-FF]-------------------------------------Usage: $2 + portamento speedJust like command 1, except that thisone slides the pitch down instead.(Adds to the period).You can NOT slide lower than C-1!(Period 856)Example: C-300203 2 is the command,3 is the portamentospeed.Cmd 3. Tone-portamento [Speed:$00-$FF]--------------------------------------Usage: Dest-note + $3 + slidespeedThis command will automatically slidefrom the old note to the new.You don't have to worry about whichdirection to slide, you need only setthe slide speed. To keep on sliding,just select the command $3 + 00.Example: A-200000 First play a note.C-300305 C-3 is the note toslide to, 3 the command,and 5 the speed.Cmd 4. Vibrato [Rate:$0-$F,Dpth:$0-$F]--------------------------------------Usage: $4 + vibratorate + vibratodepthExample: C-300481 4 is the command,8 is the speed of the vibrato,and 1 is the depth of the vibrato.To keep on vibrating, just selectthe command $4 + 00. To change thevibrato, you can alter the rate,depth or both. Use command E4- tochange the vibrato-waveform.Cmd 5. ToneP + Volsl [Spd:$0-$F/$0-$F]--------------------------------------Usage: $5 + upspeed + downspeedThis command will continue the currenttoneportamento and slide the volumeat the same time. Stolen from NT2.0.Example: C-300503 3 is the speed toturn the volume down.C-300540 4 is the speed toslide it up.Cmd 6. Vibra + Volsl [Spd:$0-$F/$0-$F]--------------------------------------Usage: $6 + upspeed + downspeedThis command will continue the currentvibrato and slide the volume at thesame time. Stolen from NT2.0.Example: C-300605 5 is the speed toturn the volume down.C-300640 4 is the speed toslide it up.Cmd 7. Tremolo [Rate:$0-$F,Dpth:$0-$F]--------------------------------------Usage: $7 + tremolorate + tremolodepthTremolo vibrates the volume.Example: C-300794 7 is the command,9 is the speed of the tremolo,and 4 is the depth of the tremolo.To keep on tremoling, just selectthe command $7 + 00. To change thetremolo, you can alter the rate,depth or both. Use command E7- tochange the tremolo-waveform.Cmd 9. Set SampleOffset [Offs:$00-$FF]--------------------------------------Usage: $9 + SampleoffsetThis command will play from a chosenposition in the sample, and not fromthe beginning. The two numbers equalthe two first numbers in the lengthof the sample. Handy for speech-samples.Example: C-300923 Play sample fromoffset $2300.Cmd A. Volumeslide [Speed:$0-$F/$0-$F]--------------------------------------Usage: $A + upspeed + downspeedExample: C-300A05 5 is the speed toturn the volume down.C-300A40 4 is the speed toslide it up.NOTE: The slide will be called asmany times as the speed of the song.The slower the song, the more thevolume will be changed on each note.Cmd B. Position-jump [Pos:$00-$7F]----------------------------------Usage: $B + position to continue atExample: C-300B01 B is the command,1 is the position torestart the song at.This command will also perform apattern-break (see 2 pages below).You can use this command instead ofrestart as on noisetracker, but youmust enter the position in hex!Cmd C. Set volume [Volume:$00-$40]----------------------------------Usage: $C + new volumeWell, this old familiar command willset the current volume to your ownselected. The highest volume is $40.All volumes are represented in hex.(Programmers do it in hex, you know!)Example: C-300C10 C is the command,10 is the volume (16 decimal).Cmd D. Pattern-break[Pattern-pos:00-63, decimal]----------------------------Usage: $D + pattern-positionThis command just jumps to the nextsong-position, and continues playfrom the patternposition you specify.Example: C-300D00 Jump to the nextsong-position and continue playfrom patternposition 00.Or: C-300D32 Jump to the nextsong-position and continue playfrom patternposition 32 instead.Cmd E0. Set filter [Range:$0-$1]--------------------------------Usage: $E0 + filter-statusThis command jerks around with thesound-filter on some A500 + A2000.All other Amiga-users should keep outof playing around with it.Example: C-300E01 disconnects filter(turns power LED off)C-300E00 connects filter(turns power LED on)Cmd E1. Fineslide up [Range:$0-$F]----------------------------------Usage: $E1 + valueThis command works just like thenormal portamento up, except thatit only slides up once. It does notcontinue sliding during the length ofthe note.Example: C-300E11 Slide up 1 at thebeginning of the note.(Great for creating chorus effects)Cmd E2. Fineslide down [Range:$0-$F]------------------------------------Usage: $E2 + valueThis command works just like thenormal portamento down, except thatit only slides down once. It does notcontinue sliding during the length ofthe note.Example: C-300E26 Slide up 6 at thebeginning of the note.Cmd E3. Glissando Ctrl [Range:$0-$1]------------------------------------Usage: $E3 + Glissando-StatusGlissando must be used with the tone-portamento command. When glissando isactivated, toneportamento will slidea halfnote at a time, instead of astraight slide.Example: C-300E31 Turn Glissando on.C-300E30 Turn Glissando off.Cmd E4. Set vibrato waveform[Range:$0-$3]----------------------------Usage: $E4 + vibrato-waveformExample: C-300E40 Set sine(default)E44 Don't retrig WFC-300E41 Set Ramp DownE45 Don't retrig WFC-300E42 Set SquarewaveE46 Don't retrig WFC-300E43 Set RandomE47 Don't retrig WFCmd E5. Set finetune [Range:$0-$F]----------------------------------Usage: $E5 + finetune-valueExample: C-300E51 Set finetune to 1.Use these tables to figure out thefinetune-value.Finetune: +7 +6 +5 +4 +3 +2 +1 0Value: 7 6 5 4 3 2 1 0Finetune: -1 -2 -3 -4 -5 -6 -7 -8Value: F E D C B A 9 8Cmd E6. PatternLoop [Loops:$0-$F]----------------------------------Usage: $E6 + number of loopsThis command will loop a part of apattern.Example: C-300E60 Set loopstart.C-300E63 Jump to loop 3times before playing on.Cmd E7. Set tremolo waveform[Range:$0-$3]----------------------------Usage: $E7 + tremolo-waveformExample: C-300E70 Set sine(default)E74 Don't retrig WFC-300E71 Set Ramp DownE75 Don't retrig WFC-300E72 Set SquarewaveE76 Don't retrig WFC-300E73 Set RandomE77 Don't retrig WFCmd E9. Retrig note [Value:$0-$F]---------------------------------Usage: $E9 + Tick to Retrig note at.This command will retrig the same notebefore playing the next. Where toretrig depends on the speed of thesong. If you retrig with 1 in speed 6that note will be trigged 6 times inone note slot. Retrig on hi-hats!Example: C-300F06 Set speed to 6.C-300E93 Retrig at tick 3out of 6.Cmd EA. FineVolsl up [Range:$0-$F]----------------------------------Usage: $EA + valueThis command works just like thenormal volumeslide up, except thatit only slides up once. It does notcontinue sliding during the length ofthe note.Example: C-300EA3 Slide volume up 1at the beginning of the note.Cmd EB. FineVolsl down [Range:$0-$F]------------------------------------Usage: $EB + valueThis command works just like thenormal volumeslide down, except thatit only slides down once. It does notcontinue sliding during the length ofthe note.Example: C-300EB6 Slide volume down6 at the beginning of the note.Cmd EC. Cut note [Value:$0-$F]------------------------------Usage: $EC + Tick to Cut note at.This command will cut the noteat the selected tick, creatingextremely short notes.Example: C-300F06 Set speed to 6.C-300EC3 Cut at tick 3 outof 6.Note that the note is not really cut,the volume is just turned down.Cmd ED. NoteDelay [Value:$0-$F]-------------------------------Usage: $ED + ticks to delay note.This command will delay the noteto the selected tick.Example: C-300F06 Set speed to 6.C-300ED3 Play note at tick3 out of 6.Cmd EE. PatternDelay [Notes:$0-$F]----------------------------------Usage: $EE + notes to delay pattern.This command will delay the patternthe selected numbers of notes.Example: C-300EE8 Delay pattern 8notes before playing on.All other effects are still activewhen the pattern is being delayed.Cmd EF. Invert Loop [Speed:$0-$F]---------------------------------Usage: $EF + InvertspeedThis command will need a short loop($10,20,40,80 etc. bytes) to work.It will invert the loop byte by byte.Sounds better than funkrepeat...Example: C-300EF8 Set invspeed to 8.To turn off the inverting, setinvspeed to 0, or press ctrl + Z.Cmd F. Set speed [Speed:$00-$FF]--------------------------------Usage: $F + speedThis command will set the speed of thesong.---------------------------end forwarded message--------------------------------Jeff Hartung--Disclaimer: My opinions only, etc., etc., BLAH! BLAH! BLAH!...InterNet - hartung@crl.ucsd.edu BITNET - hartung@ucsdUUCP - ucsd!crl.ucsd.edu!hartungThis is a reposting for an earlier one.Enjoy.....ian