SAM MOD player
Play all those funky Amiga (four channel) MODs on your blue footed friend. Either via the SAA1099 soundchip (3 bits per channel, stereo), the Blue Alpha Sound sampler (6 bits per channel, mono), the SAMDAC or EDDAC (7 bits per channel, stereo) or the Quazar Surround (8 bits per channel, surround).
Watch the hex scroll by as the music plays.
|Sampling rate||10.4khz with screen on|
|Resolution||Depending on sound device varies from 3 to 8 bits|
|Stereo / Surround||Depends on sound device|
|Max mod size||V2.1x Approx 400 kilobytes on a 512K SAM, V2.2 and above up to 4Mbytes|
Instructions extracted from V2.10:
Thank you for buying the SAM MOD player. I hope you get as much musical entertainment out of your SAM as I have while writing this program. If you have never listened to a mod file before then I suggest you simply load up the SAM MOD player, press RETURN when asked to choose your sound device and then load up one of the supplied demo modules.
Please do not copy this program, it has cost me a whole lot of time and after all what's five pounds?
Acknowledgements and thanks
I would like to thank the following people for their help, for without them the SAM MOD player would not be what you have got in front of you.
Edwin Blink, original author of the BURSTPLAYER - the engine used by the MOD player. I hope you are having a good time in Thailand, when will your SAM be up and running again?
Robert van der Veeke, the great artist who shows that you can draw excellent graphics on the SAM. I'm sure his loading screen makes the minimal loading time more bearable.
Martijn Groen, finally getting to grips with assembly, so look out for some stuff from him soon.
Dan Dooré, for a lot of beta testing, ah the joys of E-Mail. If there are any bugs left then you know who didn't do his job properly - but then again, job?
Joshua Jensen, this is a PC dude who was so nice as to spread his mod playing code which made it a whole lot easier for me to figure out what all those effects do.
Jogeir Liljedahl, for producing some totally excellent mods which led me to discovering a few bugs still left in version 2.02.
Colin Anderton, for hassling me into adding the "C" option so that his crap telly will stop hissing.
Stefan Drissen, 7 May 1996
Legal notice: in no way is the author responsible for any damages or loss of profits incurred by using the SAM MOD player. I doubt that the code is able to do damage, but if you spend too much time admiring the mods you may get less serious work done.
WHAT IS A MODULE?
A module (commonly known as a mod) is a file that consists of samples and music data on how the samples should be played. Up to four channels can be played at once allowing impressive pieces of music to be composed. The MOD format originated on the Amiga and has undergone a whole range of improvements since then.
THE SOUND DEVICE SELECTION SCREEN
Upon loading the SAM MOD player you can select the sound device that you want to use to play your music through. On each line after the sound devices is the resolution at which each channel will be played at. The more bits the better. For every bit extra, the sound quality is twice as good. This means that the sound quality of the SAMdac is 8 times (2^3) that of the internal soundchip.
The Amiga speed allows you to slightly speed up the speed at which samples are played back. Samples will then be played backat the slightly faster speed of the typical American Amiga (NTSC). The standard value is of course the speed of the European PAL Amiga. You will notice that even on longer samples a change in speed doesn't make all too much of difference. Thisis because the NTSC is approximately 1% faster than the PAL. I just thought I'd better include the option though.
THE FILE SELECTOR
Once you have selected your sound device the discdrive will start spinning and you will be presented with a list of the mod files on the current disc. One special feature of the file selector is that it automatically detects if the inserted disc is a PC disc or a SAM disc and then goes along and reads it irrespective of the format.
The file selector will show all valid mod files. A valid mod file has the ".MOD" extension on a PC disc or a "*.M*" extensionon a SAM disc. Furthermore the length of any file that fulfills these requirements is compared to the sum of the samples and pattern data as contained within the header of the mod file. The difference between the sum and the file length may be up to 256 bytes. Files with a larger difference are considered not to be mod files. The SAM compressed mod (4 bit) format is also recognized - it must be noted that the quality of these mods is lower than an 8 bit mod when played on devices other than the soundchip.
You can move the flashing cursors with either the cursor keys or a joystick. You can select a file/drive by pressing RETURN or the fire button. By selecting the <1> (or <2> if you have two drives) the disc in that drive will be re-read and a new file list displayed. If you move the cursor to a file then at the bottom of the screen you will see information on that file. The following items are displayed: title, number of samples, number of bits per sample, number of song entries, (decompressed) file size in kilobytes and the creation date.
Originally mods only supported 3 octaves, this was due to Amiga hardware limitations. Since the migration of mod trackers to the PC there came 5 octave mods. Due to the way the SAM MOD player works, if you want to load up a 5 octave mod then you should press "O", in the upper right corner you will then see the 3 change to a 5. Pressing "O" again reverts to 3 octave mode. You can tell that a mod is a 5 octave mod if the period values on the tracker screen go lower than 71. You can hear this by short samples sounding clicky or a mod sounding out of tune (this is due to a portamento slide trying to pass the 3 octave boundary). Generally 3 octave mode will do fine. Do note that if you select 5 octave mode each sample requires some extra memory (approx 1k per sample) so that you may have problems with the larger mods. The included mod "gib_bb" is a 5 octave mod, listen to the difference - in 3 octave mod it sounds out of tune when it gets to the high guitar part.
You will not be warned if a mod is too large to fit into memory.
THE SAM MOD PLAYER
Once you have loaded a mod for the first time you will presented with an opening screen, this will only be displayed once each time you load the SAM MOD player. On all screens from now on all numbers will be displayed in hexadecimal. Why hex? Firstly all tracker programs use hex notation, secondly it's a lot easier and faster to print hex digits on the screen.
There are six screens which you can flip between using the function keys (F1,F2,F3,F4,F5 and F6). At the top right of some of the screens are three numbers. The first is the song entry, the second is the pattern and the third is the pattern row.
F1: The help summary
This screen gives a quick summary of what all the keys do and can be used as an easy reference to prevent you having to read this file again.
F2: The sample names list
This screen gives a list of the names of the samples used in the song. The first number gives the length of the sample in words (2 bytes), this means that samples can be up to 128k in length. The second digit is the default volume of the sample, this can range from &00 (off) to &40 (maximum volume). When a sample is played the volume is automatically set to the default volume. The little pointers to the left and right of the screen indicate which samples are being played. If you switch off a channel then that pointer will no longer be displayed.
F3: The extended sample info list
This screen gives a list of the header info of the samples. First the name (abbreviated) is displayed, then the sample length in words. Next up is the fine tune value, this can have a value between -8 to +7 and allows a sample to be played a fraction of a semitone higher or lower. The next value is the volume (see above). Next up is the offset of the sample loop (in words unless it's a bugged noisetracker loop) and the length of the loop in words.
F4: The tracker screen
This is my favourite screen, you can watch the music roll on by. The first column in each channel is the sample number, second is the period (the lower the period the higher the pitch), then comes the effect column and the parameter for the effect. On this screen you can see if a mod is possibly a 5 octave mod by checking to see if there are any periods lower than &71 (indicating a higher octave). If the song speed is too high then the program can no longer keep up and rows will be skipped. The speed is generally too high when the frame speed is lower than three.
NEW in version 2.10: there is now a volume amplify option, the amplification factor is displayed on this screen. The song speed is also shown, this is how many 50ths of seconds each pattern row takes. Next to this is the tempo, this is NOT in hex, it tells how many BPMs the song is. If tempo effects have not been used then the BPM value is 125. This is calculated as follows: a beat is once every four pattern rows, a pattern row takes 6/50s (by default - can be changed!). 50/(6*4) * 60s = 125 BPM. Tempo changes DO change the speed of the song as it should, however the way this is done is not the way this is supposed to be done, resulting in some songs sounding out of tune.
F5: Effects summary screen
This screen rounds up all the effects possible and what the parameters do.
F6: Techy screen
Rather pointless unless you're interested. This screen shows the burstplayer data for one channel, by pressing F6 again you can go to the next channel. The first column is the offset of the sample, the next is the page, this is followed by the volume table address (divided by 256), then comes the speed (in fractions of 256) and the integer part of the speed.
On all screens the following keys will result in action:
1: toggle channel one on or off
2: toggle channel two on or off
3: toggle channel three on or off
4: toggle channel four on or off
P: pause tune, pressing P again unpauses
+: increase volume amplification with 25%. Holding shift down at the same time increases volume amplification with 100%.
-: decrease volume amplification with 25%. Holding shift down at the same time decreases volume amplification with 100%.
NOTE: due to all the volume tables needing to be recalculated, it is advisable to pause the tune before changing the volume amplification, since the calculation routine can then get 100% of the CPU time.
C: select palette set two, by default this is a totally black palette which can be useful if your TV hums a lot when there is stuff on the screen. If you want to change this from black the palette data is contained at offset 75 in the "MOD demo" code file. Make sure you don't stuff up your original!
L: toggle looping. When looping is on the tune restarts when it has finished playing and the position jump commands are not ignored. When looping is off and the tune has finished you are returned to the file selector, position jump commands ("B") are ignored.
ESC: stop tune playing and return to file selector.
F9: reset the SAM.
The left and right cursor keys allow you to (re)wind through the module.
THE MOD SETUP PROGRAM
To prevent you having to select your sound device and the PAL/NTSC each time you load up the SAM MOD player you can use the setup program. It will set the default values for these two items so that you only have to press RETURN to select your default settings.
You are also asked to enter the step rates, these are the times needed for the disc drive to step to the next track. The figures indicated in brackets are the values used by SAMdos. For the internal drive I have found that you can easily use the 2ms step rate. For external drives 12ms is recommended.
Please note that you will have to write enable your disc since the setup program saves the new defaults. I recommend you make a backup copy of the SAM MOD player and use this copy in future. Please do not abuse the backup facility!
Sampling rate: 10.4khz with screen on
Resolution : depending on sound device varies from 4 to 8 bits* volume amplification can increase resolution!
Stereo : depends on sound device
Max mod size : approx 400 kilobytes on a 512K SAM.
FREQUENTLY (?) ASKED QUESTIONS
Q: I'm not hearing anything, but the mod is playing.
A: Check that you have selected a valid sound device, check the connections to the stereo.
Q: I'm sure there's a mod on that disc but it is not showing up on the file selector.
A: The mod has probably been ripped from somewhere and not saved with the correct length, use the CALC program to give you the correct length, load the mod and resave it with the correct length.
USING THE MOD CODE
On the disc is also a COMET source file showing you how you can include a mod in your own program. All the information that you need is included in the file "EXAMPLE.S" You are free to use the mod playing code in your program as long as no money is involved AND your program is NOT merely a mod player. If you want to use the mod code in a commercial product then please contact me at the address at the end of this document.
When I get my hands on a megabyte I will look into allowing modsto be loaded into the meg. The specs of the meg alone are NOT enough since I will also need to make some new timing tables since external memory is faster than internal memory.
HARD DISC version!
Load mods larger than your memory size into your SAM!
And of course the item that will probably generate the most interest - the SOLtracker (you can guess what this should do yourself). ** as of now unfortunately on hold to let another project be done **
You can always contact me at the following address:
Stefan Drissen <redacted>
Or you can E-Mail me at: <redacted>
Updates are available via my web page: <redacted>
If you are interested in buying a SAMdac they are available from the same address. Please send 25 pounds cash to me or contact Derek Morgan. The SAMdac connects to your SAM's parallel printer port and increases the sound quality eight-fold! (and therefore sounds amazing!)
2.10 + volume amplification included, press + or - (with shift for greater changes) to change the amplification. + song speed and tempo now shown on tracker screen.
2.05 + pressing C selects the alternate palette (all black) to prevent crappier TV's from hissing too much.
2.04 - tempo bug removed. MODs with fast tempos (anything abovethe standard 125) will now play at the proper speed. (The frame pointer was being reset all the time, whereas it should have been able to hold other values).
2.03 + speed and tempo reset upon looping mod. - pattern break to line bug removed. - pattern break after pattern loop bug removed. - bug in looping 768- to 1023-byte sample loops removed. * further code optimization.
2.02 File selector bug for 1-drive SAMs removed. When a disc without any mod files was inserted you could move the pointer all the way down. Thanks to Andrew Collier for spotting this one and to Ian Collier for e-mailing it.
2.01 BPM/Tempo support implemented
2.00 first release version
In Fred 41, something brilliant happened. Once again, the adoring Fred reading populus was treated to a extra permanent feature to their magazine - MODs! Not only that, but a MOD player was given in this issue. But what are these strange things called MODs? (And no, they aren’t geezers dressed in parker jackets riding mopeds!). Read on, dear viewer…
MODs are short for Modules, and these spritely things first came about on the Amiga, followed by the PC (where the MOD evolved somewhat). These Modules are files consisting of samples and music data on how the samples should be played. PC Modules are available on Public Domain, while SAM MODs (Amiga converted, mostly) are available courtesy of Fred Magazine.
But hang on. Why shell out £5 on a MOD player when you get one in Fred 40 for £2? (Oh, along with some programs and a mag). Well, anyone who has been down to some of the more recent Gloucester shows couldn’t help but notice a tall programmer running around with a necklace of SAMDACs trying to flog these handy pieces of hardware. Lo! For this man is no mere mortal. For he is Stefan Drissen, programming genius from a land far, far away (The Netherlands). He programmed the first MOD Player as mentioned in Fred 40, though compared to this new MOD Player of his, the Fred one seems less than functional!
From the start, you know that you’re being treated to a fabby piece of kit. The on-disk manual is full of information and hot-keys aplenty, and when you load up the actual MOD Player, you are simply spoilt for choice. For a start, you get to choose from a myriad of playing devices, including the SAMDAC (ah, you see why he’s been carrying around that hardware necklace!), the Quazar Surround, the Blue Alpha Sound Sampler and even the humble SAM SAA1099 Phillips soundchip. Actually, I heard the SAMDAC play some MODs on the Fred stall at the October Gloucester show, and they sounded incredibly tasty indeed. The hard graft is that the more bits your sound device has, the better the quality of the MOD being played on this sound device.
I had the fun of my humble SAM soundchip, but even this was good enough for me. Modules are best played through a Hi-Fi speaker system, although TV speakers are just about bearable with the Soundchip (the basic set-up for the basic SAMster!). The MOD player then allows you to choose if you want your MOD to be played in NTSC mode or PAL mode. It may sound technical, but there really isn’t all that much difference - the NTSC mode relates to the American Amiga and is 1% faster than the PAL English Amiga.
Then you’re treated to the MOD Player’s impressive disk-manner. There are 5 Modules on the MOD Player disk given generously with the player, and each one is a different example of what can be heard. I say that this is impressive, as it’s more user friendly than the Fred MOD Player, displays the MOD’s title, creation date, no of samples, file size, etc. It also gives you the choice of loading in a 5 or 3 octave MOD. On the Player, there is one 5 Octave MOD out of the 5 given, which simply allows for easier octave swings. This gives you some nice quality MODs to listen to. Not only that, but the Player can actually load PC MODs from PC disk! Hurrah!! Saying this, a huge amount of Public Domain MOD material becomes instantly accessable (although understandably, MODs of a length larger than what can be squeezed in aren’t displayed).
Once your MOD is loaded in, playing with it is great! You can listen all the way through the MOD, but there is some other fun stuff. The function keys give you various screens, including one where you can see some hidden messages not previously seen on the Fred MOD player (erm, including a friendly one about breaking hackers’ legs…), as well as a techy page and also the main viewing screen. You can tell it is this, because the screen has 4 columns corresponding to the 4 channels of the MOD. Each channel has a yellow arrow which runs down along with an ever-changing list of hex address and the like - very advantageous to the advanced programmer.
You can fast forward or rewind through your MOD with the press of an F9 key, pause the MOD and make it loop. Though the most intresting feature is the ability to toggle any of the 4 channels on or off, with the help of the number keys. Another screen has an effects summary for all the MOD effects possible, and there’s even an instrument screen to show you what is being played - yellow arrows showing you what’s what.
Stefan was helped through the MOD Player with Edwin Blink (who also helped with the SAMDAC’s creation!) and Robert Van Der Veeke (big graphics bloke who did the fabby Manga-esque loading screen), and this has to be Mr. Drissen’s best thing he’s ever done. Using the MOD Player is great fun, and I was digging up back issues of Fred and loading up MOD after MOD of musical fun. The 5 MODs given with the MOD Player are ideal for showing what can be done, and there’s one or two real corkers in there too.
Though the real reason for purchasing this corker of a utility is the PC edge - the fact that tons of stuff is now accessible to the “humble” SAM. I can imagine the looks of surprise from those (ever increasing number of) PC owners who see their MODs being played on our blue-footed mate. But not only that - they’ll wow in amazement at this excellent utility.
Please find the Comet Assembler source files attached. These were in a sub-directory called ‘2.11’ so I think this is what I was working on for the next release. I cannot remember how I used to compile these bits together - a makefile would have been a good idea…