Difference between revisions of "Echo"

From Sega Retro

m
Line 48: Line 48:
  
 
''32 * octave + 2 * semitone + 1''
 
''32 * octave + 2 * semitone + 1''
 +
 +
''' For $08 to $0A ''':
 +
 +
These events do a "note on" at the specified square wave PSG channel. The event is followed by a byte, which indicates which note to play. The value is as follows, where "octave" ranges from 0 to 5 and "semitone" ranges from 0 to 11:
 +
 +
''24 * octave + 2 * semitone''
 +
 +
''' $0Bnn: Note on PSG channel #4 ''':
 +
 +
This event does a "note on" at the noise PSG channel. The event is followed by a byte, which indicates what kind of noise to play. The following values are valid:
 +
 +
        $00 ... Periodic noise, high pitch
 +
        $01 ... Periodic noise, medium pitch
 +
        $02 ... Periodic noise, low pitch
 +
        $03 ... Periodic noise, PSG3 frequency
 +
        $04 ... White noise, high pitch
 +
        $05 ... White noise, medium pitch
 +
        $06 ... White noise, low pitch
 +
        $07 ... White noise, PSG3 frequency
 +
 +
When using values $03 and $07, the third square wave PSG channel controls the noise frequency. You can change this frequency using the events to change the frequency of that channel (usually you'd use event type $3A).
 +
 +
''' $0Cnn: Note on PCM channel ''':
 +
 +
This event does a "note on" at the PCM channel. More specifically, it starts playback of a PCM sample. This event is followed by a byte, that specifies an index in the pointer list indicating where's the sample data. Samples are stored as EWF (Echo Waveform Format).
 +
 +
NOTE: FM channel #6 will be disabled. That channel will be re-enabled when PCM playback is over (either because the waveform is over or because the channel is stopped explicitly).
  
 
== Links / Download ==
 
== Links / Download ==
  
 
[http://github.net/sikthehedgehog/echo GitHub repository for Echo], including docs, source, binaries, etc.
 
[http://github.net/sikthehedgehog/echo GitHub repository for Echo], including docs, source, binaries, etc.

Revision as of 04:03, 17 November 2011

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.

Event list

Note on

Event Description
$00nn Note on FM channel #1
$01nn Note on FM channel #2
$02nn Note on FM channel #3
$04nn Note on FM channel #4
$05nn Note on FM channel #5
$06nn Note on FM channel #6
$08nn Note on PSG channel #1
$09nn Note on PSG channel #2
$0Ann Note on PSG channel #3
$0Bnn Note on PSG channel #4
$0Cnn Note on PCM channel

For $00 to $06 :

These events do a "note on" at the specified FM channel. The event is followed by a byte, which indicates which note to play. The value is as follows, where "octave" ranges from 0 to 7 and "semitone" ranges from 0 to 11:

32 * octave + 2 * semitone + 1

For $08 to $0A :

These events do a "note on" at the specified square wave PSG channel. The event is followed by a byte, which indicates which note to play. The value is as follows, where "octave" ranges from 0 to 5 and "semitone" ranges from 0 to 11:

24 * octave + 2 * semitone

$0Bnn: Note on PSG channel #4 :

This event does a "note on" at the noise PSG channel. The event is followed by a byte, which indicates what kind of noise to play. The following values are valid:

       $00 ... Periodic noise, high pitch
       $01 ... Periodic noise, medium pitch
       $02 ... Periodic noise, low pitch
       $03 ... Periodic noise, PSG3 frequency
       $04 ... White noise, high pitch
       $05 ... White noise, medium pitch
       $06 ... White noise, low pitch
       $07 ... White noise, PSG3 frequency

When using values $03 and $07, the third square wave PSG channel controls the noise frequency. You can change this frequency using the events to change the frequency of that channel (usually you'd use event type $3A).

$0Cnn: Note on PCM channel :

This event does a "note on" at the PCM channel. More specifically, it starts playback of a PCM sample. This event is followed by a byte, that specifies an index in the pointer list indicating where's the sample data. Samples are stored as EWF (Echo Waveform Format).

NOTE: FM channel #6 will be disabled. That channel will be re-enabled when PCM playback is over (either because the waveform is over or because the channel is stopped explicitly).

Links / Download

GitHub repository for Echo, including docs, source, binaries, etc.