- Timestamp:
- Oct 3, 2016, 8:46:46 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, sampler, yinfft+
- Children:
- 54eba9d
- Parents:
- 61a1e5d
- Location:
- src/notes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/notes/notes.c
r61a1e5d rffd10fb 25 25 #include "notes/notes.h" 26 26 27 #define DEFAULT_NOTES_SILENCE -50. 28 27 29 struct _aubio_notes_t { 28 30 … … 91 93 o->newnote = 0.; 92 94 93 o->silence_threshold = -90.;95 aubio_notes_set_silence(o, DEFAULT_NOTES_SILENCE); 94 96 95 97 return o; … … 98 100 del_aubio_notes(o); 99 101 return NULL; 102 } 103 104 uint_t aubio_notes_set_silence(aubio_notes_t *o, smpl_t silence) 105 { 106 uint_t err = AUBIO_OK; 107 if (aubio_pitch_set_silence(o->pitch, silence) != AUBIO_OK) { 108 err = AUBIO_FAIL; 109 } 110 if (aubio_onset_set_silence(o->onset, silence) != AUBIO_OK) { 111 err = AUBIO_FAIL; 112 } 113 return err; 114 } 115 116 smpl_t aubio_notes_get_silence(const aubio_notes_t *o) 117 { 118 return aubio_pitch_get_silence(o->pitch); 100 119 } 101 120 -
src/notes/notes.h
r61a1e5d rffd10fb 52 52 53 53 \param o note detection object as returned by new_aubio_notes() 54 \param in input signal of size [hop_size] 55 \param out output notes of size [3] ? FIXME 54 \param input input signal of size [hop_size] 55 \param output output notes, fvec of length 3 56 57 The notes output is a vector of length 3 containing: 58 - 0. the midi note value, or 0 if no note was found 59 - 1. the note velocity 60 - 2. the midi note to turn off 56 61 57 62 */ 58 63 void aubio_notes_do (aubio_notes_t *o, const fvec_t * input, fvec_t * output); 64 65 /** set notes detection silence threshold 66 67 \param o notes detection object as returned by new_aubio_notes() 68 \param silence new silence detection threshold 69 70 */ 71 uint_t aubio_notes_set_silence(aubio_notes_t * o, smpl_t silence); 72 73 /** get notes detection silence threshold 74 75 \param o notes detection object as returned by new_aubio_notes() 76 77 \return current silence threshold 78 79 */ 80 smpl_t aubio_notes_get_silence(const aubio_notes_t * o); 59 81 60 82 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.