Module knyst::wavetable

source ·
Expand description

Wavetable synthesis

Structs

  • Don’t use! This is the same as Phase, but stored in an f32. Last time I benchmarked it was significantly slower. I’m leaving it here so that I, next time I wonder if the floating point phase is indeed slower, can run the benchmark and find out.
  • Wavetable is a standardised wavetable with a buffer of samples, as well as a separate buffer with the difference between the current sample and the next. The wavetable is of size TABLE_SIZE and can be indexed using a WavetablePhase.
  • Fixed point phase, making use of the TABLE_* constants; compatible with Wavetable

Constants

  • Max number of the fractional part of a integer phase. Currently, 16 bits are used for the fractional part.
  • The high mask is used to 0 everything above the table size so that adding further would have the same effect as wrapping.
  • Decides the number of samples per Wavetable buffer, and therefore also the number of high bits used for the phase indexing into the wavetable. With the current u32 phase, this can be maximum 16.
  • TABLE_SIZE is 2^TABLE_POWER