Command 0x02: Set channel volume

Sets the channel’s left and right volume.

Syntax

0x02, sbyte left, sbyte right

Parameters

ParameterTypeDescription
leftsbyteLeft volume
rightsbyteRight volume

Description

Sets the channel’s left volume ($0254+x) and right volume ($0264+x). The new volume is written to the DSP at the next key-on.
If the mono flag (CPU command $FC) is set, the left and right volumes are added with 8-bit unsigned addition and divided by 2 (the 9-bit result including the carry is shifted right), and that value is set for both left and right. If a negative volume is involved, the result is not a signed average.

This command takes no time to process; the following event is read within the same tick.

Note

  • If tremolo (command 0x2F) is enabled, the volume is restored to the tremolo base volume at key-on, so the volume set by this command is not reflected.

See also

Sequence data structure
Command 0x11
Command 0x28