Changeset 21234ee
- Timestamp:
- Dec 18, 2013, 8:07:27 AM (11 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:
- 6465d7f
- Parents:
- 1573b16 (diff), c3c6305 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 1 added
- 3 deleted
- 81 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r1573b16 r21234ee 11 11 many ways. Several memory leaks and out of bound access have been fixed. 12 12 13 * Optimization: the FFT, central to most algorithm , can now be computed13 * Optimization: the FFT, central to most algorithms, can now be computed 14 14 using different optimized algorithms, depending on what is available on your 15 15 platform (FFTW, Ooura, or vDSP). Other simple optimization tricks are -
doc/web.cfg
r1573b16 r21234ee 770 770 771 771 EXCLUDE = ../src/aubio_priv.h \ 772 ../src/mathutils \ 773 .h \ 772 ../src/mathutils.h \ 774 773 ../src/io/audio_unit.h \ 775 774 ../src/io/source_sndfile.h \ … … 778 777 ../src/io/sink_sndfile.h \ 779 778 ../src/io/sink_apple_audio.h \ 780 ../src/io/sndfileio.h \781 779 ../src/onset/peakpicker.h \ 782 780 ../src/pitch/pitchmcomb.h \ -
examples/aubionotes.c
r1573b16 r21234ee 52 52 53 53 aubio_pitch_do (pitch, ibuf, pitch_obuf); 54 smpl_t new_pitch = fvec_ read_sample(pitch_obuf, 0);54 smpl_t new_pitch = fvec_get_sample(pitch_obuf, 0); 55 55 if(median){ 56 56 note_append(note_buffer, new_pitch); … … 59 59 /* curlevel is negatif or 1 if silence */ 60 60 smpl_t curlevel = aubio_level_detection(ibuf, silence_threshold); 61 if (fvec_ read_sample(onset, 0)) {61 if (fvec_get_sample(onset, 0)) { 62 62 /* test for silence */ 63 63 if (curlevel == 1.) { -
examples/aubioonset.c
r1573b16 r21234ee 29 29 fvec_t *onset; 30 30 smpl_t is_onset; 31 uint_t is_silence = 0.;32 31 33 32 void … … 35 34 fvec_zeros(obuf); 36 35 aubio_onset_do (o, ibuf, onset); 37 if (silence_threshold != -90.) 38 is_silence = aubio_silence_detection(ibuf, silence_threshold); 39 is_onset = fvec_read_sample(onset, 0); 40 if ( is_onset && !is_silence ) { 36 is_onset = fvec_get_sample(onset, 0); 37 if ( is_onset ) { 41 38 aubio_wavetable_play ( wavetable ); 42 39 } else { … … 52 49 process_print (void) 53 50 { 54 if ( is_onset && !is_silence) {51 if ( is_onset ) { 55 52 outmsg ("%f\n", aubio_onset_get_last_s (o) ); 56 53 } … … 64 61 verbmsg ("buffer_size: %d, ", buffer_size); 65 62 verbmsg ("hop_size: %d, ", hop_size); 66 verbmsg (" threshold: %f, ", silence_threshold);63 verbmsg ("silence: %f, ", silence_threshold); 67 64 verbmsg ("threshold: %f\n", onset_threshold); 68 65 69 66 o = new_aubio_onset (onset_method, buffer_size, hop_size, samplerate); 70 if (onset_threshold != 0.) aubio_onset_set_threshold (o, onset_threshold); 67 if (onset_threshold != 0.) 68 aubio_onset_set_threshold (o, onset_threshold); 69 if (silence_threshold != -90.) 70 aubio_onset_set_silence (o, silence_threshold); 71 71 72 onset = new_fvec (1); 72 73 -
examples/aubiopitch.c
r1573b16 r21234ee 33 33 fvec_zeros(obuf); 34 34 aubio_pitch_do (o, ibuf, pitch); 35 smpl_t freq = fvec_ read_sample(pitch, 0);35 smpl_t freq = fvec_get_sample(pitch, 0); 36 36 aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) ); 37 37 aubio_wavetable_set_freq ( wavetable, freq ); … … 45 45 void 46 46 process_print (void) { 47 smpl_t pitch_found = fvec_ read_sample(pitch, 0);47 smpl_t pitch_found = fvec_get_sample(pitch, 0); 48 48 outmsg("%f %f\n",(blocks) 49 49 *hop_size/(float)samplerate, pitch_found); … … 64 64 65 65 o = new_aubio_pitch (pitch_method, buffer_size, hop_size, samplerate); 66 if (pitch_tolerance != 0.) aubio_pitch_set_tolerance (o, pitch_tolerance); 67 if (pitch_unit != NULL) aubio_pitch_set_unit (o, pitch_unit); 66 if (pitch_tolerance != 0.) 67 aubio_pitch_set_tolerance (o, pitch_tolerance); 68 if (silence_threshold != -90.) 69 aubio_pitch_set_silence (o, silence_threshold); 70 if (pitch_unit != NULL) 71 aubio_pitch_set_unit (o, pitch_unit); 72 68 73 pitch = new_fvec (1); 69 74 -
examples/aubiotrack.c
r1573b16 r21234ee 29 29 fvec_t * tempo_out; 30 30 smpl_t is_beat = 0; 31 smpl_t is_onset = 0;32 31 uint_t is_silence = 0.; 33 32 34 33 void process_block(fvec_t * ibuf, fvec_t *obuf) { 35 34 aubio_tempo_do (tempo, ibuf, tempo_out); 36 is_beat = fvec_read_sample (tempo_out, 0); 37 is_onset = fvec_read_sample (tempo_out, 1); 35 is_beat = fvec_get_sample (tempo_out, 0); 38 36 if (silence_threshold != -90.) 39 37 is_silence = aubio_silence_detection(ibuf, silence_threshold); … … 54 52 outmsg("%f\n", aubio_tempo_get_last_s(tempo) ); 55 53 } 56 //if ( is_onset )57 // outmsg(" \t \t%f\n",(blocks)*hop_size/(float)samplerate);58 54 } 59 55 -
examples/jackio.c
r1573b16 r21234ee 253 253 for (j=0;j<(unsigned)nframes;j++) { 254 254 /* put synthnew in output */ 255 output[0][j] = fvec_ read_sample(dev->obuf, dev->pos);255 output[0][j] = fvec_get_sample(dev->obuf, dev->pos); 256 256 /* write input to datanew */ 257 fvec_ write_sample(dev->ibuf, input[0][j], dev->pos);257 fvec_set_sample(dev->ibuf, input[0][j], dev->pos); 258 258 /*time for fft*/ 259 259 if (dev->pos == (int)(dev->hop_size) - 1) { -
examples/parse_args.h
r1573b16 r21234ee 62 62 fprintf (stream, "usage: %s [ options ] \n", prog_name); 63 63 fprintf (stream, 64 " -i --input input type\n"65 #ifdef PROG_HAS_OUTPUT 66 " -o --output output type\n"64 " -i --input input file\n" 65 #ifdef PROG_HAS_OUTPUT 66 " -o --output output file\n" 67 67 #endif 68 68 " -r --samplerate select samplerate\n" … … 173 173 hop_size = atoi (optarg); 174 174 break; 175 case 'O': /*onset type*/175 case 'O': /*onset method */ 176 176 onset_method = optarg; 177 177 break; -
examples/utils.c
r1573b16 r21234ee 84 84 this_source = new_aubio_source ((char_t*)source_uri, samplerate, hop_size); 85 85 if (this_source == NULL) { 86 outmsg ("Could not open input file %s\n", source_uri);86 errmsg ("Error: could not open input file %s\n", source_uri); 87 87 exit (1); 88 88 } … … 93 93 uint_t sink_exists = (access(sink_uri, F_OK) == 0 ); 94 94 if (!force_overwrite && sink_exists) { 95 outmsg ("Output file %s already exists, use -f to overwrite.\n",95 errmsg ("Error: output file %s already exists, use -f to overwrite.\n", 96 96 sink_uri); 97 97 exit (1); … … 99 99 this_sink = new_aubio_sink ((char_t*)sink_uri, samplerate); 100 100 if (this_sink == NULL) { 101 outmsg ("Could not openoutput file %s\n", sink_uri);101 errmsg ("Error: could not create output file %s\n", sink_uri); 102 102 exit (1); 103 103 } -
examples/wscript_build
r1573b16 r21234ee 1 1 # vim:set syntax=python: 2 3 uselib = [] 4 uselib += ['JACK'] 2 5 3 6 utils_source = ['utils.c', 'jackio.c'] … … 8 11 source = utils_source, 9 12 includes = ['../src'], 13 uselib = uselib, 10 14 target = 'utilsio') 11 15 -
python/demos/demo_bpm_extract.py
-
Property
mode
changed from
100644
to100755
-
Property
mode
changed from
-
python/demos/demo_mel-energy.py
r1573b16 r21234ee 62 62 ax.yaxis.set_visible(False) 63 63 ax.axis(xmax = all_desc_times[-1], xmin = all_desc_times[0]) 64 ax.annotate('band %d' % i, xy=(-10, 10), xycoords='axes points',64 ax.annotate('band %d' % i, xy=(-10, 0), xycoords='axes points', 65 65 horizontalalignment='right', verticalalignment='bottom', 66 size = 'xx-small', 66 67 ) 67 68 set_xlabels_sample2time( ax, all_desc_times[-1], samplerate) -
python/demos/demo_pitch.py
r1573b16 r21234ee 57 57 58 58 fig = plt.figure() 59 59 60 ax1 = fig.add_subplot(311) 60 61 ax1 = get_waveform_plot(filename, samplerate = samplerate, block_size = hop_s, ax = ax1) 61 ax1.set_xticklabels([]) 62 plt.setp(ax1.get_xticklabels(), visible = False) 63 ax1.set_xlabel('') 62 64 63 65 def array_from_text_file(filename, dtype = 'float'): … … 88 90 #ax2.axis( ymin = 0.9 * cleaned_pitches.min(), ymax = 1.1 * cleaned_pitches.max() ) 89 91 #ax2.axis( ymin = 55, ymax = 70 ) 90 ax2.set_xticklabels([]) 92 plt.setp(ax2.get_xticklabels(), visible = False) 93 ax2.set_ylabel('f0 (Hz)') 91 94 92 95 # plot confidence … … 97 100 ax3.plot(times, [tolerance]*len(confidences)) 98 101 ax3.axis( xmin = times[0], xmax = times[-1]) 102 ax3.set_ylabel('condidence') 103 set_xlabels_sample2time(ax3, times[-1], samplerate) 99 104 plt.show() 100 set_xlabels_sample2time(ax3, times[-1], samplerate) 101 #plt.savefig(os.path.basename(filename) + '.png', dpi=200) 105 #plt.savefig(os.path.basename(filename) + '.svg') -
python/demos/demo_specdesc.py
r1573b16 r21234ee 72 72 ax.yaxis.set_visible(False) 73 73 ax.axis(xmax = all_desc_times[-1], xmin = all_desc_times[0]) 74 ax.annotate(method, xy=(-10, 10), xycoords='axes points',74 ax.annotate(method, xy=(-10, 0), xycoords='axes points', 75 75 horizontalalignment='right', verticalalignment='bottom', 76 76 ) -
python/ext/aubio-types.h
r1573b16 r21234ee 69 69 extern PyTypeObject Py_pvocType; 70 70 71 extern PyTypeObject Py_sourceType; 72 -
python/ext/aubiomodule.c
r1573b16 r21234ee 199 199 || (PyType_Ready (&Py_fftType) < 0) 200 200 || (PyType_Ready (&Py_pvocType) < 0) 201 || (PyType_Ready (&Py_sourceType) < 0) 201 202 // generated objects 202 203 || (generated_types_ready() < 0 ) … … 227 228 Py_INCREF (&Py_pvocType); 228 229 PyModule_AddObject (m, "pvoc", (PyObject *) & Py_pvocType); 230 Py_INCREF (&Py_sourceType); 231 PyModule_AddObject (m, "source", (PyObject *) & Py_sourceType); 229 232 230 233 // add generated objects -
python/ext/aubioproxy.c
r1573b16 r21234ee 36 36 // no need to really allocate fvec, just its struct member 37 37 vec = (fvec_t *)malloc(sizeof(fvec_t)); 38 vec->length = PyArray_SIZE ((PyArrayObject *)array); 38 long length = PyArray_SIZE ((PyArrayObject *)array); 39 if (length > 0) { 40 vec->length = (uint_t)length; 41 } else { 42 PyErr_SetString (PyExc_ValueError, "input array size should be greater than 0"); 43 goto fail; 44 } 39 45 vec->data = (smpl_t *) PyArray_GETPTR1 ((PyArrayObject *)array, 0); 40 46 … … 131 137 // no need to really allocate fvec, just its struct member 132 138 mat = (fmat_t *)malloc(sizeof(fmat_t)); 133 mat->length = PyArray_DIM ((PyArrayObject *)array, 1); 134 mat->height = PyArray_DIM ((PyArrayObject *)array, 0); 139 long length = PyArray_DIM ((PyArrayObject *)array, 1); 140 if (length > 0) { 141 mat->length = (uint_t)length; 142 } else { 143 PyErr_SetString (PyExc_ValueError, "input array dimension 1 should be greater than 0"); 144 goto fail; 145 } 146 long height = PyArray_DIM ((PyArrayObject *)array, 0); 147 if (height > 0) { 148 mat->height = (uint_t)height; 149 } else { 150 PyErr_SetString (PyExc_ValueError, "input array dimension 0 should be greater than 0"); 151 goto fail; 152 } 135 153 mat->data = (smpl_t **)malloc(sizeof(smpl_t*) * mat->height); 136 154 for (i=0; i< mat->height; i++) { -
python/ext/py-fft.c
r1573b16 r21234ee 25 25 26 26 self->win_s = Py_default_vector_length; 27 28 if (self == NULL) {29 return NULL;30 }31 27 32 28 if (win_s > 0) { -
python/lib/gen_pyobject.py
r1573b16 r21234ee 240 240 241 241 self->%(pname)s = %(defval)s; 242 if ( %(pname)s > 0) {242 if ((sint_t)%(pname)s > 0) { 243 243 self->%(pname)s = %(pname)s; 244 } else if ( %(pname)s < 0) {244 } else if ((sint_t)%(pname)s < 0) { 245 245 PyErr_SetString (PyExc_ValueError, 246 246 "can not use negative value for %(pname)s"); -
python/lib/generator.py
r1573b16 r21234ee 57 57 'sink_apple_audio', 58 58 'sink_sndfile', 59 'source', 59 60 'source_apple_audio', 60 61 'source_sndfile', -
python/setup.py
r1573b16 r21234ee 54 54 "ext/py-fft.c", 55 55 "ext/py-phasevoc.c", 56 "ext/py-source.c", 56 57 # generated files 57 58 ] + generated_object_files, -
src/aubio.h
r1573b16 r21234ee 185 185 #include "io/source.h" 186 186 #include "io/sink.h" 187 #include "io/audio_unit.h"188 187 #include "synth/sampler.h" 189 188 #include "synth/wavetable.h" … … 197 196 #include "io/sink_sndfile.h" 198 197 #include "io/sink_apple_audio.h" 199 #include "io/ sndfileio.h"198 #include "io/audio_unit.h" 200 199 #include "onset/peakpicker.h" 201 200 #include "pitch/pitchmcomb.h" -
src/aubio_priv.h
r1573b16 r21234ee 25 25 */ 26 26 27 #ifndef _AUBIO_ PRIV_H28 #define _AUBIO_ PRIV_H27 #ifndef _AUBIO__PRIV_H 28 #define _AUBIO__PRIV_H 29 29 30 30 /********************* … … 218 218 #define UNUSED __attribute__((unused)) 219 219 220 #endif /*_AUBIO_PRIV_H*/220 #endif /* _AUBIO__PRIV_H */ -
src/cvec.c
r1573b16 r21234ee 39 39 } 40 40 41 void cvec_ write_norm(cvec_t *s, smpl_t data, uint_t position) {41 void cvec_norm_set_sample (cvec_t *s, smpl_t data, uint_t position) { 42 42 s->norm[position] = data; 43 43 } 44 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position) { 44 45 void cvec_phas_set_sample (cvec_t *s, smpl_t data, uint_t position) { 45 46 s->phas[position] = data; 46 47 } 47 smpl_t cvec_read_norm(cvec_t *s, uint_t position) { 48 49 smpl_t cvec_norm_get_sample (cvec_t *s, uint_t position) { 48 50 return s->norm[position]; 49 51 } 50 smpl_t cvec_read_phas(cvec_t *s, uint_t position) { 52 53 smpl_t cvec_phas_get_sample (cvec_t *s, uint_t position) { 51 54 return s->phas[position]; 52 55 } 53 smpl_t * cvec_get_norm(cvec_t *s) { 56 57 smpl_t * cvec_norm_get_data (cvec_t *s) { 54 58 return s->norm; 55 59 } 56 smpl_t * cvec_get_phas(cvec_t *s) { 60 61 smpl_t * cvec_phas_get_data (cvec_t *s) { 57 62 return s->phas; 58 63 } … … 92 97 } 93 98 94 void cvec_ set_all_norm(cvec_t *s, smpl_t val) {99 void cvec_norm_set_all (cvec_t *s, smpl_t val) { 95 100 uint_t j; 96 101 for (j=0; j< s->length; j++) { … … 99 104 } 100 105 101 void cvec_ zeros_norm(cvec_t *s) {106 void cvec_norm_zeros(cvec_t *s) { 102 107 #if HAVE_MEMCPY_HACKS 103 108 memset(s->norm, 0, s->length * sizeof(smpl_t)); 104 109 #else 105 cvec_ set_all_norm(s, 0.);110 cvec_norm_set_all (s, 0.); 106 111 #endif 107 112 } 108 113 109 void cvec_ ones_norm(cvec_t *s) {110 cvec_ set_all_norm(s, 1.);114 void cvec_norm_ones(cvec_t *s) { 115 cvec_norm_set_all (s, 1.); 111 116 } 112 117 113 void cvec_ set_all_phas(cvec_t *s, smpl_t val) {118 void cvec_phas_set_all (cvec_t *s, smpl_t val) { 114 119 uint_t j; 115 120 for (j=0; j< s->length; j++) { … … 118 123 } 119 124 120 void cvec_ zeros_phas(cvec_t *s) {125 void cvec_phas_zeros(cvec_t *s) { 121 126 #if HAVE_MEMCPY_HACKS 122 127 memset(s->phas, 0, s->length * sizeof(smpl_t)); 123 128 #else 124 cvec_ set_all_phas(s, 0.);129 cvec_phas_set_all (s, 0.); 125 130 #endif 126 131 } 127 132 128 void cvec_ ones_phas(cvec_t *s) {129 cvec_ set_all_phas(s, 1.);133 void cvec_phas_ones(cvec_t *s) { 134 cvec_phas_set_all (s, 1.); 130 135 } 131 136 132 137 void cvec_zeros(cvec_t *s) { 133 cvec_ zeros_norm(s);134 cvec_ zeros_phas(s);138 cvec_norm_zeros(s); 139 cvec_phas_zeros(s); 135 140 } -
src/cvec.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef _ CVEC_H22 #define _ CVEC_H21 #ifndef _AUBIO__CVEC_H 22 #define _AUBIO__CVEC_H 23 23 24 24 #ifdef __cplusplus … … 28 28 /** \file 29 29 30 Vector of complex-valued data 30 Vector of complex-valued data, stored in polar coordinates 31 31 32 32 This file specifies the ::cvec_t buffer type, which is used throughout aubio 33 33 to store complex data. Complex values are stored in terms of ::cvec_t.phas 34 and norm, within size/2+1 long vectors of ::smpl_t.34 and norm, within 2 vectors of ::smpl_t of size (size/2+1) each. 35 35 36 36 \example test-cvec.c … … 38 38 */ 39 39 40 /** Buffer for complexdata40 /** Vector of real-valued phase and spectrum data 41 41 42 42 \code … … 79 79 */ 80 80 cvec_t * new_cvec(uint_t length); 81 81 82 /** cvec_t buffer deletion function 82 83 … … 85 86 */ 86 87 void del_cvec(cvec_t *s); 88 87 89 /** write norm value in a complex buffer 88 90 89 Note that this function is not used in the aubio library, since the same 90 result can be obtained by assigning vec->norm[position]. Its purpose 91 is to access these values from wrappers, as created by swig. 91 This is equivalent to: 92 \code 93 s->norm[position] = val; 94 \endcode 92 95 93 96 \param s vector to write to 94 \param datanorm value to write in s->norm[position]97 \param val norm value to write in s->norm[position] 95 98 \param position sample position to write to 96 99 97 100 */ 98 void cvec_write_norm(cvec_t *s, smpl_t data, uint_t position); 101 void cvec_norm_set_sample (cvec_t *s, smpl_t val, uint_t position); 102 99 103 /** write phase value in a complex buffer 100 104 101 Note that this function is not used in the aubio library, since the same 102 result can be obtained by assigning vec->phas[position]. Its purpose 103 is to access these values from wrappers, as created by swig. 105 This is equivalent to: 106 \code 107 s->phas[position] = val; 108 \endcode 104 109 105 110 \param s vector to write to 106 \param dataphase value to write in s->phas[position]111 \param val phase value to write in s->phas[position] 107 112 \param position sample position to write to 108 113 109 114 */ 110 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position); 115 void cvec_phas_set_sample (cvec_t *s, smpl_t val, uint_t position); 116 111 117 /** read norm value from a complex buffer 112 118 113 Note that this function is not used in the aubio library, since the same 114 result can be obtained with vec->norm[position]. Its purpose is to 115 access these values from wrappers, as created by swig. 119 This is equivalent to: 120 \code 121 smpl_t foo = s->norm[position]; 122 \endcode 116 123 117 124 \param s vector to read from … … 119 126 120 127 */ 121 smpl_t cvec_read_norm(cvec_t *s, uint_t position); 128 smpl_t cvec_norm_get_sample (cvec_t *s, uint_t position); 129 122 130 /** read phase value from a complex buffer 123 131 124 Note that this function is not used in the aubio library, since the same 125 result can be obtained with vec->phas[position]. Its purpose is to 126 access these values from wrappers, as created by swig. 132 This is equivalent to: 133 \code 134 smpl_t foo = s->phas[position]; 135 \endcode 127 136 128 137 \param s vector to read from 129 138 \param position sample position to read from 130 131 */ 132 smpl_t cvec_read_phas(cvec_t *s, uint_t position); 139 \returns the value of the sample at position 140 141 */ 142 smpl_t cvec_phas_get_sample (cvec_t *s, uint_t position); 143 133 144 /** read norm data from a complex buffer 134 145 135 Note that this function is not used in the aubio library, since the same 136 result can be obtained with vec->norm. Its purpose is to access these values 137 from wrappers, as created by swig. 138 139 \param s vector to read from 140 141 */ 142 smpl_t * cvec_get_norm(cvec_t *s); 146 \code 147 smpl_t *data = s->norm; 148 \endcode 149 150 \param s vector to read from 151 152 */ 153 smpl_t * cvec_norm_get_data (cvec_t *s); 154 143 155 /** read phase data from a complex buffer 144 156 145 Note that this function is not used in the aubio library, since the same 146 result can be obtained with vec->phas. Its purpose is to access these values 147 from wrappers, as created by swig. 148 149 \param s vector to read from 150 151 */ 152 smpl_t * cvec_get_phas(cvec_t *s); 157 This is equivalent to: 158 \code 159 smpl_t *data = s->phas; 160 \endcode 161 162 \param s vector to read from 163 164 */ 165 smpl_t * cvec_phas_get_data (cvec_t *s); 153 166 154 167 /** print out cvec data … … 173 186 174 187 */ 175 void cvec_ set_all_norm(cvec_t *s, smpl_t val);188 void cvec_norm_set_all (cvec_t *s, smpl_t val); 176 189 177 190 /** set all norm elements to zero … … 180 193 181 194 */ 182 void cvec_ zeros_norm(cvec_t *s);195 void cvec_norm_zeros(cvec_t *s); 183 196 184 197 /** set all norm elements to one … … 187 200 188 201 */ 189 void cvec_ ones_norm(cvec_t *s);202 void cvec_norm_ones(cvec_t *s); 190 203 191 204 /** set all phase elements to a given value … … 195 208 196 209 */ 197 void cvec_ set_all_phas(cvec_t *s, smpl_t val);210 void cvec_phas_set_all (cvec_t *s, smpl_t val); 198 211 199 212 /** set all phase elements to zero … … 202 215 203 216 */ 204 void cvec_ zeros_phas(cvec_t *s);217 void cvec_phas_zeros(cvec_t *s); 205 218 206 219 /** set all phase elements to one … … 209 222 210 223 */ 211 void cvec_ ones_phas(cvec_t *s);224 void cvec_phas_ones(cvec_t *s); 212 225 213 226 /** set all norm and phas elements to zero … … 222 235 #endif 223 236 224 #endif /* _CVEC_H */ 225 237 #endif /* _AUBIO__CVEC_H */ -
src/fmat.c
r1573b16 r21234ee 22 22 #include "fmat.h" 23 23 24 fmat_t * new_fmat (uint_t length, uint_t height) {24 fmat_t * new_fmat (uint_t height, uint_t length) { 25 25 if ((sint_t)length <= 0 || (sint_t)height <= 0 ) { 26 26 return NULL; … … 49 49 } 50 50 51 void fmat_ write_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position) {51 void fmat_set_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position) { 52 52 s->data[channel][position] = data; 53 53 } 54 smpl_t fmat_read_sample(fmat_t *s, uint_t channel, uint_t position) { 54 55 smpl_t fmat_get_sample(fmat_t *s, uint_t channel, uint_t position) { 55 56 return s->data[channel][position]; 56 57 } 57 void fmat_put_channel(fmat_t *s, smpl_t * data, uint_t channel) { 58 s->data[channel] = data; 59 } 58 60 59 void fmat_get_channel(fmat_t *s, uint_t channel, fvec_t *output) { 61 60 output->data = s->data[channel]; 62 61 output->length = s->length; 63 62 return; 63 } 64 65 smpl_t * fmat_get_channel_data(fmat_t *s, uint_t channel) { 66 return s->data[channel]; 64 67 } 65 68 -
src/fmat.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2009 Paul Brossier <piem@aubio.org>2 Copyright (C) 2009-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef _ FMAT_H22 #define _ FMAT_H21 #ifndef _AUBIO__FMAT_H 22 #define _AUBIO__FMAT_H 23 23 24 24 #ifdef __cplusplus … … 50 50 51 51 */ 52 fmat_t * new_fmat(uint_t length, uint_t height); 52 fmat_t * new_fmat(uint_t height, uint_t length); 53 53 54 /** fmat_t buffer deletion function 54 55 … … 57 58 */ 58 59 void del_fmat(fmat_t *s); 60 59 61 /** read sample value in a buffer 60 61 Note that this function is not used in the aubio library, since the same62 result can be obtained using vec->data[channel][position]. Its purpose is to63 access these values from wrappers, as created by swig.64 62 65 63 \param s vector to read from … … 68 66 69 67 */ 70 smpl_t fmat_read_sample(fmat_t *s, uint_t channel, uint_t position); 68 smpl_t fmat_get_sample(fmat_t *s, uint_t channel, uint_t position); 69 71 70 /** write sample value in a buffer 72 73 Note that this function is not used in the aubio library, since the same74 result can be obtained by assigning vec->data[channel][position]. Its purpose75 is to access these values from wrappers, as created by swig.76 71 77 72 \param s vector to write to … … 81 76 82 77 */ 83 void fmat_write_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position); 78 void fmat_set_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position); 79 84 80 /** read channel vector from a buffer 85 86 Note that this function is not used in the aubio library, since the same87 result can be obtained with vec->data[channel]. Its purpose is to access88 these values from wrappers, as created by swig.89 81 90 82 \param s vector to read from … … 94 86 */ 95 87 void fmat_get_channel (fmat_t *s, uint_t channel, fvec_t *output); 96 /** write channel vector into a buffer97 88 98 Note that this function is not used in the aubio library, since the same 99 result can be obtained by assigning vec->data[channel]. Its purpose is to 100 access these values from wrappers, as created by swig. 89 /** get vector buffer from an fmat data 101 90 102 \param s vector to write to 103 \param data vector of [length] values to write 104 \param channel channel to write to 91 \param s vector to read from 92 \param channel channel to read from 105 93 106 94 */ 107 void fmat_put_channel(fmat_t *s, smpl_t * data, uint_t channel); 95 smpl_t * fmat_get_channel_data (fmat_t *s, uint_t channel); 96 108 97 /** read data from a buffer 109 110 Note that this function is not used in the aubio library, since the same111 result can be obtained with vec->data. Its purpose is to access these values112 from wrappers, as created by swig.113 98 114 99 \param s vector to read from … … 176 161 #endif 177 162 178 #endif /* _ FMAT_H */163 #endif /* _AUBIO__FMAT_H */ -
src/fvec.c
r1573b16 r21234ee 37 37 } 38 38 39 void fvec_ write_sample(fvec_t *s, smpl_t data, uint_t position) {39 void fvec_set_sample(fvec_t *s, smpl_t data, uint_t position) { 40 40 s->data[position] = data; 41 41 } 42 42 43 smpl_t fvec_ read_sample(fvec_t *s, uint_t position) {43 smpl_t fvec_get_sample(fvec_t *s, uint_t position) { 44 44 return s->data[position]; 45 45 } … … 59 59 } 60 60 61 void fvec_set (fvec_t *s, smpl_t val) {61 void fvec_set_all (fvec_t *s, smpl_t val) { 62 62 uint_t j; 63 63 for (j=0; j< s->length; j++) { … … 70 70 memset(s->data, 0, s->length * sizeof(smpl_t)); 71 71 #else 72 fvec_set (s, 0.);72 fvec_set_all (s, 0.); 73 73 #endif 74 74 } 75 75 76 76 void fvec_ones(fvec_t *s) { 77 fvec_set (s, 1.);77 fvec_set_all (s, 1.); 78 78 } 79 79 -
src/fvec.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef _ FVEC_H22 #define _ FVEC_H21 #ifndef _AUBIO__FVEC_H 22 #define _AUBIO__FVEC_H 23 23 24 24 #ifdef __cplusplus … … 76 76 */ 77 77 fvec_t * new_fvec(uint_t length); 78 78 79 /** fvec_t buffer deletion function 79 80 … … 82 83 */ 83 84 void del_fvec(fvec_t *s); 85 84 86 /** read sample value in a buffer 85 86 Note that this function is not used in the aubio library, since the same87 result can be obtained using vec->data[position]. Its purpose is to88 access these values from wrappers, as created by swig.89 87 90 88 \param s vector to read from … … 92 90 93 91 */ 94 smpl_t fvec_read_sample(fvec_t *s, uint_t position); 92 smpl_t fvec_get_sample(fvec_t *s, uint_t position); 93 95 94 /** write sample value in a buffer 96 97 Note that this function is not used in the aubio library, since the same98 result can be obtained by assigning vec->data[position]. Its purpose99 is to access these values from wrappers, as created by swig.100 95 101 96 \param s vector to write to … … 104 99 105 100 */ 106 void fvec_ write_sample(fvec_t *s, smpl_t data, uint_t position);101 void fvec_set_sample(fvec_t *s, smpl_t data, uint_t position); 107 102 108 103 /** read data from a buffer 109 110 Note that this function is not used in the aubio library, since the same111 result can be obtained with vec->data. Its purpose is to access these values112 from wrappers, as created by swig.113 104 114 105 \param s vector to read from … … 130 121 131 122 */ 132 void fvec_set (fvec_t *s, smpl_t val);123 void fvec_set_all (fvec_t *s, smpl_t val); 133 124 134 125 /** set all elements to zero … … 176 167 #endif 177 168 178 #endif /* _ FVEC_H */169 #endif /* _AUBIO__FVEC_H */ -
src/io/audio_unit.c
r1573b16 r21234ee 105 105 106 106 /* the floats coming from and to the device callback */ 107 o->output_frames = new_fmat( blocksize, sw_output_channels);108 o->input_frames = new_fmat( blocksize, sw_input_channels);107 o->output_frames = new_fmat(sw_output_channels, blocksize); 108 o->input_frames = new_fmat(sw_input_channels, blocksize); 109 109 110 110 /* check for some sizes */ -
src/io/source.c
r1573b16 r21234ee 24 24 #include "fmat.h" 25 25 #include "io/source.h" 26 #ifdef HAVE_ AVCODEC26 #ifdef HAVE_LIBAV 27 27 #include "io/source_avcodec.h" 28 #endif /* HAVE_ AVCODEC*/28 #endif /* HAVE_LIBAV */ 29 29 #ifdef __APPLE__ 30 30 #include "io/source_apple_audio.h" … … 53 53 aubio_source_t * new_aubio_source(char_t * uri, uint_t samplerate, uint_t hop_size) { 54 54 aubio_source_t * s = AUBIO_NEW(aubio_source_t); 55 #if HAVE_ AVCODEC55 #if HAVE_LIBAV 56 56 s->source = (void *)new_aubio_source_avcodec(uri, samplerate, hop_size); 57 57 if (s->source) { … … 64 64 return s; 65 65 } 66 #endif /* HAVE_ AVCODEC*/66 #endif /* HAVE_LIBAV */ 67 67 #ifdef __APPLE__ 68 68 s->source = (void *)new_aubio_source_apple_audio(uri, samplerate, hop_size); -
src/io/source.h
r1573b16 r21234ee 41 41 On Mac and iOS platforms, aubio should be compiled with CoreAudio [Extended 42 42 Audio File Services] 43 (https://developer.apple.com/library/mac/documentation/ musicaudio/CAAudioTooboxRef/_index.html).43 (https://developer.apple.com/library/mac/documentation/MusicAudio/Reference/ExtendedAudioFileServicesReference/Reference/reference.html). 44 44 This provides access to most common audio file formats, including compressed 45 45 ones. -
src/io/source_avcodec.c
r1573b16 r21234ee 22 22 #include "config.h" 23 23 24 #ifdef HAVE_AVCODEC 25 26 #include <sndfile.h> 24 #ifdef HAVE_LIBAV 25 27 26 #include <libavcodec/avcodec.h> 28 27 #include <libavformat/avformat.h> … … 403 402 } 404 403 405 #endif /* HAVE_ SNDFILE*/404 #endif /* HAVE_LIBAV */ -
src/lvec.c
r1573b16 r21234ee 40 40 s->data[position] = data; 41 41 } 42 lsmp_t lvec_ read_sample(lvec_t *s, uint_t position) {42 lsmp_t lvec_get_sample(lvec_t *s, uint_t position) { 43 43 return s->data[position]; 44 44 } … … 58 58 } 59 59 60 void lvec_set (lvec_t *s, smpl_t val) {60 void lvec_set_all (lvec_t *s, smpl_t val) { 61 61 uint_t j; 62 62 for (j=0; j< s->length; j++) { … … 69 69 memset(s->data, 0, s->length * sizeof(lsmp_t)); 70 70 #else 71 lvec_set (s, 0.);71 lvec_set_all (s, 0.); 72 72 #endif 73 73 } 74 74 75 75 void lvec_ones(lvec_t *s) { 76 lvec_set (s, 1.);76 lvec_set_all (s, 1.); 77 77 } 78 78 -
src/lvec.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef _ LVEC_H22 #define _ LVEC_H21 #ifndef _AUBIO__LVEC_H 22 #define _AUBIO__LVEC_H 23 23 24 24 #ifdef __cplusplus … … 58 58 */ 59 59 void del_lvec(lvec_t *s); 60 60 61 /** read sample value in a buffer 61 62 Note that this function is not used in the aubio library, since the same63 result can be obtained using vec->data[position]. Its purpose is to64 access these values from wrappers, as created by swig.65 62 66 63 \param s vector to read from … … 68 65 69 66 */ 70 lsmp_t lvec_read_sample(lvec_t *s, uint_t position); 67 lsmp_t lvec_get_sample(lvec_t *s, uint_t position); 68 71 69 /** write sample value in a buffer 72 73 Note that this function is not used in the aubio library, since the same74 result can be obtained by assigning vec->data[position]. Its purpose75 is to access these values from wrappers, as created by swig.76 70 77 71 \param s vector to write to … … 80 74 81 75 */ 82 void lvec_ write_sample(lvec_t *s, lsmp_t data, uint_t position);76 void lvec_set_sample(lvec_t *s, lsmp_t data, uint_t position); 83 77 84 78 /** read data from a buffer 85 86 Note that this function is not used in the aubio library, since the same87 result can be obtained with vec->data. Its purpose is to access these values88 from wrappers, as created by swig.89 79 90 80 \param s vector to read from … … 106 96 107 97 */ 108 void lvec_set (lvec_t *s, smpl_t val);98 void lvec_set_all(lvec_t *s, smpl_t val); 109 99 110 100 /** set all elements to zero … … 126 116 #endif 127 117 128 #endif /* _ LVEC_H */118 #endif /* _AUBIO__LVEC_H */ -
src/mathutils.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 28 28 */ 29 29 30 #ifndef MATHUTILS_H31 #define MATHUTILS_H30 #ifndef _AUBIO_MATHUTILS_H 31 #define _AUBIO_MATHUTILS_H 32 32 33 33 #include "fvec.h" … … 283 283 #endif 284 284 285 #endif 286 285 #endif /* _AUBIO_MATHUTILS_H */ -
src/musicutils.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 23 23 */ 24 24 25 #ifndef MUSICUTILS_H26 #define MUSICUTILS_H25 #ifndef _AUBIO__MUSICUTILS_H 26 #define _AUBIO__MUSICUTILS_H 27 27 28 28 #ifdef __cplusplus … … 31 31 32 32 /** create window 33 34 \param window_type type of the window to create 35 \param size length of the window to create (see fvec_set_window()) 33 36 37 */ 38 fvec_t *new_aubio_window (char_t * window_type, uint_t size); 39 40 /** set elements of a vector to window coefficients 41 42 \param window exsting ::fvec_t to use 43 \param window_type type of the window to create 44 45 List of available window types: "rectangle", "hamming", "hanning", 46 "hanningz", "blackman", "blackman_harris", "gaussian", "welch", "parzen", 47 "default". 48 49 "default" is equivalent to "hanningz". 50 34 51 References: 35 52 … … 42 59 (<a href="http://profs.sci.univr.it/%7Edafx/Final-Papers/ps/Bernardini.ps.gz"> 43 60 ps.gz</a>) 44 45 */46 fvec_t *new_aubio_window (char_t * window_type, uint_t size);47 48 /** set elements of a vector to window coefficients49 61 50 62 */ … … 149 161 #endif 150 162 151 #endif 152 163 #endif /* _AUBIO__MUSICUTILS_H */ -
src/onset/onset.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2006-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2006-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 40 40 41 41 42 #ifndef ONSET_H43 #define ONSET_H42 #ifndef _AUBIO_ONSET_H 43 #define _AUBIO_ONSET_H 44 44 45 45 #ifdef __cplusplus … … 269 269 #endif 270 270 271 #endif /* ONSET_H */271 #endif /* _AUBIO_ONSET_H */ -
src/onset/peakpicker.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 27 27 */ 28 28 29 #ifndef PEAKPICK_H30 #define PEAKPICK_H29 #ifndef _AUBIO_PEAKPICK_H 30 #define _AUBIO_PEAKPICK_H 31 31 32 32 #ifdef __cplusplus … … 55 55 #endif 56 56 57 #endif /* PEAKPICK_H */57 #endif /* _AUBIO_PEAKPICK_H */ -
src/pitch/pitch.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef PITCH_H22 #define PITCH_H21 #ifndef _AUBIO_PITCH_H 22 #define _AUBIO_PITCH_H 23 23 24 24 #ifdef __cplusplus … … 180 180 #endif 181 181 182 #endif /* PITCH_H*/182 #endif /* _AUBIO_PITCH_H */ -
src/pitch/pitchfcomb.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 35 35 */ 36 36 37 #ifndef _ PITCHFCOMB_H38 #define _ PITCHFCOMB_H37 #ifndef _AUBIO_PITCHFCOMB_H 38 #define _AUBIO_PITCHFCOMB_H 39 39 40 40 #ifdef __cplusplus … … 74 74 #endif 75 75 76 #endif /* _PITCHFCOMB_H */ 77 78 76 #endif /* _AUBIO_PITCHFCOMB_H */ -
src/pitch/pitchmcomb.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 36 36 */ 37 37 38 #ifndef PITCHMCOMB_H39 #define PITCHMCOMB_H38 #ifndef _AUBIO_PITCHMCOMB_H 39 #define _AUBIO_PITCHMCOMB_H 40 40 41 41 #ifdef __cplusplus … … 75 75 #endif 76 76 77 #endif /* PITCHMCOMB_H */77 #endif /* _AUBIO_PITCHMCOMB_H */ -
src/pitch/pitchschmitt.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 35 35 */ 36 36 37 #ifndef _ PITCHSCHMITT_H38 #define _ PITCHSCHMITT_H37 #ifndef _AUBIO_PITCHSCHMITT_H 38 #define _AUBIO_PITCHSCHMITT_H 39 39 40 40 #ifdef __cplusplus … … 73 73 #endif 74 74 75 #endif /* _ PITCHSCHMITT_H */75 #endif /* _AUBIO_PITCHSCHMITT_H */ 76 76 -
src/pitch/pitchspecacf.h
r1573b16 r21234ee 39 39 */ 40 40 41 #ifndef AUBIO_PITCHSPECACF_H42 #define AUBIO_PITCHSPECACF_H41 #ifndef _AUBIO_PITCHSPECACF_H 42 #define _AUBIO_PITCHSPECACF_H 43 43 44 44 #ifdef __cplusplus … … 101 101 #endif 102 102 103 #endif /* AUBIO_PITCHSPECACF_H*/103 #endif /* _AUBIO_PITCHSPECACF_H */ -
src/pitch/pitchyin.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 35 35 */ 36 36 37 #ifndef PITCHYIN_H38 #define PITCHYIN_H37 #ifndef _AUBIO_PITCHYIN_H 38 #define _AUBIO_PITCHYIN_H 39 39 40 40 #ifdef __cplusplus … … 97 97 #endif 98 98 99 #endif /* PITCHYIN_H*/99 #endif /* _AUBIO_PITCHYIN_H */ -
src/pitch/pitchyinfft.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 36 36 */ 37 37 38 #ifndef PITCHYINFFT_H39 #define PITCHYINFFT_H38 #ifndef _AUBIO_PITCHYINFFT_H 39 #define _AUBIO_PITCHYINFFT_H 40 40 41 41 #ifdef __cplusplus … … 97 97 #endif 98 98 99 #endif /* PITCHYINFFT_H*/99 #endif /* _AUBIO_PITCHYINFFT_H */ -
src/spectral/fft.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 23 23 Fast Fourier Transform 24 24 25 Depending on how aubio was compiled, FFT are computed using one of: 26 - [Ooura](http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html) 27 - [FFTW3](http://www.fftw.org) 28 - [vDSP](https://developer.apple.com/library/mac/#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html) 29 25 30 \example src/spectral/test-fft.c 26 31 27 32 */ 28 33 29 #ifndef FFT_H_30 #define FFT_H_34 #ifndef _AUBIO_FFT_H 35 #define _AUBIO_FFT_H 31 36 32 37 #ifdef __cplusplus … … 36 41 /** FFT object 37 42 38 This object computes forward and backward FFTs, using the complex type to 39 store the results. The phase vocoder or aubio_mfft_t objects should be 40 preferred to using directly aubio_fft_t. The FFT are computed using FFTW3 41 (although support for another library could be added). 43 This object computes forward and backward FFTs. 42 44 43 45 */ … … 140 142 #endif 141 143 142 #endif / / FFT_H_144 #endif /* _AUBIO_FFT_H */ -
src/spectral/filterbank.c
r1573b16 r21234ee 44 44 45 45 /* allocate filter tables, a matrix of length win_s and of height n_filters */ 46 fb->filters = new_fmat ( win_s / 2 + 1, n_filters);46 fb->filters = new_fmat (n_filters, win_s / 2 + 1); 47 47 48 48 return fb; -
src/spectral/filterbank.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2007-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2007-2013 Paul Brossier <piem@aubio.org> 3 3 and Amaury Hazan <ahazan@iua.upf.edu> 4 4 … … 30 30 */ 31 31 32 #ifndef FILTERBANK_H33 #define FILTERBANK_H32 #ifndef _AUBIO_FILTERBANK_H 33 #define _AUBIO_FILTERBANK_H 34 34 35 35 #ifdef __cplusplus … … 88 88 #endif 89 89 90 #endif // FILTERBANK_H90 #endif /* _AUBIO_FILTERBANK_H */ -
src/spectral/filterbank_mel.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2007-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2007-2013 Paul Brossier <piem@aubio.org> 3 3 and Amaury Hazan <ahazan@iua.upf.edu> 4 4 … … 32 32 */ 33 33 34 #ifndef FILTERBANK_MEL_H35 #define FILTERBANK_MEL_H34 #ifndef _AUBIO_FILTERBANK_MEL_H 35 #define _AUBIO_FILTERBANK_MEL_H 36 36 37 37 #ifdef __cplusplus … … 70 70 #endif 71 71 72 #endif / / FILTERBANK_MEL_H72 #endif /* _AUBIO_FILTERBANK_MEL_H */ -
src/spectral/mfcc.c
r1573b16 r21234ee 67 67 mfcc->in_dct = new_fvec (n_filters); 68 68 69 mfcc->dct_coeffs = new_fmat (n_ coefs, n_filters);69 mfcc->dct_coeffs = new_fmat (n_filters, n_coefs); 70 70 71 71 /* compute DCT transform dct_coeffs[i][j] as -
src/spectral/mfcc.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2007-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2007-2013 Paul Brossier <piem@aubio.org> 3 3 and Amaury Hazan <ahazan@iua.upf.edu> 4 4 … … 28 28 */ 29 29 30 #ifndef MFCC_H31 #define MFCC_H30 #ifndef _AUBIO_MFCC_H 31 #define _AUBIO_MFCC_H 32 32 33 33 #ifdef __cplusplus … … 70 70 #endif 71 71 72 #endif // MFCC_H72 #endif /* _AUBIO_MFCC_H */ -
src/spectral/phasevoc.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 32 32 */ 33 33 34 #ifndef _ PHASEVOC_H35 #define _ PHASEVOC_H34 #ifndef _AUBIO_PHASEVOC_H 35 #define _AUBIO_PHASEVOC_H 36 36 37 37 #ifdef __cplusplus … … 100 100 #endif 101 101 102 #endif 102 #endif /* _AUBIO_PHASEVOC_H */ -
src/spectral/specdesc.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 20 20 21 21 /** \file 22 22 23 23 Spectral description functions 24 24 25 25 All of the following spectral description functions take as arguments the FFT 26 26 of a windowed signal (as created with aubio_pvoc). They output one smpl_t per 27 27 buffer (stored in a vector of size [1]). 28 28 29 29 \section specdesc Spectral description functions 30 30 … … 35 35 These functions are designed to raise at notes attacks in music signals. 36 36 37 \b \p energy : Energy based onset detection function 38 37 \b \p energy : Energy based onset detection function 38 39 39 This function calculates the local energy of the input spectral frame. 40 40 41 41 \b \p hfc : High Frequency Content onset detection function 42 42 43 43 This method computes the High Frequency Content (HFC) of the input spectral 44 44 frame. The resulting function is efficient at detecting percussive onsets. … … 47 47 Musical Signal. PhD dissertation, University of Bristol, UK, 1996. 48 48 49 \b \p complex : Complex Domain Method onset detection function 50 49 \b \p complex : Complex Domain Method onset detection function 50 51 51 Christopher Duxbury, Mike E. Davies, and Mark B. Sandler. Complex domain 52 52 onset detection for musical signals. In Proceedings of the Digital Audio 53 53 Effects Conference, DAFx-03, pages 90-93, London, UK, 2003. 54 54 55 \b \p phase : Phase Based Method onset detection function 55 \b \p phase : Phase Based Method onset detection function 56 56 57 57 Juan-Pablo Bello, Mike P. Davies, and Mark B. Sandler. Phase-based note onset … … 60 60 Hong-Kong, 2003. 61 61 62 \b \p specdiff : Spectral difference method onset detection function 62 \b \p specdiff : Spectral difference method onset detection function 63 63 64 64 Jonhatan Foote and Shingo Uchihashi. The beat spectrum: a new approach to … … 66 66 (ICME 2001), pages 881884, Tokyo, Japan, August 2001. 67 67 68 \b \p kl : Kullback-Liebler onset detection function 69 68 \b \p kl : Kullback-Liebler onset detection function 69 70 70 Stephen Hainsworth and Malcom Macleod. Onset detection in music audio 71 71 signals. In Proceedings of the International Computer Music Conference 72 72 (ICMC), Singapore, 2003. 73 73 74 \b \p mkl : Modified Kullback-Liebler onset detection function 74 \b \p mkl : Modified Kullback-Liebler onset detection function 75 75 76 76 Paul Brossier, ``Automatic annotation of musical audio for interactive … … 78 78 music, Queen Mary University of London, London, UK, 2006. 79 79 80 \b \p specflux : Spectral Flux 80 \b \p specflux : Spectral Flux 81 81 82 82 Simon Dixon, Onset Detection Revisited, in ``Proceedings of the 9th 83 83 International Conference on Digital Audio Effects'' (DAFx-06), Montreal, 84 Canada, 2006. 84 Canada, 2006. 85 85 86 86 \subsection shapedesc Spectral shape descriptors … … 93 93 href="http://www.ircam.fr/anasyn/peeters/ARTICLES/Peeters_2003_cuidadoaudiofeatures.pdf">pdf</a>) 94 94 95 \b \p centroid : Spectral centroid 95 \b \p centroid : Spectral centroid 96 96 97 97 The spectral centroid represents the barycenter of the spectrum. 98 98 99 99 \e Note: This function returns the result in bin. To get the spectral 100 centroid in Hz, aubio_bintofreq() should be used. 100 centroid in Hz, aubio_bintofreq() should be used. 101 101 102 \b \p spread : Spectral spread 102 \b \p spread : Spectral spread 103 103 104 104 The spectral spread is the variance of the spectral distribution around its … … 126 126 Wikipedia. 127 127 128 \b \p slope : Spectral slope 128 \b \p slope : Spectral slope 129 129 130 130 The spectral slope represents decreasing rate of the spectral amplitude, … … 133 133 \b \p decrease : Spectral decrease 134 134 135 The spectral decrease is another representation of the decreasing rate, 135 The spectral decrease is another representation of the decreasing rate, 136 136 based on perceptual criteria. 137 137 … … 146 146 147 147 148 #ifndef ONSETDETECTION_H149 #define ONSETDETECTION_H148 #ifndef _AUBIO_SPECDESC_H 149 #define _AUBIO_SPECDESC_H 150 150 151 151 #ifdef __cplusplus … … 156 156 typedef struct _aubio_specdesc_t aubio_specdesc_t; 157 157 158 /** execute spectral description function on a spectral frame 158 /** execute spectral description function on a spectral frame 159 159 160 160 Generic function to compute spectral detescription. 161 161 162 162 \param o spectral description object as returned by new_aubio_specdesc() 163 163 \param fftgrain input signal spectrum as computed by aubio_pvoc_do … … 168 168 fvec_t * desc); 169 169 170 /** creation of a spectral description object 170 /** creation of a spectral description object 171 171 172 172 \param method spectral description method … … 181 181 aubio_specdesc_t *new_aubio_specdesc (char_t * method, uint_t buf_size); 182 182 183 /** deletion of a spectral descriptor 183 /** deletion of a spectral descriptor 184 184 185 185 \param o spectral descriptor object as returned by new_aubio_specdesc() … … 192 192 #endif 193 193 194 #endif /* ONSETDETECTION_H */194 #endif /* _AUBIO_SPECDESC_H */ -
src/spectral/tss.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 37 37 */ 38 38 39 #ifndef TSS_H40 #define TSS_H39 #ifndef _AUBIO_TSS_H 40 #define _AUBIO_TSS_H 41 41 42 42 #ifdef __cplusplus … … 101 101 #endif 102 102 103 #endif /* TSS_H*/103 #endif /* _AUBIO_TSS_H */ -
src/synth/sampler.c
r1573b16 r21234ee 43 43 s->blocksize = blocksize; 44 44 s->source_output = new_fvec(blocksize); 45 s->source_output_multi = new_fmat( blocksize, 4);45 s->source_output_multi = new_fmat(4, blocksize); 46 46 s->source = NULL; 47 47 s->playing = 0; -
src/synth/sampler.h
r1573b16 r21234ee 19 19 */ 20 20 21 #ifndef _AUBIO_S YNTH_SAMPLER_H22 #define _AUBIO_S YNTH_SAMPLER_H21 #ifndef _AUBIO_SAMPLER_H 22 #define _AUBIO_SAMPLER_H 23 23 24 24 /** \file … … 138 138 #endif 139 139 140 #endif /* _AUBIO_S YNTH_SAMPLER_H */140 #endif /* _AUBIO_SAMPLER_H */ -
src/synth/wavetable.c
r1573b16 r21234ee 98 98 aubio_parameter_get_next_value ( s->amp ); 99 99 } 100 fvec_ set(output, 0.);100 fvec_zeros (output); 101 101 } 102 102 // add input to output if needed … … 131 131 aubio_parameter_get_next_value ( s->amp ); 132 132 } 133 fmat_ set(output, 0.);133 fmat_zeros (output); 134 134 } 135 135 // add output to input if needed -
src/synth/wavetable.h
r1573b16 r21234ee 19 19 */ 20 20 21 #ifndef _AUBIO_ SYNTH_WAVETABLE_H22 #define _AUBIO_ SYNTH_WAVETABLE_H21 #ifndef _AUBIO_WAVETABLE_H 22 #define _AUBIO_WAVETABLE_H 23 23 24 24 /** \file … … 176 176 #endif 177 177 178 #endif /* _AUBIO_ SYNTH_WAVETABLE_H */178 #endif /* _AUBIO_WAVETABLE_H */ -
src/tempo/beattracking.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Matthew Davies and Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Matthew Davies and Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 37 37 38 38 */ 39 #ifndef BEATTRACKING_H40 #define BEATTRACKING_H39 #ifndef _AUBIO_BEATTRACKING_H 40 #define _AUBIO_BEATTRACKING_H 41 41 42 42 #ifdef __cplusplus … … 99 99 #endif 100 100 101 #endif /* BEATTRACKING_H */101 #endif /* _AUBIO_BEATTRACKING_H */ -
src/tempo/tempo.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2006-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2006-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 31 31 */ 32 32 33 #ifndef TEMPO_H34 #define TEMPO_H33 #ifndef _AUBIO_TEMPO_H 34 #define _AUBIO_TEMPO_H 35 35 36 36 #ifdef __cplusplus … … 134 134 #endif 135 135 136 #endif /* TEMPO_H */136 #endif /* _AUBIO_TEMPO_H */ -
src/temporal/a_weighting.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef _A DESIGN_H22 #define _A DESIGN_H21 #ifndef _AUBIO_FILTER_A_DESIGN_H 22 #define _AUBIO_FILTER_A_DESIGN_H 23 23 24 24 /** \file … … 86 86 #endif 87 87 88 #endif /* _A DESIGN_H */88 #endif /* _AUBIO_FILTER_A_DESIGN_H */ -
src/temporal/biquad.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef BIQUAD_H22 #define BIQUAD_H21 #ifndef _AUBIO_FILTER_BIQUAD_H 22 #define _AUBIO_FILTER_BIQUAD_H 23 23 24 24 /** \file … … 73 73 #endif 74 74 75 #endif /* BIQUAD_H*/75 #endif /* _AUBIO_FILTER_BIQUAD_H */ -
src/temporal/c_weighting.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef _ CDESIGN_H22 #define _ CDESIGN_H21 #ifndef _AUBIO_FILTER_C_DESIGN_H 22 #define _AUBIO_FILTER_C_DESIGN_H 23 23 24 24 /** \file … … 86 86 #endif 87 87 88 #endif /* _ CDESIGN_H */88 #endif /* _AUBIO_FILTER_C_DESIGN_H */ -
src/temporal/filter.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef FILTER_H22 #define FILTER_H21 #ifndef _AUBIO_FILTER_H 22 #define _AUBIO_FILTER_H 23 23 24 24 /** \file … … 174 174 #endif 175 175 176 #endif /* FILTER_H*/176 #endif /* _AUBIO_FILTER_H */ -
src/temporal/resampler.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef _ RESAMPLE_H22 #define _ RESAMPLE_H21 #ifndef _AUBIO_RESAMPLER_H 22 #define _AUBIO_RESAMPLER_H 23 23 24 24 /** \file … … 63 63 #endif 64 64 65 #endif /* _ RESAMPLE_H */65 #endif /* _AUBIO_RESAMPLER_H */ -
src/types.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 #ifndef AUBIO_TYPES_H22 #define AUBIO_TYPES_H21 #ifndef _AUBIO__TYPES_H 22 #define _AUBIO__TYPES_H 23 23 24 24 /** \file … … 68 68 #endif 69 69 70 #endif /*AUBIO_TYPES_H*/70 #endif /* _AUBIO__TYPES_H */ -
src/utils/hist.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 26 26 */ 27 27 28 #ifndef HIST_H29 #define HIST_H28 #ifndef _AUBIO_HIST_H 29 #define _AUBIO_HIST_H 30 30 31 31 #ifdef __cplusplus … … 61 61 #endif 62 62 63 #endif 63 #endif /* _AUBIO_HIST_H */ -
src/utils/parameter.h
r1573b16 r21234ee 158 158 159 159 #endif /* _AUBIO_PARAMETER_H */ 160 -
src/utils/scale.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 29 29 30 30 */ 31 #ifndef SCALE_H32 #define SCALE_H31 #ifndef _AUBIO_SCALE_H 32 #define _AUBIO_SCALE_H 33 33 34 34 #ifdef __cplusplus … … 78 78 #endif 79 79 80 #endif 80 #endif /* _AUBIO_SCALE_H */ -
src/vecutils.c
r1573b16 r21234ee 15 15 } 16 16 17 #define AUBIO_OP_C_AND_F(OPNAME, OP) \ 18 AUBIO_OP(OPNAME, OP, fvec, data) \ 19 AUBIO_OP(OPNAME, OP, cvec, norm) 17 #define AUBIO_OP_C(OPNAME, OP) \ 18 AUBIO_OP(OPNAME, OP, fvec, data) 20 19 21 AUBIO_OP_C _AND_F(exp, EXP)22 AUBIO_OP_C _AND_F(cos, COS)23 AUBIO_OP_C _AND_F(sin, SIN)24 AUBIO_OP_C _AND_F(abs, ABS)25 AUBIO_OP_C _AND_F(sqrt, SQRT)26 AUBIO_OP_C _AND_F(log10, SAFE_LOG10)27 AUBIO_OP_C _AND_F(log, SAFE_LOG)28 AUBIO_OP_C _AND_F(floor, FLOOR)29 AUBIO_OP_C _AND_F(ceil, CEIL)30 AUBIO_OP_C _AND_F(round, ROUND)20 AUBIO_OP_C(exp, EXP) 21 AUBIO_OP_C(cos, COS) 22 AUBIO_OP_C(sin, SIN) 23 AUBIO_OP_C(abs, ABS) 24 AUBIO_OP_C(sqrt, SQRT) 25 AUBIO_OP_C(log10, SAFE_LOG10) 26 AUBIO_OP_C(log, SAFE_LOG) 27 AUBIO_OP_C(floor, FLOOR) 28 AUBIO_OP_C(ceil, CEIL) 29 AUBIO_OP_C(round, ROUND) 31 30 32 //AUBIO_OP_C_AND_F(pow, POW)33 31 void fvec_pow (fvec_t *s, smpl_t power) 34 32 { … … 38 36 } 39 37 } 40 41 void cvec_pow (cvec_t *s, smpl_t power)42 {43 uint_t j;44 for (j = 0; j < s->length; j++) {45 s->norm[j] = POW(s->norm[j], power);46 }47 }48 -
src/vecutils.h
r1573b16 r21234ee 1 1 /* 2 Copyright (C) 2009 Paul Brossier <piem@aubio.org>2 Copyright (C) 2009-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 21 21 /** \file 22 22 23 Utility functions for ::fvec_t and ::cvec_t objects23 Utility functions for ::fvec_t 24 24 25 25 */ 26 26 27 #ifndef _ VECUTILS_H28 #define _ VECUTILS_H27 #ifndef _AUBIO__VECUTILS_H 28 #define _AUBIO__VECUTILS_H 29 29 30 30 #ifdef __cplusplus … … 110 110 void fvec_pow (fvec_t *s, smpl_t pow); 111 111 112 /** compute \f$e^x\f$ of each vector norm elements113 114 \param s vector to modify115 116 */117 void cvec_exp (cvec_t *s);118 119 /** compute \f$cos(x)\f$ of each vector norm elements120 121 \param s vector to modify122 123 */124 void cvec_cos (cvec_t *s);125 126 /** compute \f$sin(x)\f$ of each vector norm elements127 128 \param s vector to modify129 130 */131 void cvec_sin (cvec_t *s);132 133 /** compute the \f$abs(x)\f$ of each vector norm elements134 135 \param s vector to modify136 137 */138 void cvec_abs (cvec_t *s);139 140 /** compute the \f$sqrt(x)\f$ of each vector norm elements141 142 \param s vector to modify143 144 */145 void cvec_sqrt (cvec_t *s);146 147 /** compute the \f$log10(x)\f$ of each vector norm elements148 149 \param s vector to modify150 151 */152 void cvec_log10 (cvec_t *s);153 154 /** compute the \f$log(x)\f$ of each vector norm elements155 156 \param s vector to modify157 158 */159 void cvec_log (cvec_t *s);160 161 /** compute the \f$floor(x)\f$ of each vector norm elements162 163 \param s vector to modify164 165 */166 void cvec_floor (cvec_t *s);167 168 /** compute the \f$ceil(x)\f$ of each vector norm elements169 170 \param s vector to modify171 172 */173 void cvec_ceil (cvec_t *s);174 175 /** compute the \f$round(x)\f$ of each vector norm elements176 177 \param s vector to modify178 179 */180 void cvec_round (cvec_t *s);181 182 /** raise each vector norm elements to the power pow183 184 \param s vector to modify185 \param pow power to raise to186 187 */188 void cvec_pow (cvec_t *s, smpl_t pow);189 190 112 #ifdef __cplusplus 191 113 } 192 114 #endif 193 115 194 #endif /* _VECUTILS_H*/116 #endif /* _AUBIO__VECUTILS_H */ -
src/wscript_build
r1573b16 r21234ee 10 10 uselib += ['AVRESAMPLE'] 11 11 uselib += ['AVUTIL'] 12 uselib += ['JACK']13 12 14 13 ctx(features = 'c', … … 22 21 if ctx.env['DEST_OS'] in ['ios', 'iosimulator']: 23 22 build_features = ['cstlib'] 23 elif ctx.env['DEST_OS'] in ['win32', 'win64']: 24 build_features = ['cshlib'] 24 25 else: #linux, darwin, android, mingw, ... 25 26 build_features = ['cshlib', 'cstlib'] … … 28 29 ctx(features = 'c ' + target, 29 30 use = ['lib_objects'], #source = source, 31 lib = 'm', 30 32 target = 'aubio', 31 33 install_path = '${PREFIX}/lib', -
tests/src/io/test-source_multi.c
r1573b16 r21234ee 39 39 if ( n_channels == 0 ) n_channels = aubio_source_get_channels(s); 40 40 41 fmat_t *mat = new_fmat( hop_size, n_channels);41 fmat_t *mat = new_fmat(n_channels, hop_size); 42 42 43 43 do { -
tests/src/spectral/test-mfcc.c
r1573b16 r21234ee 13 13 aubio_mfcc_t *o = new_aubio_mfcc (win_s, n_filters, n_coefs, samplerate); 14 14 15 cvec_ set_all_norm(in, 1.);15 cvec_norm_set_all (in, 1.); 16 16 aubio_mfcc_do (o, in, out); 17 17 fvec_print (out); 18 18 19 cvec_ set_all_norm(in, .5);19 cvec_norm_set_all (in, .5); 20 20 aubio_mfcc_do (o, in, out); 21 21 fvec_print (out); -
tests/src/spectral/test-phasevoc.c
r1573b16 r21234ee 15 15 16 16 // fill input with some data 17 fvec_set (in, 1.);17 fvec_set_all (in, 1.); 18 18 fvec_print (in); 19 19 -
tests/src/test-cvec.c
r1573b16 r21234ee 20 20 21 21 // set all vector elements to `0` 22 cvec_ zeros_norm(complex_vector);22 cvec_norm_zeros(complex_vector); 23 23 for ( i = 0; i < complex_vector->length; i++ ) { 24 24 assert( complex_vector->norm[i] == 0. ); … … 28 28 29 29 // set all vector elements to `1` 30 cvec_ ones_norm(complex_vector);30 cvec_norm_ones(complex_vector); 31 31 for ( i = 0; i < complex_vector->length; i++ ) { 32 32 assert( complex_vector->norm[i] == 1. ); … … 36 36 37 37 cvec_zeros(complex_vector); 38 cvec_ zeros_phas(complex_vector);39 cvec_ zeros_norm(complex_vector);40 cvec_ ones_norm(complex_vector);41 cvec_ ones_phas(complex_vector);38 cvec_phas_zeros(complex_vector); 39 cvec_norm_zeros(complex_vector); 40 cvec_norm_ones(complex_vector); 41 cvec_phas_ones(complex_vector); 42 42 cvec_copy(complex_vector, complex_vector); 43 43 -
tests/src/test-fmat.c
r1573b16 r21234ee 9 9 uint_t height = 3, length = 9, i, j; 10 10 // create fmat_t object 11 fmat_t * mat = new_fmat ( length, height);11 fmat_t * mat = new_fmat (height, length); 12 12 for ( i = 0; i < mat->height; i++ ) { 13 13 for ( j = 0; j < mat->length; j++ ) { -
tests/utils_tests.h
r1573b16 r21234ee 4 4 #include <math.h> 5 5 #include <assert.h> 6 #include "config.h" 6 7 7 8 #define PRINT_ERR(format, args...) fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args) … … 9 10 #define PRINT_DBG(format, args...) fprintf(stderr, format , ##args) 10 11 #define PRINT_WRN(format, args...) fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args) 12 13 #ifdef HAVE_WIN_HACKS 14 // http://en.wikipedia.org/wiki/Linear_congruential_generator 15 // no srandom/random on win32 16 17 uint_t srandom_seed = 1029; 18 19 void srandom(uint_t new_seed) { 20 srandom_seed = new_seed; 21 } 22 23 uint_t random(void) { 24 srandom_seed = 1664525 * srandom_seed + 1013904223; 25 return srandom_seed; 26 } 27 #endif 11 28 12 29 void utils_init_random () { -
tests/wscript_build
r1573b16 r21234ee 5 5 includes = ['../src', '.'] 6 6 extra_source = [] 7 if str(target_name).endswith('-jack.c') and ctx.env['JACK']:8 uselib += ['JACK']9 includes += ['../examples']10 extra_source += ['../examples/jackio.c']11 7 12 8 bld(features = 'c cprogram test', -
wscript
r1573b16 r21234ee 85 85 ctx.load('waf_unit_test') 86 86 ctx.load('gnu_dirs') 87 ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra', '-fPIC'] 87 88 ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra'] 88 89 89 90 target_platform = Options.platform … … 92 93 ctx.env['DEST_OS'] = target_platform 93 94 94 if target_platform == 'win32': 95 ctx.env['shlib_PATTERN'] = 'lib%s.dll' 95 if target_platform not in ['win32', 'win64']: 96 ctx.env.CFLAGS += ['-fPIC'] 97 else: 98 ctx.define('HAVE_WIN_HACKS', 1) 99 ctx.env['cshlib_PATTERN'] = 'lib%s.dll' 96 100 97 101 if target_platform == 'darwin': … … 201 205 # check for jack 202 206 if (ctx.options.enable_jack != False): 203 ctx.check_cfg(package = 'jack', atleast_version = '0.15.0',207 ctx.check_cfg(package = 'jack', 204 208 args = '--cflags --libs', mandatory = False) 205 209 … … 214 218 ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1', 215 219 args = '--cflags --libs', uselib_store = 'AVRESAMPLE', mandatory = False) 220 if all ( 'HAVE_' + i in ctx.env.define_key 221 for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ): 222 ctx.define('HAVE_LIBAV', 1) 223 ctx.msg('Checking for all libav libraries', 'yes') 224 else: 225 ctx.msg('Checking for all libav libraries', 'not found', color = 'YELLOW') 216 226 217 227 # use memcpy hacks … … 233 243 except ctx.errors.ConfigurationError: 234 244 ctx.to_log('txt2man was not found (ignoring)') 245 246 # check if doxygen is installed, optional 247 try: 248 ctx.find_program('doxygen', var='DOXYGEN') 249 except ctx.errors.ConfigurationError: 250 ctx.to_log('doxygen was not found (ignoring)') 235 251 236 252 def build(bld): … … 248 264 bld( source = 'aubio.pc.in' ) 249 265 250 # build manpages from sgml files266 # build manpages from txt files using txt2man 251 267 if bld.env['TXT2MAN']: 252 268 from waflib import TaskGen … … 267 283 bld( source = bld.path.ant_glob('doc/*.txt') ) 268 284 269 """ 270 bld(rule = 'doxygen ${SRC}', source = 'web.cfg') #, target = 'doc/web/index.html') 271 """ 272 285 # build documentation from source files using doxygen 286 if bld.env['DOXYGEN']: 287 bld( name = 'doxygen', rule = 'doxygen ${SRC} > /dev/null', 288 source = 'doc/web.cfg', 289 cwd = 'doc') 290 bld.install_files( '${PREFIX}' + '/share/doc/libaubio-doc', 291 bld.path.ant_glob('doc/web/html/**'), 292 cwd = bld.path.find_dir ('doc/web'), 293 relative_trick = True) 273 294 274 295 def shutdown(bld): … … 288 309 ctx.excl += ' **/python/*.db' 289 310 ctx.excl += ' **/python.old/*' 311 ctx.excl += ' **/python/tests/sounds'
Note: See TracChangeset
for help on using the changeset viewer.