Skip to content

Instantly share code, notes, and snippets.

@nwillems
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nwillems/0a2fa623c8bda7f5464c to your computer and use it in GitHub Desktop.
Save nwillems/0a2fa623c8bda7f5464c to your computer and use it in GitHub Desktop.
[JACKAudio] Processing stuffs
int process(jack_nframes_t nframes, void *arg){
jack_default_audio_sample_t *out;
jack_default_audio_sample_t inp[nframes];
int i =0;
out = jack_port_get_buffer(output_port, nframes);
for(i =0; i < nframes; i++){
int t = state;
//char tmp = (t * (t >> 5 | t >> 8)) >> (t >> 16);
int tmp = ((p0 * t)/50) * 5 & ((((p1*t)/50)>>7)| (((p2*t*3)/50)&(t*4>>10)));
//int tmp = (state * 5 & state >> 7) | (state * 3 & state >> 10);
inp[i] = (tmp / 127.f) -1.0;
state++;
}
//for(i=0; i<nframes; i++)
memcpy(out, inp, sizeof(jack_default_audio_sample_t) * nframes);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment