Chaos Music Composer

Year
1992
Publisher
LK Avalon
Type
Application
Category
Music tracker / composer
Developer
Chaos Software — programmer Janusz Pelc
Requirements
Atari 8-bit computer with disk drive (released on disk and tape); replay routine usable from BASIC, Action! or assembler
Chaos Music Composer editing screen showing pattern, instrument and song panels, 'CMC ver 2.0 (C) 1992 L.K. Avalon'

Overview

Chaos Music Composer (usually shortened to CMC) is a native Atari music editor from Poland. It was written by Janusz Pelc of Chaos Software, and it was released commercially in 1992 by LK Avalon, one of the main Polish publishers of the period. It belongs to the family of trackers that grew up on the Polish scene and sits alongside Music ProTracker, Theta Music Composer (TMC) and later Raster Music Tracker. Its file format, .CMC, is still read by modern Atari music tools.

CMC was built for musicians who needed tunes for their own programs. What you get out of it is a compact module plus a small machine-code replay routine that you can drop into a game, a demo or even an Atari BASIC program. That is why so much Atari software from the 1990s carries CMC music, and why modern tools such as MADS still ship a CMC player. AtariAge regulars still recommend it in the 2020s for anyone who wants to compose on the real machine, though RMT is now the more popular choice.

How it works

A CMC tune is built the tracker way. You define instruments, write short patterns of notes for POKEY's channels, then arrange those patterns into a song order list. The CMC relocator macro shipped with MADS shows how the module is laid out. A table of pattern addresses near the start of the file holds the low bytes and high bytes of up to 64 patterns, and a high byte of $FF marks a pattern as unused. Because those addresses are absolute, a module has to be relocated when you move it somewhere else in memory. If it isn't, it plays garbage, which is a common trap when a CMC file is loaded at a different address from the one it was saved at.

The replay routine (version 2.0 by Janusz Pelc, with a 2.1 revision by Marcin Lewandowski in the MADS examples) begins with three jump vectors:

Offset Entry Use
+0 BASIC entry point for USR calls
+3 INIT set up a module, start or stop a song
+6 PLAY call once per frame (e.g. from a VBI)

Using CMC music from BASIC

You can play CMC music from Atari BASIC with no assembler at all. The editor saves the replay routine (the "REP" file) separately from the tune: press CTRL+M in the editor and it offers an address just after the end of the music, which you can change, then RETURN saves the player. With both files loaded into memory, a song is started and stopped with:

X=USR(REP,SONGNUMBER,CMC) : REM start song (numbered from 1)
X=USR(REP)                : REM stop the music

Here REP is the player's address and CMC the module's address, both converted from hex to decimal for Atari BASIC. Turn the music on, then off, in that order. Starting it twice or stopping it twice can hang the machine. Do not let the module and player overlap each other, or anything important in memory.

In Action! or assembler the usual approach is to call INIT once with the module address, pick a song, then call PLAY every frame, as the MADS _cmc_player_demo.asm does. An Action! example by zbyti hooks the player into the vertical blank interrupt.

Gotchas

  • Converted tunes can sound wrong. One developer who turned CMC files into SAP/LZSS streams found the result came out garbled. Using the real CMC player fixed it. Forum replies pointed to tunes that use the "two-tone filter", which a register-dump player has to handle specially, and to differences in note tables between versions of the composer.
  • Fixed addresses. Players and modules are usually assembled for one address. Relocate the module with the MADS macro, or put player and music together in a single binary at a known address.

Using it today

Two disk dumps with different checksums circulate, one of which loads faster. Untouched original tape and disk images have not been preserved. The surviving dumps boot as ordinary disk images in an emulator. For composing on a PC, AtariAge users point to CMX, a PC version of Chaos Music Composer hosted on SourceForge. To use CMC tunes in new code, the cleanest route is the MADS example folder: it contains the player source, the relocator macro and a demo module (tekkno.cmc).

Credits