Changeset f3617e7 for examples/aubiopitch.c
- Timestamp:
- Nov 4, 2013, 3:28:24 PM (10 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:
- e97d0b3
- Parents:
- 509e8f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiopitch.c
r509e8f9 rf3617e7 24 24 25 25 aubio_pitch_t *o; 26 aubio_wavetable_t *wavetable; 26 27 fvec_t *pitch; 27 28 … … 39 40 /* block loop */ 40 41 aubio_pitch_do (o, ibuf, pitch); 41 if (fvec_read_sample(pitch, 0)) { 42 for (pos = 0; pos < overlap_size; pos++){ 43 // TODO, play sine at this freq 44 } 42 smpl_t freq = fvec_read_sample(pitch, 0); 43 smpl_t amp = powf(10., aubio_db_spl(ibuf)*.05 ); 44 aubio_wavetable_set_amp ( wavetable, amp ); 45 if (freq != 0.0) { 46 aubio_wavetable_set_freq ( wavetable, freq ); 45 47 } else { 46 fvec_zeros (obuf);48 aubio_wavetable_set_freq ( wavetable, 0.0 ); 47 49 } 50 aubio_wavetable_do (wavetable, obuf, obuf); 48 51 /* end of block loop */ 49 52 pos = -1; /* so it will be zero next j loop */ … … 67 70 pitch = new_fvec (1); 68 71 72 wavetable = new_aubio_wavetable (samplerate, overlap_size); 73 aubio_wavetable_play ( wavetable ); 74 69 75 examples_common_process(aubio_process,process_print); 70 76 71 77 del_aubio_pitch (o); 78 del_aubio_wavetable (wavetable); 72 79 del_fvec (pitch); 73 80
Note: See TracChangeset
for help on using the changeset viewer.