Expand description
Constant tables and fixed-point helpers.
Every table is a closed-form function written out as integer literals,
because the runtime has no floating point. The tests recompute each one
from its formula, so a typo in a literal cannot survive. psx-seq-cook gen-tables prints them.
Constants§
- BEND_
OCTAVE_ Q16 - See the module documentation.
- BEND_
TWO_ SEMITONES_ Q16 - See the module documentation.
- DEFAULT_
ENVELOPE - Default envelope used by a channel before any instrument is chosen:
{delay, arg}pairs: ramp to 32000 in one unit, hold 1000, hang. - DEFAULT_
SHORT_ GATE - Default short-note gate table.
- DEFAULT_
SHORT_ VELOCITY - Default short-note velocity table.
- PAN_Q15
- See the module documentation.
- PITCH_
Q16 - See the module documentation.
- Q15_ONE
- Unity in Q15.
- Q16_ONE
- Unity in Q16.
- VIBRATO_
SINE - See the module documentation.
Functions§
- mul_q15
a * bfor two Q15 numbers (each at most 1.0 or a little more).- mul_q16
a * bfor two Q16 numbers, without a 64-bit intermediate. The result must fit inu32.- release_
step_ q24 - Per-update decrement of a releasing envelope, in Q24 (1.0 = 1 << 24), for
release index
idx. Index 0 never decays on its own. The scale is the number of 60 Hz frames a full-scale level takes to fall to zero, times three updates per frame.