QChan v2 beeper music engine by Shiru (shiru@mail.ru) 03'11


Features

The engine allows to use four channels of tone with global volumes, per-pattern tempo and decays, with interrupting drum channel. Drums are not use ROM data or samples. Overall design of the player is intended to be compact and easy to use, to allow it's use in games.

Note that this is version 2 of the engine. Version 1 had major bug in the converter, and some optimizations weren't made.


How to make music

There is no dedicated editor for the engine. You can make music using any tracker with XM format support. You have to follow certain limitations. You can hear sound while editing using template module provided, it has sounds sampled from the engine, so the sound is somewhat similar to the end result, although not much. After you have made a song, you can convert it to an assembly source file with data in needed format.

You can use patterns with arbitrary lengths in your song. Module should have no less than four channels. You can loop the order list to any position. You can use both tempo and BPM to change speed.

To set global volumes, use volume columns on the very first row played, i.e. on the first row of the first pattern in the order list. Internal volumes are 1..16, you can use usual #01..40 in tracker, it will be recalculated as needed. The volumes can't be changed in middle of a song, although you may want to set it for every note to hear it correctly in the tracker.

To set speed, you can use global tempo and BPM settings, or use Fxx effects on the first row of a pattern. Every pattern can have own speed. The speed will be recalculated as needed, to closest possible in the player.

You can use notes C-1 to B-5 and note stop. You can set decay values for every channel of every pattern. Just use instrument 1..8 (fastest to slowest decay), but don't change it in the middle of pattern, it will be ignored.

You can put drums to any channel, only one drum sound can be played on a row. You can't control drums volume.


Music data format

Four bytes of global volumes 1..15
List of 16-bit pointers to patterns, LSB/MSB
0
16-bit pointer to loop point (in the list of the patterns above)
Patterns data


Pattern data format

Tempo 1..255, four bytes of decays (valid decay values are 1,3,7,15,31,63,127,255)
Four bytes of note numbers per row, optional fifth byte is 128 for end of the pattern, or 129 and greater for a drum

Note number 0 is empty, 2..120 are C-1 to B-5 (only even numbers, 2,4,6..), 122 is note cut