* actual onset */
if (isonset && output_filename == NULL) {
if(frames >= 4) {
- outmsg("%f\n",(frames-4)*overlap_size/(float)samplerate);
- } else if (frames < 4) {
+ outmsg("%f\n",(frames-frames_delay)*overlap_size/(float)samplerate);
+ } else if (frames < frames_delay) {
outmsg("%f\n",0.);
}
}
}
int main(int argc, char **argv) {
+ frames_delay = 4;
examples_common_init(argc,argv);
examples_common_process(aubio_process,process_print);
examples_common_del();
int lash_main (void);
void save_data (void);
void restore_data(lash_config_t * lash_config);
+void flush_process(aubio_process_func_t process_func, aubio_print_func_t print);
pthread_t lash_thread;
#endif /* LASH_SUPPORT */
int verbose = 0;
int usejack = 0;
int usedoubled = 1;
+int frames_delay = 0;
/* energy,specdiff,hfc,complexdomain,phase */
}
debug("Processed %d frames of %d samples.\n", frames, buffer_size);
+
+ flush_process(process_func, print);
del_aubio_sndfile(file);
if (output_filename != NULL)
}
}
+void flush_process(aubio_process_func_t process_func, aubio_print_func_t print){
+ uint i,j;
+ for (i = 0; i < channels; i++) {
+ for (j = 0; j < obuf->length; j++) {
+ fvec_write_sample(obuf,0.,i,j);
+ }
+ }
+ for (i = 0; i < frames_delay; i++) {
+ process_func(ibuf->data, obuf->data, overlap_size);
+ print();
+ }
+}
void send_noteon(int pitch, int velo)
extern int verbose;
extern int usejack;
extern int usedoubled;
+extern int frames_delay;
extern unsigned int median;
extern const char * output_filename;
extern const char * input_filename;