- Timestamp:
- Dec 7, 2013, 5:22:21 AM (11 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:
- 61ecd1a
- Parents:
- 466dff3
- Location:
- examples
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubionotes.c
r466dff3 r3da8187 23 23 #define PROG_HAS_PITCH 1 24 24 #define PROG_HAS_ONSET 1 25 #define PROG_HAS_JACK 1 26 // TODO add PROG_HAS_OUTPUT 25 27 #include "parse_args.h" 26 28 -
examples/aubioonset.c
r466dff3 r3da8187 21 21 #include "utils.h" 22 22 #define PROG_HAS_ONSET 1 23 #define PROG_HAS_OUTPUT 1 24 #define PROG_HAS_JACK 1 23 25 #include "parse_args.h" 24 26 … … 36 38 aubio_wavetable_stop ( wavetable ); 37 39 } 38 aubio_wavetable_do (wavetable, obuf, obuf); 40 if (mix_input) 41 aubio_wavetable_do (wavetable, ibuf, obuf); 42 else 43 aubio_wavetable_do (wavetable, obuf, obuf); 39 44 } 40 45 -
examples/aubiopitch.c
r466dff3 r3da8187 21 21 #include "utils.h" 22 22 #define PROG_HAS_PITCH 1 23 #define PROG_HAS_OUTPUT 1 24 #define PROG_HAS_JACK 1 23 25 #include "parse_args.h" 24 26 … … 33 35 smpl_t freq = fvec_read_sample(pitch, 0); 34 36 aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) ); 35 if (freq != 0.0) {36 aubio_wavetable_set_freq ( wavetable, freq ); 37 } else {38 aubio_wavetable_ set_freq ( wavetable, 0.0);39 }40 aubio_wavetable_do (wavetable, obuf, obuf);37 aubio_wavetable_set_freq ( wavetable, freq ); 38 39 if (mix_input) 40 aubio_wavetable_do (wavetable, ibuf, obuf); 41 else 42 aubio_wavetable_do (wavetable, obuf, obuf); 41 43 } 42 44 -
examples/aubiotrack.c
r466dff3 r3da8187 21 21 #include "utils.h" 22 22 #define PROG_HAS_TEMPO 1 23 #define PROG_HAS_OUTPUT 1 24 #define PROG_HAS_JACK 1 23 25 #include "parse_args.h" 24 26 … … 39 41 aubio_wavetable_stop ( wavetable ); 40 42 } 41 aubio_wavetable_do (wavetable, obuf, obuf); 43 if (mix_input) 44 aubio_wavetable_do (wavetable, ibuf, obuf); 45 else 46 aubio_wavetable_do (wavetable, obuf, obuf); 42 47 } 43 48 -
examples/parse_args.h
r466dff3 r3da8187 63 63 " -h --help display this message\n" 64 64 " -v --verbose be verbose\n" 65 #ifdef HAVE_JACK65 #ifdef PROG_HAS_JACK 66 66 " -j --jack use Jack\n" 67 67 #endif 68 68 " -i --input input type\n" 69 #ifdef PROG_HAS_OUTPUT 69 70 " -o --output output type\n" 71 #endif 70 72 " -r --samplerate select samplerate\n" 71 73 " -B --bufsize set buffer size\n" … … 81 83 #endif /* PROG_HAS_PITCH */ 82 84 " -s --silence select silence threshold\n" 85 #ifdef PROG_HAS_OUTPUT 83 86 " -m --mix-input mix input signal with output signal\n" 87 #endif 84 88 ); 85 89 exit (exit_code); … … 90 94 { 91 95 const char *options = "hv" 92 #ifdef HAVE_JACK 96 "i:r:B:H:" 97 #ifdef PROG_HAS_JACK 93 98 "j" 94 #endif 95 "i:o:r:B:H:" 99 #endif /* PROG_HAS_JACK */ 100 #ifdef PROG_HAS_OUTPUT 101 "o:" 102 #endif /* PROG_HAS_OUTPUT */ 96 103 #ifdef PROG_HAS_ONSET 97 104 "O:t:" … … 105 112 {"help", 0, NULL, 'h'}, 106 113 {"verbose", 0, NULL, 'v'}, 107 #ifdef HAVE_JACK108 {"jack", 0, NULL, 'j'},109 #endif110 114 {"input", 1, NULL, 'i'}, 111 {"output", 1, NULL, 'o'},112 115 {"samplerate", 1, NULL, 'r'}, 113 116 {"bufsize", 1, NULL, 'B'}, 114 117 {"hopsize", 1, NULL, 'H'}, 118 #ifdef PROG_HAS_JACK 119 {"jack", 0, NULL, 'j'}, 120 #endif /* PROG_HAS_JACK */ 121 #ifdef PROG_HAS_OUTPUT 122 {"output", 1, NULL, 'o'}, 123 #endif /* PROG_HAS_OUTPUT */ 115 124 #ifdef PROG_HAS_ONSET 116 125 {"onset", 1, NULL, 'O'}, … … 191 200 while (next_option != -1); 192 201 202 // if unique, use the non option argument as the source 193 203 if ( source_uri == NULL ) { 194 204 if (argc - optind == 1) { … … 203 213 } 204 214 205 if (source_uri != NULL) { 206 debug ("Input file : %s\n", source_uri); 207 } else if (source_uri != NULL && sink_uri != NULL) { 208 debug ("Input file : %s\n", source_uri); 209 debug ("Output file : %s\n", sink_uri); 210 } else { 215 // if no source, show a message 216 if (source_uri == NULL) { 211 217 #if HAVE_JACK 212 debug ("Jack input output\n");218 verbmsg("No input source given, using jack\n"); 213 219 usejack = 1; 214 220 #else -
examples/utils.c
r466dff3 r3da8187 186 186 #endif 187 187 if (velo == 0) { 188 outmsg ("%f\n", blocks * hop_size / (float) samplerate);188 verbmsg ("%f\n", blocks * hop_size / (float) samplerate); 189 189 } else { 190 outmsg ("%f\t%f\t", mpitch, blocks * hop_size / (float) samplerate);190 verbmsg ("%f\t%f\t", mpitch, blocks * hop_size / (float) samplerate); 191 191 } 192 192 }
Note: See TracChangeset
for help on using the changeset viewer.