This has nothing to do with computer graphics - it's just something I did that I needed to host somewhere...
A while back I got given an Akai s2800 sampler. Though no longer cutting edge, it's a seriosly nice piece of kit. However the gotcha is that it doesn't have a hard drive, so all samples have to be loaded from floppy. Of course the floppies are a non standard format, and are impossible to get hold of. So the challenge is to somehow get this thing loaded with a decent set of samples. Ideally they should all fit on a single floppy/in memory, so I can load them up once and then get on with playing...
There's nothing special about the Akai, so everything written hear should apply to any sampler that you might be trying to revive.
Fortunatly virtually all samplers understand the MIDI Sample Dump Standard (SDS) - part of the the Midi system exclusive specification which allows samples to be transfered via the 31K serial link that was really designed for carrying key presses. OK it's slow, but if it works, we can download some sounds, and then save them to floppy for future use.
Finding programs to do the transmitting is pretty easy - I chose Alesis FreeLoader, as it ran nicely on the old Mac I use for running my midi setup. For our purposes, this simply treats any file as a sequence of bytes and sends it over the serial port.
The next task is to take a sound file, and convert it into sample dump format, so that FreeLoader can send it. This is pretty straightforwards so I wrote a SOX module (though it's not in the current release - contact me for more info on this).
With the new version of sox, I can now take any sound file and convert it to sds format. The sample can then be dumped from freeloader into the Akai via midi. This is slow - it can take several minutes for a moderate size sample, and it occasionally fails, but as a way of getting data into an otherwise unsupported sampler its pretty much perfect.
The basics of any keyboard sound set are a Piano and a Hammond. I found some nice piano samples on my Mac (under garage band!), which with a bit of trimming work nicely. However I still couldn't find a good hammond organ sound - especially one which looped nicely, and would fit on a floppy with the piano sounds.
Rather than trying to find a recorded sample, I set about synthesising one - this article and others from the series provided some usefull explanations of the process. It gives the relative pitches of the Hammond drawbars. The other thing we need to know is that each increment on a drawbar is 3dB - a doubling in amplitude.
Armed with this information, it's pretty trivial to write this C program, which can generate the waveform for any drawbar setting. The pitch is set so that 8'=A440. From the command line simply run "hammond 888000000 >h888000000.raw" - that is the program name followed by a set of drawbar settings, redirected into a raw audio file.
We now have a single waveform of a hammond in 16bit mono unsigned linear 44.1KHz. To convert this sds we run "sox -u -w -r44100 xxx.raw xxx.sds", and then download it into the sampler.
At this point I hit a strange snag - the sample is only one waveform (200 samples long!) so we need to loop it, but the Akai doesn't like loops which extend the entire size of the sample. To get round this I concatenated the raw sample with itself three times: "cat xxx.raw xxx.raw xxx.raw >yyy.raw". Our sample is now 3 whole cyles, taking up a massive 600 bytes, and we can set a loop from 400 back to 200 - avoiding the start and end of the sample. Of course because it's synthesised it loops perfectly, and by the nature of the hammond sound is good across the whole keyboard.
If you'd like to avoid the hassle of going through all that here are a few premade samples in wav and sds.
Once the samples were installed and looped they sounded pretty good! However a few teaks can really make them sing. Firstly we need to set up the envelope. Attack, Decay and Release times should all be zero, but the trick is to drop the sustain level down which produces a nice click - lower the level to increase the click.
The next trick is to add percussion - the "ping" at the begining of each note. Included in the samples I made were 00080000 and 000080000. These are the sounds required for percussion. I could have got away without them by using pitch ofset, but it's far easier to just make custom samples for them and loose those 600 bytes. Add a new keygroup, using one of these samples (for hi or low percussion), and set the attack time, and sustain levels to zero. Adjust the decay time, and overall keygroup level to get the exact sound you want.
Finally route the whole thing through the chorus (to taste), and we're done. Of course just like the real thing it'll sound better with a bit of distortion, and a Leslie, but the basic sound is pretty good.
Mission Accomplished! A great hammond sound, and a whole new life for an old sampler. At 600 bytes the samples download via midi in a few seconds, and we can hold hundreds of them for any setting we like in memory, or on a single floppy.
Hopefully this should work with any sampler, so some more people should find it usefull...