- Timestamp:
- Aug 12, 2015, 4:15:39 PM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- df7be43
- Parents:
- a90e9d4
- Location:
- examples
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiomfcc.c
ra90e9d4 r340cb93 41 41 void process_print (void) 42 42 { 43 /* output times in seconds and extracted mfccs */ 44 outmsg("%f\t",blocks*hop_size/(float)samplerate); 45 fvec_print(mfcc_out); 43 /* output times in selected format */ 44 print_time (blocks * hop_size); 45 outmsg ("\t"); 46 /* output extracted mfcc */ 47 fvec_print (mfcc_out); 46 48 } 47 49 -
examples/aubioonset.c
ra90e9d4 r340cb93 50 50 { 51 51 if ( is_onset ) { 52 outmsg ("%f\n", aubio_onset_get_last_s (o) ); 52 if (strcmp (time_format, "samples") == 0) { 53 outmsg ("%d\n", aubio_onset_get_last (o) ); 54 } else if (strcmp (time_format, "ms") == 0) { 55 outmsg ("%f\n", aubio_onset_get_last_ms (o) ); 56 } else { 57 outmsg ("%f\n", aubio_onset_get_last_s (o) ); 58 } 53 59 } 54 60 } -
examples/aubiopitch.c
ra90e9d4 r340cb93 47 47 { 48 48 smpl_t pitch_found = fvec_get_sample(pitch, 0); 49 outmsg("%f %f\n",(blocks)50 *hop_size/(float)samplerate, pitch_found);49 print_time(blocks * hop_size); 50 outmsg(" %f\n", pitch_found); 51 51 } 52 52 -
examples/aubioquiet.c
ra90e9d4 r340cb93 39 39 void process_print (void) { 40 40 int curblocks = (blocks - 4) > 0 ? blocks - 4 : 0; 41 if (issilence == -1) { 42 outmsg("NOISY: %f\n",curblocks*hop_size/(float)samplerate); 43 } else if (issilence == 2) { 44 outmsg("QUIET: %f\n",curblocks*hop_size/(float)samplerate); 41 if (issilence == -1 || issilence == 2) { 42 if (issilence == -1) { 43 outmsg ("NOISY: "); 44 } else { // if (issilence == 2) { 45 outmsg ("QUIET: "); 46 } 47 print_time (curblocks * hop_size); 48 outmsg ("\n"); 45 49 } 46 50 } -
examples/aubiotrack.c
ra90e9d4 r340cb93 51 51 void process_print (void) { 52 52 if ( is_beat && !is_silence ) { 53 outmsg("%f\n", aubio_tempo_get_last_s(tempo) ); 53 print_time (aubio_tempo_get_last (tempo)); 54 outmsg ("\n"); 54 55 } 55 56 } -
examples/parse_args.h
ra90e9d4 r340cb93 35 35 extern char_t * pitch_unit; 36 36 extern smpl_t pitch_tolerance; 37 // time stuff 38 extern char_t * time_format; 37 39 // tempo stuff 38 40 extern char_t * tempo_method; … … 91 93 " -s --silence select silence threshold\n" 92 94 " a value in dB, for instance -70, or -100; default=-90\n" 95 " -T --time-format select time values output format\n" 96 " (samples, ms, seconds) default=seconds\n" 93 97 #ifdef PROG_HAS_OUTPUT 94 98 " -m --mix-input mix input signal with output signal\n" … … 123 127 "p:u:l:" 124 128 #endif /* PROG_HAS_PITCH */ 129 "T:" 125 130 "s:mf"; 126 131 int next_option; … … 148 153 #endif /* PROG_HAS_PITCH */ 149 154 {"silence", 1, NULL, 's'}, 155 {"time-format", 1, NULL, 'T'}, 150 156 {"mix-input", 0, NULL, 'm'}, 151 157 {"force-overwrite", 0, NULL, 'f'}, … … 201 207 case 'l': 202 208 pitch_tolerance = (smpl_t) atof (optarg); 209 break; 210 case 'T': 211 time_format = optarg; 203 212 break; 204 213 case 's': /* silence threshold */ -
examples/utils.c
ra90e9d4 r340cb93 48 48 char_t * pitch_method = "default"; 49 49 smpl_t pitch_tolerance = 0.0; // will be set if != 0. 50 // time stuff 51 char_t * time_format = "seconds"; 50 52 // tempo stuff 51 53 char_t * tempo_method = "default"; … … 197 199 #endif 198 200 if (velo == 0) { 199 outmsg ("%f\n", blocks * hop_size / (float) samplerate); 200 } else { 201 outmsg ("%f\t%f\t", mpitch, blocks * hop_size / (float) samplerate); 202 } 203 } 204 201 print_time (blocks * hop_size); 202 outmsg ("\n"); 203 } else { 204 outmsg ("%f\t", mpitch); 205 print_time (blocks * hop_size); 206 outmsg ("\t"); 207 } 208 } 209 210 void print_time (uint_t time_in_samples) { 211 /* output times in selected format */ 212 if (strcmp (time_format, "samples") == 0) { 213 outmsg ("%d", time_in_samples); 214 } else if (strcmp (time_format, "ms") == 0) { 215 outmsg ("%f", 1000. * time_in_samples / (float) samplerate); 216 } else { 217 outmsg ("%f", time_in_samples / (float) samplerate); 218 } 219 } -
examples/utils.h
ra90e9d4 r340cb93 57 57 void process_block (fvec_t *ibuf, fvec_t *obuf); 58 58 void process_print (void); 59 60 void print_time (uint_t samples);
Note: See TracChangeset
for help on using the changeset viewer.