URL : http://newcoleco.dev-fr.org/p4197/20...ayer-demo.html

Note : Maybe it's not the appropriate forum section to talk about this project, but it refers to ColecoVision and a possibility to use it for enjoyment, experimentation, a serious Coleco programming. Try this software in your favorite browser (need flash player 9).


Hello Coleco fans and Coleco programmers,


Before starting, I want to mention that you can play CV Space Fury intro music with this Flash application, included as a sample. I mention that because I'm pretty sure there are fans of the commander Space Fury around here.

This project is about generating a constant audio streaming in a Flash application based on the ColecoVision sounds, generated by SN76489 sound chip and ColecoVision BIOS also called OS7.

It's written in ActionScript 3, compiled with Flex 4+, and playable with Flash Player 9+. I've done the project to simulate the Coleco BIOS sound routines, that's why I've included a bunch of audio samples to try like Space Fury Intro, Boulder Dash theme music, and much more. Please note that there is no Z80 emulation here, so it's not the Coleco BIOS sound routines running, but something that simulates them.

The application interface is composed of a bunch of buttons, most of them are audio samples using sound codes from existing ColecoVision games. There is a big text box where you can copy-paste sound codes, or write your own codes, giving you the possiblity to experiment the Colecovision sound format and maybe see if you can compose your own Coleco music, note by note, in the same way I've done the music for ColecoVision GhostBlaster (it took 3 days). Please note that the parser is stupid, and all the values are considered coded in hexadecimal format.

This is not a music composer, but I guess talented programmers can re-use this project to make their own Flash ColecoVision Music composer. It's not even a chiptune application, but it can play various sounds and musics from classic ColecoVision games and also help to code your own sound effects and musics.

For more information about the ColecoVision sound format, I'll try to simply here, but please refer to the technical documentation.

* WARNING * TECHNICAL INFORMATION * WARNING *

Hexadecimal values - 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.

SN76849 - channel 0 : noise channel, channel 1-3 : tone channels. all in square shaped wave, no triangle wave like for the Commodore SID sound chip.

noise : periodic noise (like a buzzer or bass guitare), white noise (like tv static noise).

base code : noise = 0x00, tone 1 = 0x40, tone 2 = 0x80, tone 3 = 0xc0.

end of data : base code + 0x10. example - 0x50 = tone 1 end of data.

repeat : base code + 0x18. example - 0x58 = tone 1 repeat (useful for background music loops and a looping sound effects like a flying helicopter).

silence : base code + 0x20 + duration ( = up to 0x1f, except tone 3 is limited to 0x1e ). example - 0xfe = tone 3, muted during 0x1e ( = 30 cycles, 0.5 sec in NTSC ).

simple note : base code, lower period part, attenuation and high period part, duration. example - 0x40, 0x34, 0x52, 0x06 = tone 1 simple note, period 0x234, attenuation 5, duration 6 ( = 6 cycles, 0.1 sec in NTSC ).

simple noise note : base code, null, attenuation and noise code, duration. example - 0x00, 0x00, 0x52, 0x06 = simple noise note, periodic noise 2, attenuation 5, duration 6 ( = 6 cycles, 0.1 sec in NTSC ).

note with volume swept effect : base code + 2, lower period part, attenuation and high period part, duration, attenuation incrementation and number of attenuation steps, length of attenuation steps and length of the first attenuation step. example - 0x42, 0x34, 0x61, 0x09, 0x13, 0x25 = tone 1, period 0x134, attenuation starts at 6, duration 9, 3 attenuation steps, first step at level 6 during 5 cycles, then two more steps at level 7 and 8 during 2 cycles each.

noise with volume swept effect : noise base code + 2, attenuation and noise code, duration, attenuation incrementation and number of attenuation steps, length of attenuation steps and length of the first attenuation step. example - 0x02, 0x61, 0x09, 0x13, 0x25 = noise, periodic noise 1, attenuation starts at 6, duration 9, 3 attenuation steps, first step at level 6 during 5 cycles, then two more steps at level 7 and 8 during 2 cycles each.

There are much more to know, but I'll stop here.

The following formula gives you period code to write for the tone channels, based on the sound frequency you want.

Frequency = 3.579MHz / ( 32 * Period );

Period value = Math.around ( 3579545 / 32 * Frequency );

A4 (frequency 440Hz), Period = around ( 3579545 / 32 * 440 ) = approximately 254 in decimal, 0x0fe in hexadecimal.