octrivial

sine oscillator with controls to create "weird" scalings. "octaving" sets the octave-size. Normal would be 2 (octave is twice as high as the precious octave). Setting it to 3 will force each next "octave" to be 3 times higher. "steps" sets the amount of steps/notes each octave will have. notes follow equal temperament based on the settings set by these controls.
Author: Remco van der Most
License: BSD
Github: sss/osc/octrivial.axo

Inlets

int32 pitch

Outlets

frac32buffer out

Parameters

frac32.s.map pitch

frac32.s.map.pitch root

int32 octaving

int32 steps

Declaration
uint32_t phase;
Control Rate
int32_t freq;
MTOFEXTENDED(param_root, freq)

float32_t pitch = param_pitch + (inlet_pitch << 21);
pitch = powf(param_octaving, pitch / (param_steps << 21));
freq = pitch * freq;
Audio Rate
phase += freq;
int32_t sine;
SINE2TINTERP(phase, sine)
outlet_out = sine >> 5;

Privacy

© 2024 Zrna Research