While working on a bigger project (minesweeper) I found out I needed to experiment with sound. I originally wanted a sound engine for sound effects like explosions etc. running in the background. After some tries I found out that the VM is too slow for really good sounding effects or my code is too slow. But as a result I got a sound engine which can play tunes fully in the background. Since other programmers may need such thing, too I decided to release it.
The engine uses timer1 low and high. The high part is used to generate interrupts, so interrupt vector $2b is no longer free. Since the sound of the VM depends on the processor clock you should not change it. The support tools assume sub-clock mode, but that can be changed, although I never really tested it myself, because RC clock is unstabilized and main clock needs too much power. Additionally main clock is too fast to use timer1 in 8 bit mode and nearly everything has to be rewritten for 16 bit mode.
To make it easier to try the sound engine I have put together a small demo program. It just plays a tune while displaying a blank screen and leaves game mode when finished playing. This demo needs a real VM since softvms can't play sound yet (Version 1.8).
For people without a local installation of perl I created a special online converter, just enter the local filename of a .note file into the file field below and press "Convert". With most browsers you will have to use a .txt or even .html extension for your note file, it will be marked as binary by your browser otherwise. After pressing "Convert" you will get either an error message telling you what is wrong with your file or a text file containing source code for aslc86k containing your tune.
A modified version of this sound-engine is built into Alienfighter. The main change is that it queues tunes and plays them one after the other. Additionally there is another mode of operation: the playing routine can be called manually. This allows the use of sound in a timing calibrated loop running in RC clock.
The sound-engine tools now can handle pauses with the pseudo note p. I have added important information about the hardware limitations into the README file. The VM code has not changed.