Command 0x24: Set volume scale
Sets the volume scale of the BGM channels.
Syntax
0x24, byte scale
Parameters
| Parameter | Type | Contents |
|---|---|---|
| scale | byte | Volume scale (%, initial value 100) |
Remarks
Sets the volume scale ($04B6). On key on of a BGM channel, the channel volume multiplied by scale / 100 (capped at 127) is written to the DSP. It does not affect the volume of SE channels.
The volume scale is shared by all channels.
This command takes no time to process, and the following event is read within the same tick.
Note
- The calculation is done by an 8-bit division of (absolute value of the volume × scale) by 100, so if scale is too large, the result may be incorrect.