#define AUBIO_UNSTABLE 1 // for fvec_median
#include "utils.h"
#define PROG_HAS_PITCH 1
#define PROG_HAS_ONSET 1
#define PROG_HAS_JACK 1
#include "parse_args.h"
static void
if(median){
note_append(note_buffer, new_pitch);
}
if (curlevel == 1.) {
if (median) isready = 0;
send_noteon(curnote,0);
} else {
if (median) {
isready = 1;
} else {
send_noteon(curnote,0);
send_noteon(new_pitch,127+(int)floor(curlevel));
curnote = new_pitch;
}
}
} else {
if (median) {
if (isready > 0)
isready++;
if (isready == median)
{
send_noteon(curnote,0);
newnote = get_note(note_buffer, note_buffer2);
curnote = newnote;
if (curnote>45){
send_noteon(curnote,127+(int)floor(curlevel));
}
}
}
}
}
static void
process_print (void) {
}
void
{
for (i = 0; i < note_buffer->
length - 1; i++) {
note_buffer->
data[i] = note_buffer->
data[i + 1];
}
note_buffer->
data[note_buffer->
length - 1] = curnote;
return;
}
{
for (i = 0; i < note_buffer->
length; i++) {
note_buffer2->
data[i] = note_buffer->
data[i];
}
return fvec_median (note_buffer2);
}
int main(int argc, char **argv) {
examples_common_init(argc,argv);
verbmsg ("using source: %s at %dHz\n", source_uri, samplerate);
verbmsg ("onset method: %s, ", onset_method);
verbmsg ("buffer_size: %d, ", buffer_size);
verbmsg ("hop_size: %d, ", hop_size);
verbmsg ("threshold: %f\n", onset_threshold);
verbmsg ("pitch method: %s, ", pitch_method);
verbmsg ("buffer_size: %d, ", buffer_size * 4);
verbmsg ("hop_size: %d, ", hop_size);
verbmsg ("tolerance: %f\n", pitch_tolerance);
pitch =
new_aubio_pitch (pitch_method, buffer_size * 4, hop_size, samplerate);
if (median) {
}
examples_common_process((aubio_process_func_t)process_block, process_print);
send_noteon (curnote, 0);
if (median) {
}
examples_common_del();
return 0;
}