Command 0x09: Pitch bend (negative direction)
Sets a pitch bend. Uses the change amount with its sign inverted.
Syntax
0x09, byte delay, byte interval, byte count, sbyte delta, byte reverse
Parameters
| Parameter | Type | Description |
|---|---|---|
| delay | byte | Time until the first change (interval if 0) |
| interval | byte | Interval between changes |
| count | byte | Total number of changes |
| delta | sbyte | Pitch change per step. Set with its sign inverted |
| reverse | byte | Number of initial changes applied with the sign inverted |
Description
On every key-on, enables a pitch bend that changes the pitch by a fixed amount at fixed intervals (effect enable flag bit0). The setting applies to all subsequent notes until cancelled with command 0x0A.
The pitch bend works as follows.
- Initialize each counter at key-on.
- If delay is not 0, make the first change when the delay time has elapsed. If delay is 0, make the first change when the interval time has elapsed.
- After that, change the pitch every interval. For the first reverse changes, apply the change amount with its sign inverted; after that, apply the change amount as is.
- End the pitch bend once it has changed count times (including the reverse changes).
The change amount is added directly to the DSP pitch register value (14 bits, $1000 = original pitch), not to the note number. Therefore, the same change amount produces a smaller change in musical pitch the higher the note.
Effect times are counted in timer periods independent of tempo (about 7.5ms by default; changeable with command 0x2A). For details, see Sequence data structure.
This command takes no time to process; the following event is read within the same tick.
The only difference from command 0x08 is that delta is set with its sign inverted.
Note
- If count is 0, it changes 256 times.
- It changes the same pitch value as vibrato, so if both are enabled their effects add up.
- On a BGM channel under SE interrupt, no key-on is performed, so the counters are not initialized.
See also
Sequence data structure
Command 0x08
Command 0x0A
Command 0x26
Command 0x27