Changeset 340cb93 for examples/utils.c
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.