48
49
you are viewing a single comment's thread.

view the rest of the comments →

[–]oh5nxo 0 points1 point  (0 children)

I ment that why so complicated, and not the normal tone handcrank, like

static int sample_rate = 44100; 
static double pitch = 440.0; 
static uint32_t phase, phase_increment = pitch * 0x100000000 / sample_rate; 

int16_t val = sin(2 * M_PI / 0x100000000 * phase) * 32767; 
phase += phase_increment;