History

src/spectral/specdesc.{c,h}: rename aubio_onsetdetection to aubio_specdesc

Paul Brossier committed 17 years ago

Commit 31907fd1 parent bafe71d9 files · +94 −94Browse files

Unified · Split

9 files
  1. python/aubio/aubioclass.py +5 −5
  2. src/Makefile.am +1 −1
  3. src/aubio.h +1 −1
  4. src/onset/onset.c +7 −7
  5. src/onset/onset.h +1 −1
  6. src/spectral/specdesc.c +44 −44
  7. src/spectral/specdesc.h +6 −6
  8. src/tempo/tempo.c +7 −7
  9. tests/src/test-onsetdetection.c +22 −22
python/aubio/aubioclass.py+5−5
@@ -68,13 +68,13 @@ class pvoc: · 67 unmodified lines
6868 aubio_pvoc_rdo(self.pv,tc(),tf())
6969
7070 class onsetdetection:
71− """ class for aubio_onsetdetection """
71+ """ class for aubio_specdesc """
7272 def __init__(self,mode,buf,chan):
73− self.od = new_aubio_onsetdetection(mode,buf,chan)
73+ self.od = new_aubio_specdesc(mode,buf,chan)
7474 def do(self,tc,tf):
75− aubio_onsetdetection_do(self.od,tc(),tf())
75+ aubio_specdesc_do(self.od,tc(),tf())
7676 def __del__(self):
77− del_aubio_onsetdetection(self.od)
77+ del_aubio_specdesc(self.od)
7878
7979 class peakpick:
8080 """ class for aubio_peakpicker """
@@ -91,7 +91,7 @@ class peakpick: · 10 unmodified lines
9191 del_aubio_peakpicker(self.pp)
9292
9393 class onsetpick:
94− """ superclass for aubio_pvoc + aubio_onsetdetection + aubio_peakpicker """
94+ """ superclass for aubio_pvoc + aubio_specdesc + aubio_peakpicker """
9595 def __init__(self,bufsize,hopsize,channels,myvec,threshold,mode='dual',derivate=False,dcthreshold=0):
9696 self.myfft = cvec(bufsize,channels)
9797 self.pv = pvoc(bufsize,hopsize,channels)
src/Makefile.am+1−1
@@ -22,6 +22,7 @@ nobase_pkginclude_HEADERS = \ · 21 unmodified lines
2222 spectral/phasevoc.h \
2323 spectral/fft.h \
2424 spectral/tss.h \
25+ spectral/specdesc.h \
2526 spectral/spectral_centroid.h \
2627 pitch/pitch.h \
2728 pitch/pitchmcomb.h \
@@ -30,7 +31,6 @@ nobase_pkginclude_HEADERS = \ · 2 unmodified lines
3031 pitch/pitchfcomb.h \
3132 pitch/pitchyinfft.h \
3233 onset/onset.h \
33− onset/onsetdetection.h \
3434 onset/peakpick.h \
3535 tempo/tempo.h \
3636 tempo/beattracking.h
src/aubio.h+1−1
@@ -165,6 +165,7 @@ extern "C" · 164 unmodified lines
165165 #include "spectral/fft.h"
166166 #include "spectral/phasevoc.h"
167167 #include "spectral/mfcc.h"
168+#include "spectral/specdesc.h"
168169 #include "pitch/pitch.h"
169170 #include "onset/onset.h"
170171 #include "tempo/tempo.h"
@@ -182,7 +183,6 @@ extern "C" · 11 unmodified lines
182183 #include "pitch/pitchyinfft.h"
183184 #include "pitch/pitchschmitt.h"
184185 #include "pitch/pitchfcomb.h"
185−#include "onset/onsetdetection.h"
186186 #include "spectral/spectral_centroid.h"
187187 #include "onset/peakpick.h"
188188 #include "tempo/beattracking.h"
src/onset/onset.c+7−7
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include "aubio_priv.h"
2222 #include "fvec.h"
2323 #include "cvec.h"
24−#include "onset/onsetdetection.h"
24+#include "spectral/specdesc.h"
2525 #include "spectral/phasevoc.h"
2626 #include "onset/peakpick.h"
2727 #include "mathutils.h"
@@ -30,7 +30,7 @@ · 2 unmodified lines
3030 /** structure to store object state */
3131 struct _aubio_onset_t {
3232 aubio_pvoc_t * pv; /**< phase vocoder */
33− aubio_onsetdetection_t * od; /**< onset detection */
33+ aubio_specdesc_t * od; /**< onset detection */
3434 aubio_peakpicker_t * pp; /**< peak picker */
3535 cvec_t * fftgrain; /**< phase vocoder output */
3636 fvec_t * of; /**< onset detection function */
@@ -48,9 +48,9 @@ void aubio_onset_do (aubio_onset_t *o, fvec_t * input, fvec_t * onset) · 11 unmodified lines
4848 smpl_t wasonset = 0;
4949 uint_t i;
5050 aubio_pvoc_do (o->pv,input, o->fftgrain);
51− aubio_onsetdetection_do (o->od,o->fftgrain, o->of);
51+ aubio_specdesc_do (o->od,o->fftgrain, o->of);
5252 /*if (usedoubled) {
53− aubio_onsetdetection_do (o2,fftgrain, onset2);
53+ aubio_specdesc_do (o2,fftgrain, onset2);
5454 onset->data[0][0] *= onset2->data[0][0];
5555 }*/
5656 aubio_peakpicker_do(o->pp, o->of, onset);
@@ -108,11 +108,11 @@ aubio_onset_t * new_aubio_onset (char_t * onset_mode, · 51 unmodified lines
108108 o->pv = new_aubio_pvoc(buf_size, hop_size, channels);
109109 o->pp = new_aubio_peakpicker(channels);
110110 aubio_peakpicker_set_threshold (o->pp, o->threshold);
111− o->od = new_aubio_onsetdetection(onset_mode,buf_size,channels);
111+ o->od = new_aubio_specdesc(onset_mode,buf_size,channels);
112112 o->fftgrain = new_cvec(buf_size,channels);
113113 o->of = new_fvec(1, channels);
114114 /*if (usedoubled) {
115− o2 = new_aubio_onsetdetection(onset_type2,buffer_size,channels);
115+ o2 = new_aubio_specdesc(onset_type2,buffer_size,channels);
116116 onset2 = new_fvec(1 , channels);
117117 }*/
118118 return o;
@@ -120,7 +120,7 @@ aubio_onset_t * new_aubio_onset (char_t * onset_mode, · 1 unmodified line
120120
121121 void del_aubio_onset (aubio_onset_t *o)
122122 {
123− del_aubio_onsetdetection(o->od);
123+ del_aubio_specdesc(o->od);
124124 del_aubio_peakpicker(o->pp);
125125 del_aubio_pvoc(o->pv);
126126 del_fvec(o->of);
src/onset/onset.h+1−1
@@ -46,7 +46,7 @@ typedef struct _aubio_onset_t aubio_onset_t; · 45 unmodified lines
4646
4747 /** create onset detection object
4848
49− \param onset_mode onset detection type as specified in onsetdetection.h
49+ \param onset_mode onset detection type as specified in specdesc.h
5050 \param buf_size buffer size for phase vocoder
5151 \param hop_size hop size for phase vocoder
5252 \param channels number of channels
src/spectral/specdesc.crenamed from src/onset/onsetdetection.c+44−44
@@ -22,20 +22,20 @@ · 21 unmodified lines
2222 #include "fvec.h"
2323 #include "cvec.h"
2424 #include "spectral/fft.h"
25+#include "spectral/specdesc.h"
2526 #include "mathutils.h"
2627 #include "utils/hist.h"
27−#include "onset/onsetdetection.h"
2828
2929 /** Energy based onset detection function
3030
3131 This function calculates the local energy of the input spectral frame.
3232
33− \param o onset detection object as returned by new_aubio_onsetdetection()
33+ \param o onset detection object as returned by new_aubio_specdesc()
3434 \param fftgrain input spectral frame
3535 \param onset output onset detection function
3636
3737 */
38−void aubio_onsetdetection_energy(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
38+void aubio_specdesc_energy(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
3939 /** High Frequency Content onset detection function
4040
4141 This method computes the High Frequency Content (HFC) of the input spectral
@@ -44,24 +44,24 @@ void aubio_onsetdetection_energy(aubio_onsetdetection_t *o, cvec_t * fftgrain, f · 2 unmodified lines
4444 Paul Masri. Computer modeling of Sound for Transformation and Synthesis of
4545 Musical Signal. PhD dissertation, University of Bristol, UK, 1996.
4646
47− \param o onset detection object as returned by new_aubio_onsetdetection()
47+ \param o onset detection object as returned by new_aubio_specdesc()
4848 \param fftgrain input spectral frame
4949 \param onset output onset detection function
5050
5151 */
52−void aubio_onsetdetection_hfc(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
52+void aubio_specdesc_hfc(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
5353 /** Complex Domain Method onset detection function
5454
5555 Christopher Duxbury, Mike E. Davies, and Mark B. Sandler. Complex domain
5656 onset detection for musical signals. In Proceedings of the Digital Audio
5757 Effects Conference, DAFx-03, pages 90-93, London, UK, 2003.
5858
59− \param o onset detection object as returned by new_aubio_onsetdetection()
59+ \param o onset detection object as returned by new_aubio_specdesc()
6060 \param fftgrain input spectral frame
6161 \param onset output onset detection function
6262
6363 */
64−void aubio_onsetdetection_complex(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
64+void aubio_specdesc_complex(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
6565 /** Phase Based Method onset detection function
6666
6767 Juan-Pablo Bello, Mike P. Davies, and Mark B. Sandler. Phase-based note onset
@@ -69,60 +69,60 @@ void aubio_onsetdetection_complex(aubio_onsetdetection_t *o, cvec_t * fftgrain, · 1 unmodified line
6969 Conference on Acoustics Speech and Signal Processing, pages 441­444,
7070 Hong-Kong, 2003.
7171
72− \param o onset detection object as returned by new_aubio_onsetdetection()
72+ \param o onset detection object as returned by new_aubio_specdesc()
7373 \param fftgrain input spectral frame
7474 \param onset output onset detection function
7575
7676 */
77−void aubio_onsetdetection_phase(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
77+void aubio_specdesc_phase(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
7878 /** Spectral difference method onset detection function
7979
8080 Jonhatan Foote and Shingo Uchihashi. The beat spectrum: a new approach to
8181 rhythm analysis. In IEEE International Conference on Multimedia and Expo
8282 (ICME 2001), pages 881­884, Tokyo, Japan, August 2001.
8383
84− \param o onset detection object as returned by new_aubio_onsetdetection()
84+ \param o onset detection object as returned by new_aubio_specdesc()
8585 \param fftgrain input spectral frame
8686 \param onset output onset detection function
8787
8888 */
89−void aubio_onsetdetection_specdiff(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
89+void aubio_specdesc_specdiff(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
9090 /** Kullback-Liebler onset detection function
9191
9292 Stephen Hainsworth and Malcom Macleod. Onset detection in music audio
9393 signals. In Proceedings of the International Computer Music Conference
9494 (ICMC), Singapore, 2003.
9595
96− \param o onset detection object as returned by new_aubio_onsetdetection()
96+ \param o onset detection object as returned by new_aubio_specdesc()
9797 \param fftgrain input spectral frame
9898 \param onset output onset detection function
9999
100100 */
101−void aubio_onsetdetection_kl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
101+void aubio_specdesc_kl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
102102 /** Modified Kullback-Liebler onset detection function
103103
104104 Paul Brossier, ``Automatic annotation of musical audio for interactive
105105 systems'', Chapter 2, Temporal segmentation, PhD thesis, Centre for Digital
106106 music, Queen Mary University of London, London, UK, 2006.
107107
108− \param o onset detection object as returned by new_aubio_onsetdetection()
108+ \param o onset detection object as returned by new_aubio_specdesc()
109109 \param fftgrain input spectral frame
110110 \param onset output onset detection function
111111
112112 */
113−void aubio_onsetdetection_mkl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
113+void aubio_specdesc_mkl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
114114 /** Spectral Flux
115115
116116 Simon Dixon, Onset Detection Revisited, in ``Proceedings of the 9th
117117 International Conference on Digital Audio Effects'' (DAFx-06), Montreal,
118118 Canada, 2006.
119119
120− \param o onset detection object as returned by new_aubio_onsetdetection()
120+ \param o onset detection object as returned by new_aubio_specdesc()
121121 \param fftgrain input spectral frame
122122 \param onset output onset detection function
123123
124124 */
125−void aubio_onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
125+void aubio_specdesc_specflux(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
126126
127127 /** onsetdetection types */
128128 typedef enum {
@@ -135,13 +135,13 @@ typedef enum { · 6 unmodified lines
135135 aubio_onset_mkl, /**< modified Kullback Liebler */
136136 aubio_onset_specflux, /**< spectral flux */
137137 aubio_onset_default = aubio_onset_hfc, /**< default mode, set to hfc */
138−} aubio_onsetdetection_type;
138+} aubio_specdesc_type;
139139
140140 /** structure to store object state */
141−struct _aubio_onsetdetection_t {
142− aubio_onsetdetection_type onset_type; /**< onset detection type */
143− /** Pointer to aubio_onsetdetection_<type> function */
144− void (*funcpointer)(aubio_onsetdetection_t *o,
141+struct _aubio_specdesc_t {
142+ aubio_specdesc_type onset_type; /**< onset detection type */
143+ /** Pointer to aubio_specdesc_<type> function */
144+ void (*funcpointer)(aubio_specdesc_t *o,
145145 cvec_t * fftgrain, fvec_t * onset);
146146 smpl_t threshold; /**< minimum norm threshold for phase and specdiff */
147147 fvec_t *oldmag; /**< previous norm vector */
@@ -153,7 +153,7 @@ struct _aubio_onsetdetection_t { · 5 unmodified lines
153153
154154
155155 /* Energy based onset detection function */
156−void aubio_onsetdetection_energy (aubio_onsetdetection_t *o UNUSED,
156+void aubio_specdesc_energy (aubio_specdesc_t *o UNUSED,
157157 cvec_t * fftgrain, fvec_t * onset) {
158158 uint_t i,j;
159159 for (i=0;i<fftgrain->channels;i++) {
@@ -165,7 +165,7 @@ void aubio_onsetdetection_energy (aubio_onsetdetection_t *o UNUSED, · 5 unmodified lines
165165 }
166166
167167 /* High Frequency Content onset detection function */
168−void aubio_onsetdetection_hfc(aubio_onsetdetection_t *o UNUSED,
168+void aubio_specdesc_hfc(aubio_specdesc_t *o UNUSED,
169169 cvec_t * fftgrain, fvec_t * onset){
170170 uint_t i,j;
171171 for (i=0;i<fftgrain->channels;i++) {
@@ -178,7 +178,7 @@ void aubio_onsetdetection_hfc(aubio_onsetdetection_t *o UNUSED, · 6 unmodified lines
178178
179179
180180 /* Complex Domain Method onset detection function */
181−void aubio_onsetdetection_complex (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset) {
181+void aubio_specdesc_complex (aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset) {
182182 uint_t i, j;
183183 uint_t nbins = fftgrain->length;
184184 for (i=0;i<fftgrain->channels; i++) {
@@ -203,7 +203,7 @@ void aubio_onsetdetection_complex (aubio_onsetdetection_t *o, cvec_t * fftgrain, · 18 unmodified lines
203203
204204
205205 /* Phase Based Method onset detection function */
206−void aubio_onsetdetection_phase(aubio_onsetdetection_t *o,
206+void aubio_specdesc_phase(aubio_specdesc_t *o,
207207 cvec_t * fftgrain, fvec_t * onset){
208208 uint_t i, j;
209209 uint_t nbins = fftgrain->length;
@@ -235,7 +235,7 @@ void aubio_onsetdetection_phase(aubio_onsetdetection_t *o, · 25 unmodified lines
235235 }
236236
237237 /* Spectral difference method onset detection function */
238−void aubio_onsetdetection_specdiff(aubio_onsetdetection_t *o,
238+void aubio_specdesc_specdiff(aubio_specdesc_t *o,
239239 cvec_t * fftgrain, fvec_t * onset){
240240 uint_t i, j;
241241 uint_t nbins = fftgrain->length;
@@ -266,7 +266,7 @@ void aubio_onsetdetection_specdiff(aubio_onsetdetection_t *o, · 24 unmodified lines
266266 /* Kullback Liebler onset detection function
267267 * note we use ln(1+Xn/(Xn-1+0.0001)) to avoid
268268 * negative (1.+) and infinite values (+1.e-10) */
269−void aubio_onsetdetection_kl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset){
269+void aubio_specdesc_kl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset){
270270 uint_t i,j;
271271 for (i=0;i<fftgrain->channels;i++) {
272272 onset->data[i][0] = 0.;
@@ -282,7 +282,7 @@ void aubio_onsetdetection_kl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_ · 9 unmodified lines
282282 /* Modified Kullback Liebler onset detection function
283283 * note we use ln(1+Xn/(Xn-1+0.0001)) to avoid
284284 * negative (1.+) and infinite values (+1.e-10) */
285−void aubio_onsetdetection_mkl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset){
285+void aubio_specdesc_mkl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset){
286286 uint_t i,j;
287287 for (i=0;i<fftgrain->channels;i++) {
288288 onset->data[i][0] = 0.;
@@ -295,7 +295,7 @@ void aubio_onsetdetection_mkl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec · 6 unmodified lines
295295 }
296296
297297 /* Spectral flux */
298−void aubio_onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset){
298+void aubio_specdesc_specflux(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset){
299299 uint_t i, j;
300300 for (i=0;i<fftgrain->channels;i++) {
301301 onset->data[i][0] = 0.;
@@ -309,7 +309,7 @@ void aubio_onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, · 7 unmodified lines
309309
310310 /* Generic function pointing to the choosen one */
311311 void
312−aubio_onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain,
312+aubio_specdesc_do (aubio_specdesc_t *o, cvec_t * fftgrain,
313313 fvec_t * onset) {
314314 o->funcpointer(o,fftgrain,onset);
315315 }
@@ -317,12 +317,12 @@ aubio_onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain, · 1 unmodified line
317317 /* Allocate memory for an onset detection
318318 * depending on the choosen type, allocate memory as needed
319319 */
320−aubio_onsetdetection_t *
321−new_aubio_onsetdetection (char_t * onset_mode,
320+aubio_specdesc_t *
321+new_aubio_specdesc (char_t * onset_mode,
322322 uint_t size, uint_t channels){
323− aubio_onsetdetection_t * o = AUBIO_NEW(aubio_onsetdetection_t);
323+ aubio_specdesc_t * o = AUBIO_NEW(aubio_specdesc_t);
324324 uint_t rsize = size/2+1;
325− aubio_onsetdetection_type onset_type;
325+ aubio_specdesc_type onset_type;
326326 if (strcmp (onset_mode, "energy") == 0)
327327 onset_type = aubio_onset_energy;
328328 else if (strcmp (onset_mode, "specdiff") == 0)
@@ -388,28 +388,28 @@ new_aubio_onsetdetection (char_t * onset_mode, · 59 unmodified lines
388388
389389 switch(onset_type) {
390390 case aubio_onset_energy:
391− o->funcpointer = aubio_onsetdetection_energy;
391+ o->funcpointer = aubio_specdesc_energy;
392392 break;
393393 case aubio_onset_hfc:
394− o->funcpointer = aubio_onsetdetection_hfc;
394+ o->funcpointer = aubio_specdesc_hfc;
395395 break;
396396 case aubio_onset_complex:
397− o->funcpointer = aubio_onsetdetection_complex;
397+ o->funcpointer = aubio_specdesc_complex;
398398 break;
399399 case aubio_onset_phase:
400− o->funcpointer = aubio_onsetdetection_phase;
400+ o->funcpointer = aubio_specdesc_phase;
401401 break;
402402 case aubio_onset_specdiff:
403− o->funcpointer = aubio_onsetdetection_specdiff;
403+ o->funcpointer = aubio_specdesc_specdiff;
404404 break;
405405 case aubio_onset_kl:
406− o->funcpointer = aubio_onsetdetection_kl;
406+ o->funcpointer = aubio_specdesc_kl;
407407 break;
408408 case aubio_onset_mkl:
409− o->funcpointer = aubio_onsetdetection_mkl;
409+ o->funcpointer = aubio_specdesc_mkl;
410410 break;
411411 case aubio_onset_specflux:
412− o->funcpointer = aubio_onsetdetection_specflux;
412+ o->funcpointer = aubio_specdesc_specflux;
413413 break;
414414 default:
415415 break;
@@ -418,7 +418,7 @@ new_aubio_onsetdetection (char_t * onset_mode, · 2 unmodified lines
418418 return o;
419419 }
420420
421−void del_aubio_onsetdetection (aubio_onsetdetection_t *o){
421+void del_aubio_specdesc (aubio_specdesc_t *o){
422422 switch(o->onset_type) {
423423 /* for both energy and hfc, only fftgrain->norm is required */
424424 case aubio_onset_energy:
src/spectral/specdesc.hrenamed from src/onset/onsetdetection.h+6−6
@@ -40,17 +40,17 @@ extern "C" { · 39 unmodified lines
4040 #endif
4141
4242 /** onsetdetection structure */
43−typedef struct _aubio_onsetdetection_t aubio_onsetdetection_t;
43+typedef struct _aubio_specdesc_t aubio_specdesc_t;
4444 /** execute onset detection function on a spectral frame
4545
4646 Generic function to compute onset detection.
4747
48− \param o onset detection object as returned by new_aubio_onsetdetection()
48+ \param o onset detection object as returned by new_aubio_specdesc()
4949 \param fftgrain input signal spectrum as computed by aubio_pvoc_do
5050 \param onset output vector (one sample long, to send to the peak picking)
5151
5252 */
53−void aubio_onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
53+void aubio_specdesc_do (aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
5454 /** creation of an onset detection object
5555
5656 \param type onset detection mode
@@ -58,13 +58,13 @@ void aubio_onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec · 1 unmodified line
5858 \param channels number of input channels
5959
6060 */
61−aubio_onsetdetection_t * new_aubio_onsetdetection(char_t * onset_mode, uint_t buf_size, uint_t channels);
61+aubio_specdesc_t * new_aubio_specdesc(char_t * onset_mode, uint_t buf_size, uint_t channels);
6262 /** deletion of an onset detection object
6363
64− \param o onset detection object as returned by new_aubio_onsetdetection()
64+ \param o onset detection object as returned by new_aubio_specdesc()
6565
6666 */
67−void del_aubio_onsetdetection(aubio_onsetdetection_t *o);
67+void del_aubio_specdesc(aubio_specdesc_t *o);
6868
6969 #ifdef __cplusplus
7070 }
src/tempo/tempo.c+7−7
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include "aubio_priv.h"
2222 #include "fvec.h"
2323 #include "cvec.h"
24−#include "onset/onsetdetection.h"
24+#include "spectral/specdesc.h"
2525 #include "tempo/beattracking.h"
2626 #include "spectral/phasevoc.h"
2727 #include "onset/peakpick.h"
@@ -30,7 +30,7 @@ · 2 unmodified lines
3030
3131 /* structure to store object state */
3232 struct _aubio_tempo_t {
33− aubio_onsetdetection_t * od; /** onset detection */
33+ aubio_specdesc_t * od; /** onset detection */
3434 aubio_pvoc_t * pv; /** phase vocoder */
3535 aubio_peakpicker_t * pp; /** peak picker */
3636 aubio_beattracking_t * bt; /** beat tracking */
@@ -55,9 +55,9 @@ void aubio_tempo_do(aubio_tempo_t *o, fvec_t * input, fvec_t * tempo) · 18 unmodified lines
5555 uint_t winlen = o->winlen;
5656 uint_t step = o->step;
5757 aubio_pvoc_do (o->pv, input, o->fftgrain);
58− aubio_onsetdetection_do (o->od, o->fftgrain, o->of);
58+ aubio_specdesc_do (o->od, o->fftgrain, o->of);
5959 /*if (usedoubled) {
60− aubio_onsetdetection_do(o2,fftgrain, onset2);
60+ aubio_specdesc_do(o2,fftgrain, onset2);
6161 onset->data[0][0] *= onset2->data[0][0];
6262 }*/
6363 /* execute every overlap_size*step */
@@ -120,13 +120,13 @@ aubio_tempo_t * new_aubio_tempo (char_t * onset_mode, · 56 unmodified lines
120120 o->pv = new_aubio_pvoc(buf_size, hop_size, channels);
121121 o->pp = new_aubio_peakpicker(channels);
122122 aubio_peakpicker_set_threshold (o->pp, o->threshold);
123− o->od = new_aubio_onsetdetection(onset_mode,buf_size,channels);
123+ o->od = new_aubio_specdesc(onset_mode,buf_size,channels);
124124 o->of = new_fvec(1, channels);
125125 o->bt = new_aubio_beattracking(o->winlen,channels);
126126 o->onset = new_fvec(1, channels);
127127 o->peek = new_fvec(3, channels);
128128 /*if (usedoubled) {
129− o2 = new_aubio_onsetdetection(type_onset2,buffer_size,channels);
129+ o2 = new_aubio_specdesc(type_onset2,buffer_size,channels);
130130 onset2 = new_fvec(1 , channels);
131131 }*/
132132 return o;
@@ -142,7 +142,7 @@ smpl_t aubio_tempo_get_confidence(aubio_tempo_t *o) { · 9 unmodified lines
142142
143143 void del_aubio_tempo (aubio_tempo_t *o)
144144 {
145− del_aubio_onsetdetection(o->od);
145+ del_aubio_specdesc(o->od);
146146 del_aubio_beattracking(o->bt);
147147 del_aubio_peakpicker(o->pp);
148148 del_aubio_pvoc(o->pv);
tests/src/test-onsetdetection.c+22−22
@@ -11,35 +11,35 @@ main () · 10 unmodified lines
1111 cvec_t *in = new_cvec (win_s, channels); /* input buffer */
1212 fvec_t *out = new_fvec (1, channels); /* input buffer */
1313
14− aubio_onsetdetection_t *o;
14+ aubio_specdesc_t *o;
1515
16− o = new_aubio_onsetdetection ("energy", win_s, channels);
17− aubio_onsetdetection_do (o, in, out);
18− del_aubio_onsetdetection (o);
16+ o = new_aubio_specdesc ("energy", win_s, channels);
17+ aubio_specdesc_do (o, in, out);
18+ del_aubio_specdesc (o);
1919
20− o = new_aubio_onsetdetection ("energy", win_s, channels);
21− aubio_onsetdetection_do (o, in, out);
22− del_aubio_onsetdetection (o);
20+ o = new_aubio_specdesc ("energy", win_s, channels);
21+ aubio_specdesc_do (o, in, out);
22+ del_aubio_specdesc (o);
2323
24− o = new_aubio_onsetdetection ("hfc", win_s, channels);
25− aubio_onsetdetection_do (o, in, out);
26− del_aubio_onsetdetection (o);
24+ o = new_aubio_specdesc ("hfc", win_s, channels);
25+ aubio_specdesc_do (o, in, out);
26+ del_aubio_specdesc (o);
2727
28− o = new_aubio_onsetdetection ("complex", win_s, channels);
29− aubio_onsetdetection_do (o, in, out);
30− del_aubio_onsetdetection (o);
28+ o = new_aubio_specdesc ("complex", win_s, channels);
29+ aubio_specdesc_do (o, in, out);
30+ del_aubio_specdesc (o);
3131
32− o = new_aubio_onsetdetection ("phase", win_s, channels);
33− aubio_onsetdetection_do (o, in, out);
34− del_aubio_onsetdetection (o);
32+ o = new_aubio_specdesc ("phase", win_s, channels);
33+ aubio_specdesc_do (o, in, out);
34+ del_aubio_specdesc (o);
3535
36− o = new_aubio_onsetdetection ("kl", win_s, channels);
37− aubio_onsetdetection_do (o, in, out);
38− del_aubio_onsetdetection (o);
36+ o = new_aubio_specdesc ("kl", win_s, channels);
37+ aubio_specdesc_do (o, in, out);
38+ del_aubio_specdesc (o);
3939
40− o = new_aubio_onsetdetection ("mkl", win_s, channels);
41− aubio_onsetdetection_do (o, in, out);
42− del_aubio_onsetdetection (o);
40+ o = new_aubio_specdesc ("mkl", win_s, channels);
41+ aubio_specdesc_do (o, in, out);
42+ del_aubio_specdesc (o);
4343
4444 del_cvec (in);
4545 del_fvec (out);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t