Changeset 9562f08
- Timestamp:
- Jul 22, 2016, 9:30:31 PM (8 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:
- 65fc06f
- Parents:
- f280ebd
- Location:
- examples
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubionotes.c
rf280ebd r9562f08 27 27 28 28 aubio_notes_t *notes; 29 uint_t lastnote = 0;29 smpl_t lastmidi = 0.; 30 30 31 31 void process_block (fvec_t *ibuf, fvec_t *obuf) … … 34 34 // did we get a note off? 35 35 if (obuf->data[2] != 0) { 36 send_noteon(obuf->data[2], 0); 36 lastmidi = aubio_freqtomidi (obuf->data[2]) + .5; 37 send_noteon(lastmidi, 0); 37 38 } 38 39 // did we get a note on? 39 40 if (obuf->data[0] != 0) { 40 send_noteon(obuf->data[0], obuf->data[1]);41 lastnote = (uint_t) floor(obuf->data[0]);41 lastmidi = aubio_freqtomidi (obuf->data[0]) + .5; 42 send_noteon(lastmidi, obuf->data[1]); 42 43 } 43 44 } … … 68 69 69 70 // send a last note off 70 send_noteon (last note, 0);71 send_noteon (lastmidi, 0); 71 72 72 73 del_aubio_notes (notes); -
examples/utils.c
rf280ebd r9562f08 182 182 183 183 void 184 send_noteon (int pitch, int velo) 185 { 186 smpl_t mpitch = floor (aubio_freqtomidi (pitch) + .5); 184 send_noteon (smpl_t pitch, smpl_t velo) 185 { 187 186 #ifdef HAVE_JACK 188 187 jack_midi_event_t ev; … … 192 191 if (usejack) { 193 192 ev.buffer[2] = velo; 194 ev.buffer[1] = mpitch;193 ev.buffer[1] = pitch; 195 194 if (velo == 0) { 196 195 ev.buffer[0] = 0x80; /* note off */ … … 205 204 outmsg ("\n"); 206 205 } else { 207 outmsg ("%f\t", mpitch);206 outmsg ("%f\t", pitch); 208 207 print_time (blocks * hop_size); 209 208 outmsg ("\t"); -
examples/utils.h
rf280ebd r9562f08 64 64 65 65 typedef void (aubio_print_func_t) (void); 66 void send_noteon ( int pitch, int velo);66 void send_noteon (smpl_t pitch, smpl_t velo); 67 67 68 68 /** common process function */
Note: See TracChangeset
for help on using the changeset viewer.