|
aubio 0.4.5
|
00001 /* 00002 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 00003 00004 This file is part of aubio. 00005 00006 aubio is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 aubio is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with aubio. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 /** \mainpage 00022 00023 \section introduction Introduction 00024 00025 aubio is a library to extract annotations from audio signals: it provides a 00026 set of functions that take an input audio signal, and output pitch estimates, 00027 attack times (onset), beat location estimates, and other annotation tasks. 00028 00029 \section basics Basics 00030 00031 All object structures in aubio share the same function prefixes and suffixes: 00032 00033 - \p new_aubio_foo creates the object \p foo 00034 - \p aubio_foo_do executes the object \p foo 00035 - \p del_aubio_foo destroys the object \p foo 00036 00037 All memory allocation and deallocation take place in the \p new_ and \p del_ 00038 functions. Optionally, more than one \p _do methods are available. 00039 Additional parameters can be adjusted and observed using: 00040 00041 - \p aubio_foo_get_param, getter function, gets the value of a parameter 00042 - \p aubio_foo_set_param, setter function, changes the value of a parameter 00043 00044 Unless specified in its documentation, no memory operations take place in the 00045 getter functions. However, memory resizing can take place in setter 00046 functions. 00047 00048 \subsection vectors Vectors 00049 00050 Two basic structures are being used in aubio: ::fvec_t and ::cvec_t. The 00051 ::fvec_t structures are used to store vectors of floating pointer number. 00052 ::cvec_t are used to store complex number, as two vectors of norm and phase 00053 elements. 00054 00055 Additionally, the ::lvec_t structure can be used to store floating point 00056 numbers in double precision. They are mostly used to store filter 00057 coefficients, to avoid instability. 00058 00059 \subsection objects Available objects 00060 00061 Here is a list of some of the most common objects for aubio: 00062 00063 \code 00064 00065 // fast Fourier transform (FFT) 00066 aubio_fft_t *fft = new_aubio_fft (winsize); 00067 // phase vocoder 00068 aubio_pvoc_t *pv = new_aubio_pvoc (winsize, stepsize); 00069 // onset detection 00070 aubio_onset_t *onset = new_aubio_onset (method, winsize, stepsize, samplerate); 00071 // pitch detection 00072 aubio_pitch_t *pitch = new_aubio_pitch (method, winsize, stepsize, samplerate); 00073 // beat tracking 00074 aubio_tempo_t *tempo = new_aubio_tempo (method, winsize, stepsize, samplerate); 00075 00076 \endcode 00077 00078 See the <a href="globals_type.html">list of typedefs</a> for a complete list. 00079 00080 \subsection example Example 00081 00082 Here is a simple example that creates an A-Weighting filter and applies it to a 00083 vector. 00084 00085 \code 00086 00087 // set window size, and sampling rate 00088 uint_t winsize = 1024, sr = 44100; 00089 // create a vector 00090 fvec_t *this_buffer = new_fvec (winsize); 00091 // create the a-weighting filter 00092 aubio_filter_t *this_filter = new_aubio_filter_a_weighting (sr); 00093 00094 while (running) { 00095 // here some code to put some data in this_buffer 00096 // ... 00097 00098 // apply the filter, in place 00099 aubio_filter_do (this_filter, this_buffer); 00100 00101 // here some code to get some data from this_buffer 00102 // ... 00103 } 00104 00105 // and free the structures 00106 del_aubio_filter (this_filter); 00107 del_fvec (this_buffer); 00108 00109 \endcode 00110 00111 Several examples of C programs are available in the \p examples/ and \p tests/src 00112 directories of the source tree. 00113 00114 Some examples: 00115 - @ref spectral/test-fft.c 00116 - @ref spectral/test-phasevoc.c 00117 - @ref onset/test-onset.c 00118 - @ref pitch/test-pitch.c 00119 - @ref tempo/test-tempo.c 00120 - @ref test-fvec.c 00121 - @ref test-cvec.c 00122 00123 \subsection unstable_api Unstable API 00124 00125 Several more functions are available and used within aubio, but not 00126 documented here, either because they are not considered useful to the user, 00127 or because they may need to be changed in the future. However, they can still 00128 be used by defining AUBIO_UNSTABLE to 1 before including the aubio header: 00129 00130 \code 00131 #define AUBIO_UNSTABLE 1 00132 #include <aubio/aubio.h> 00133 \endcode 00134 00135 Future versions of aubio could break API compatibility with these functions 00136 without warning. If you choose to use functions in AUBIO_UNSTABLE, you are on 00137 your own. 00138 00139 \section download Download 00140 00141 Latest versions, further documentation, examples, wiki, and mailing lists can 00142 be found at https://aubio.org . 00143 00144 */ 00145 00146 #ifndef AUBIO_H 00147 #define AUBIO_H 00148 00149 /** @file aubio.h Global aubio include file. 00150 00151 You will want to include this file as: 00152 00153 @code 00154 #include <aubio/aubio.h> 00155 @endcode 00156 00157 To access headers with unstable prototypes, use: 00158 00159 @code 00160 #define AUBIO_UNSTABLE 1 00161 #include <aubio/aubio.h> 00162 @endcode 00163 00164 */ 00165 00166 #ifdef __cplusplus 00167 extern "C" 00168 { 00169 #endif 00170 00171 /* in this order */ 00172 #include "types.h" 00173 #include "fvec.h" 00174 #include "cvec.h" 00175 #include "lvec.h" 00176 #include "fmat.h" 00177 #include "musicutils.h" 00178 #include "vecutils.h" 00179 #include "temporal/resampler.h" 00180 #include "temporal/filter.h" 00181 #include "temporal/biquad.h" 00182 #include "temporal/a_weighting.h" 00183 #include "temporal/c_weighting.h" 00184 #include "spectral/fft.h" 00185 #include "spectral/phasevoc.h" 00186 #include "spectral/filterbank.h" 00187 #include "spectral/filterbank_mel.h" 00188 #include "spectral/mfcc.h" 00189 #include "spectral/specdesc.h" 00190 #include "spectral/awhitening.h" 00191 #include "spectral/tss.h" 00192 #include "pitch/pitch.h" 00193 #include "onset/onset.h" 00194 #include "tempo/tempo.h" 00195 #include "notes/notes.h" 00196 #include "io/source.h" 00197 #include "io/sink.h" 00198 #include "synth/sampler.h" 00199 #include "synth/wavetable.h" 00200 #include "utils/parameter.h" 00201 #include "utils/log.h" 00202 00203 #if AUBIO_UNSTABLE 00204 #include "mathutils.h" 00205 #include "io/source_sndfile.h" 00206 #include "io/source_apple_audio.h" 00207 #include "io/source_avcodec.h" 00208 #include "io/source_wavread.h" 00209 #include "io/sink_sndfile.h" 00210 #include "io/sink_apple_audio.h" 00211 #include "io/sink_wavwrite.h" 00212 #include "io/audio_unit.h" 00213 #include "onset/peakpicker.h" 00214 #include "pitch/pitchmcomb.h" 00215 #include "pitch/pitchyin.h" 00216 #include "pitch/pitchyinfft.h" 00217 #include "pitch/pitchschmitt.h" 00218 #include "pitch/pitchfcomb.h" 00219 #include "pitch/pitchspecacf.h" 00220 #include "tempo/beattracking.h" 00221 #include "utils/scale.h" 00222 #include "utils/hist.h" 00223 #endif 00224 00225 #ifdef __cplusplus 00226 } /* extern "C" */ 00227 #endif 00228 00229 #endif
1.7.3