Stocker, 1-bit music engine for ZX Spectrum 48K

The engine was made in a few days during heavy smoke in Moscow from wildfires. Imagine - all the windows and doors are closed for days, 40 Celcius outside, 35 inside. I've felt myself like a stocker in a steamshop, and this gave name for the engine. It was made as a part of Magic Tokens game, but of course with intention for general use.

The engine has two channels of tone, with few levels of 'volume' each. The channels volume controlled by envelopes, much like instrument envelopes in AY trackers. The volumes are updated 50 times per second. Frequency range is five octaves, the envelopes can restart or not restart with every new note. Not restarting the envelope is useful for things like hand-made arpeggio. The engine also allow to use some detune from current note, to produce phasing effects, and supports pitch slide up and down. Speed of playing is measured in 1/50 second. There are four synthesized drums as well, they interrupts the tone channels and affects to the speed.

There is no editor for the engine. Instead, you prepare music using Vortex Tracker II. Once you have made a song, you convert it to ASM file using special tool, and then you can compile it with assembler to get file runnable in emulator or on actual ZX. You will hear something while working on the music, but final sound will be different of course, so you will have to make series of tweaks.

In the Vortex Tracker, first two channels are tone channels, and third channel is for drums. You can use notes C-1..B-5, instruments 1..15. Only volume in the instruments is matter, however, you should not forget to turn T in order to hear some sound in the VTII. You can use 1 in a column after the instrument number to mark notes which should not restart the envelope. You also can use 1.NN, 2.NN and 3.NN effects in the effects column. 1 is slide down, 2 is slide up, 3 is detune. You should use non-zero values to turn the effect on, and zero (empty) values to turn it off, because otherwise it will act to the end of the song.

N-O IR.. E.PP

N=Note
O=Octave
I=Instrument
R=Restart envelope
E=Effect
PP=Parameter of the effect

For drums, you should use instruments H,I,J,K - kick drum, hat, snare drum, and tom respectively.

Check example file (music.txt) to get the idea better.


After you have made something in VTII, save it in it's usual format (plain text). Use vt2txconv.exe tool to convert it into assembly code - just drag and drop the text file on the vt2txconv. Now you need to compile the player to listen what you have done. Don't worry, you don't need any programming knowledge for this at all. Download SjAsmPlus from http://sjasmplus.sourceforge.net/ and put sjasmplus.exe into the same folder where other .asm files are located. Put ASM file from the converter into the same folder and rename it to music.asm. Run compile.bat, and you will get music.tap with your music and loader, so you can load it in any emulators, like any other program.

If you need to use the engine in your software, check player.asm for additional information. You are completely free to use and modify it in any way.