X-Git-Url: https://git.aubio.org/?p=aubio.git;a=blobdiff_plain;f=examples%2Faubiotrack.c;h=2224d775aee1a1ffbeb8d5295e93b59b950ebca4;hp=37dc05d570f0986579b8fb01e8dda2fd9a4ec782;hb=2293d6a285c02b1fc13c49420cf38f229478157f;hpb=1b7f3692323a1b5356d9a8977e7efb0fc96ed3a1 diff --git a/examples/aubiotrack.c b/examples/aubiotrack.c index 37dc05d5..2224d775 100644 --- a/examples/aubiotrack.c +++ b/examples/aubiotrack.c @@ -40,18 +40,8 @@ void process_block(fvec_t * ibuf, fvec_t *obuf) { fvec_zeros (obuf); if ( is_beat && !is_silence ) { aubio_wavetable_play ( wavetable ); - /* Send tap over midi output */ - /* Is called without jack use so ask for jack use */ - if (usejack) - { - /* Note on midi clock: Midi clock looks like it is more suitable here, - * but it is send 24 times between the detected bpm which is impossible - * to do since we get here only once per peat. - * Therefore midinote is used as a good workaround. - * Reference: - * http://www.blitter.com/~russtopia/MIDI/~jglatt/tech/midispec/clock.htm */ - send_noteon(0, 0); - } + /* send a midi tap (default to C0) out to the midi output */ + if (usejack) send_noteon(miditap_note, miditap_velo); } else { aubio_wavetable_stop ( wavetable ); } @@ -94,6 +84,9 @@ int main(int argc, char **argv) { examples_common_process((aubio_process_func_t)process_block,process_print); + // send a last note off + send_noteon (miditap_note, 0); + del_aubio_tempo(tempo); del_aubio_wavetable (wavetable); del_fvec(tempo_out);