To actually produce a sound an escape sequence must be sent which defines the sound. The format of this is:
esc S env p vl vr sty ch d f
env -
8bits.
Envelope to use for this sound.
p -
16 bits.
Starting pitch of sound in 1/512 semitones.
vl -
8 bits.
Overall left amplitude (0...255)
vr -
8 bits.
Overall right amplitude (0...255)
sty -
8 bits.
Sound style byte.
ch -
8 bits.
Source for this sound
d -
16 bits.
Duration of this sound in ticks.
f -
8 bits.
Flags byte
b0..b1
b2..b6
b7
When a sound is received it is added to the end of the appropriate queue
(killing the queue first if bit 7 of the flags byte is set). If the queue
is full then there are two courses of action which depend on the state of
the EXOS variable WAIT_SND
. If this is zero then the sound
driver will just wait until there is space in the sound queue, testing
the stop key to allow it to be interrupted. If this EXOS variable is
nonzero then it will return an error code (.SQFUL
) to
the user.