Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

Module tables

Module tables 

Source
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 * b for two Q15 numbers (each at most 1.0 or a little more).
mul_q16
a * b for two Q16 numbers, without a 64-bit intermediate. The result must fit in u32.
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.