From Sega Retro
Echo is a new sound-engine for the Sega Mega Drive created by Sik. It's Z80-based and allows full control over the sound hardware. Its purpose is to provide a free, open-source possibility to implement music and sound effects in programs, demos or games developed for the system. It is currently in beta state, albeit functional for the most part. Assembly, C with SGDK, and BasiEgaXorz interfaces are available, so nothing stops you from using this sound engine to its full potential!
Its current version number is 1.0
It was used and tested in a few projects already, such as
Several smaller demos and music players have been created with Echo.
Specifications and features
Echo Stream Format (ESF)
The Echo Stream Format (ESF) ìs a headerless music and sound effect format used by Echo. It contains commands and instructions that are read by Echo and passed onto the sound hardware. It has an extensive amount of commands / instructions, and thereby has its own article describing it.
Echo Waveform Format (EWF)
The Echo Waveform Format (EWF) is the format used by PCM samples. There isn't much to it, as PCM data is stored as unsigned 8-bit, at 10650Hz mono. The bytes specifying the waveform data contain values ranging from $00 to $FE. When a byte with value $FF is found, the end of the waveform is indicated.
Echo Instrument Format (EIF)
The Echo Instrument Format is the format used for FM instruments in Echo. EIF instruments are essentially raw dumps of the YM2612 registers. They consist of 29 bytes, where each byte belongs to a different YM2612 register. The registers are stored in the following order (assuming the first FM channel):
$B0 -- Algorithm and feedback $30, $34, $38, $3C -- Multiplier and detune $40, $44, $48, $4C -- Total level $50, $54, $58, $5C -- Attack rate $60, $64, $68, $6C -- Decay rate $70, $74, $78, $7C -- Sustain rate $80, $84, $88, $8C -- Release rate and sustain level $90, $94, $98, $9C -- SSG-EG
Some bits are unused and ignored by the YM2612. In an EIF instrument, they *must* be 0, since Echo will rely on this for optimization purposes.
Echo Envelope Format (EEF)
The Echo Envelope Format (EEF) is the format used to describe volume envelopes for the PSG channels in Echo. This format was kind of an afterthought. Later it may be improved to provide at least some kind of RLE-like compression, but for now, this is it.
EEF instruments consist of a list of volume levels. Each byte represents a different volume level, and the value ranges from $00 (loudest) to $0F (quietest). Each byte represents one tick (i.e. 1/60th of a second), and looping is possible. The start of the loop is marked by a byte with value $FE, while the end of the loop is marked by a byte with value $FF. There must be at least one volume byte between them or Echo will hang. To make a non-looping PSG instrument, just put the last volume value inside the loop.
Also, since PSG instruments are required to use PSG channels and many people do not want to mess with them at all, here's a flat PSG instrument (i.e. no envelope): <code=asm>
pcm2ewf is a program that converts raw 8-bit mono PCM files to the slightly different format used by Echo (EWF, see above). It can be downloaded from Sik's Tools repository.
xm2esf is a program written by Oerg866. At the moment it is the only program available and working that can produce ESF streams. It is, in addition to that, by far the most advanced Mega Drive music tool available today that produces real-time usable output (ESF). To enable the user to enjoy the comfort of any XM tracker he is used to, the program takes XM files as input, and outputs a stream readable by Echo. The tool is very advanced as it supports all major XM effects, such as:
Hint: keep in mind that to make the ticks per row ("speed" in some trackers, default is 6) match an Echo tick's length, set "Tempo" to 150!
Xm2esf uses an inputfile called xif. It is short for XM information file. It contains parameters, channels, instrument assignments, channel transposes, channel volumes, noise type, etc. taken into account when converting. Distributed with xm2esf is a program called xm2eifgui. It is a frontend for creating the necessary XIF files for conversion.
To compare: xm2smps, xm3smps and xm4smps were not able to use any XM effects other than Dxx. This is why music can be created much faster and easier with echo than it can be done in any other accessible (be it free or reverse engineered) sound engine today.
For now, this program runs on Microsoft Windows, Linux and FreeBSD (some modifications might be necessary, as this has not been tested but theoretically should be completely possible). Binaries are included for Win32 and Linux in the github repository, whereas FreeBSD users have to compile the program first.
Xm2esf is currently in release candidate stage, the latest version being v1.00 RC3 as of October 2, 2012, and is available from GitHub.
Esfopt is a small program written in C++ by Oerg866. It takes an ESF stream as an input file, and outputs an optimized file.
It can be downloaded from GitHub
Links / Download