void process_block(fvec_t * ibuf, fvec_t *obuf) { aubio_tempo_do (tempo, ibuf, tempo_out); is_beat = fvec_get_sample (tempo_out, 0); //smpl_t bpm = aubio_tempo_get_bpm(tempo); //uint_t last_beat = aubio_tempo_get_last(tempo); aubio_pitch_do (pitch, ibuf, pitch_out); smpl_t freq = fvec_get_sample(pitch_out, 0); if (silence_threshold != -90.) is_silence = aubio_silence_detection(ibuf, silence_threshold); fvec_zeros (obuf); if ( is_beat && !is_silence ) { samples_per_beat = total_frames - my_last_beat; my_last_beat = total_frames; aubio_wavetable_play ( wavetable ); } else { aubio_wavetable_stop ( wavetable ); } if (mix_input) aubio_wavetable_do (wavetable, ibuf, obuf); else aubio_wavetable_do (wavetable, obuf, obuf); rgb_music_iterate(my_last_beat, samples_per_beat, total_frames, freq); total_frames += hop_size; }
void process_block(fvec_t * ibuf, fvec_t * obuf) { fvec_zeros(obuf); aubio_pitch_do (o, ibuf, pitch); smpl_t freq = fvec_read_sample(pitch, 0); aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) ); aubio_wavetable_set_freq ( wavetable, freq ); if (mix_input) aubio_wavetable_do (wavetable, ibuf, obuf); else aubio_wavetable_do (wavetable, obuf, obuf); }
void process_block(fvec_t * ibuf, fvec_t *obuf) { aubio_tempo_do (tempo, ibuf, tempo_out); is_beat = fvec_get_sample (tempo_out, 0); if (silence_threshold != -90.) is_silence = aubio_silence_detection(ibuf, silence_threshold); fvec_zeros (obuf); if ( is_beat && !is_silence ) { aubio_wavetable_play ( wavetable ); } else { aubio_wavetable_stop ( wavetable ); } if (mix_input) aubio_wavetable_do (wavetable, ibuf, obuf); else aubio_wavetable_do (wavetable, obuf, obuf); }