Changes in src/onset/onset.c [3e17aed:0b9a02a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/onset.c
r3e17aed r0b9a02a 48 48 smpl_t isonset = 0; 49 49 smpl_t wasonset = 0; 50 uint_t i;51 50 aubio_pvoc_do (o->pv,input, o->fftgrain); 52 51 aubio_specdesc_do (o->od,o->fftgrain, o->of); 53 /*if (usedoubled) {54 aubio_specdesc_do (o2,fftgrain, onset2);55 onset->data[0][0] *= onset2->data[0][0];56 }*/57 52 aubio_peakpicker_do(o->pp, o->of, onset); 58 for (i = 0; i < input->channels; i++) { 59 isonset = onset->data[i][0]; 60 wasonset = o->wasonset->data[i][0]; 53 isonset = onset->data[0]; 54 wasonset = o->wasonset->data[0]; 61 55 if (isonset > 0.) { 62 56 if (aubio_silence_detection(input, o->silence)==1) { … … 74 68 wasonset++; 75 69 } 76 o->wasonset->data[i][0] = wasonset; 77 onset->data[i][0] = isonset; 78 } 70 o->wasonset->data[0] = wasonset; 71 onset->data[0] = isonset; 79 72 return; 80 73 } … … 98 91 /* Allocate memory for an onset detection */ 99 92 aubio_onset_t * new_aubio_onset (char_t * onset_mode, 100 uint_t buf_size, uint_t hop_size, uint_t channels, uint_tsamplerate)93 uint_t buf_size, uint_t hop_size, uint_t samplerate) 101 94 { 102 95 aubio_onset_t * o = AUBIO_NEW(aubio_onset_t); … … 105 98 o->minioi = 4; 106 99 o->silence = -70; 107 o->wasonset = new_fvec(1 , channels);100 o->wasonset = new_fvec(1); 108 101 o->samplerate = samplerate; 109 102 o->hop_size = hop_size; 110 o->pv = new_aubio_pvoc(buf_size, hop_size , channels);111 o->pp = new_aubio_peakpicker( channels);103 o->pv = new_aubio_pvoc(buf_size, hop_size); 104 o->pp = new_aubio_peakpicker(); 112 105 aubio_peakpicker_set_threshold (o->pp, o->threshold); 113 o->od = new_aubio_specdesc(onset_mode,buf_size ,channels);114 o->fftgrain = new_cvec(buf_size ,channels);115 o->of = new_fvec(1 , channels);106 o->od = new_aubio_specdesc(onset_mode,buf_size); 107 o->fftgrain = new_cvec(buf_size); 108 o->of = new_fvec(1); 116 109 /*if (usedoubled) { 117 o2 = new_aubio_specdesc(onset_type2,buffer_size ,channels);118 onset2 = new_fvec(1 , channels);110 o2 = new_aubio_specdesc(onset_type2,buffer_size); 111 onset2 = new_fvec(1); 119 112 }*/ 120 113 return o;
Note: See TracChangeset
for help on using the changeset viewer.