Command 0x0D: Vibrato (no delay)
Sets vibrato without delay.
Syntax
0x0D, byte length, byte rate, sbyte depth
Parameters
| Parameter | Type | Description |
|---|---|---|
| length | byte | Turnaround interval (number of steps) |
| rate | byte | Time per step |
| depth | sbyte | Pitch change per step (sign is ignored) |
Description
On every key-on, enables a vibrato that varies the pitch in a triangle wave (effect enable flag bit1). The setting applies to all subsequent notes until cancelled with command 0x0E.
The vibrato works as follows.
- At key-on, make depth positive and initialize the number of steps until turnaround to length ÷ 2 (rounded down).
- Wait until the delay time has elapsed.
- Every rate, add depth to the pitch (1 step).
- When the number of steps until turnaround reaches 0, invert the sign of depth and reset the step count to length.
Therefore the pitch varies within ±(depth × length ÷ 2) around the original pitch. The change amount is added directly to the DSP pitch register value.
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.
Same as command 0x0F with delay set to 0.
Note
- Specify 2 or more for length. If 1 is specified, the number of steps until the first turnaround becomes 0, and it does not turn around until 256 steps later.
- If length is odd, the center of the variation is offset from the original pitch.
- It changes the same pitch value as pitch bend, so if both are enabled their effects add up.