Changeset 4621cd6 for examples/aubiopitch.c
- Timestamp:
- Dec 4, 2009, 1:46:40 AM (14 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:
- aea235c
- Parents:
- c17a0ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiopitch.c
rc17a0ee r4621cd6 27 27 28 28 static int aubio_process(smpl_t **input, smpl_t **output, int nframes) { 29 unsigned int i; /*channels*/30 29 unsigned int j; /*frames*/ 31 30 for (j=0;j<(unsigned)nframes;j++) { 32 31 if(usejack) { 33 for (i=0;i<channels;i++) { 34 /* write input to datanew */ 35 fvec_write_sample(ibuf, input[i][j], i, pos); 36 /* put synthnew in output */ 37 output[i][j] = fvec_read_sample(obuf, i, pos); 38 } 32 /* write input to datanew */ 33 fvec_write_sample(ibuf, input[0][j], pos); 34 /* put synthnew in output */ 35 output[0][j] = fvec_read_sample(obuf, pos); 39 36 } 40 37 /*time for fft*/ … … 42 39 /* block loop */ 43 40 aubio_pitch_do (o, ibuf, pitch); 44 if (fvec_read_sample(pitch, 0 , 0)) {41 if (fvec_read_sample(pitch, 0)) { 45 42 for (pos = 0; pos < overlap_size; pos++){ 46 43 // TODO, play sine at this freq … … 59 56 static void process_print (void) { 60 57 if (!verbose && usejack) return; 61 smpl_t pitch_found = fvec_read_sample(pitch, 0 , 0);58 smpl_t pitch_found = fvec_read_sample(pitch, 0); 62 59 outmsg("%f %f\n",(frames) 63 60 *overlap_size/(float)samplerate, pitch_found); … … 67 64 examples_common_init(argc,argv); 68 65 69 o = new_aubio_pitch (onset_mode, buffer_size, overlap_size, channels, 70 samplerate); 71 pitch = new_fvec (1, channels); 66 o = new_aubio_pitch (onset_mode, buffer_size, overlap_size, samplerate); 67 pitch = new_fvec (1); 72 68 73 69 examples_common_process(aubio_process,process_print);
Note: See TracChangeset
for help on using the changeset viewer.