aubio  0.4.1
aubio.h
Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2003-2013 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   \subsection unstable_api Unstable API
00115 
00116   Several more functions are available and used within aubio, but not
00117   documented here, either because they are not considered useful to the user,
00118   or because they may need to be changed in the future. However, they can still
00119   be used by defining AUBIO_UNSTABLE to 1 before including the aubio header:
00120 
00121   \code
00122   #define AUBIO_UNSTABLE 1
00123   #include <aubio/aubio.h>
00124   \endcode
00125 
00126   Future versions of aubio could break API compatibility with these functions
00127   without warning. If you choose to use functions in AUBIO_UNSTABLE, you are on
00128   your own.
00129 
00130   \section download Download
00131 
00132   Latest versions, further documentation, examples, wiki, and mailing lists can
00133   be found at http://aubio.org .
00134 
00135  */
00136 
00137 #ifndef AUBIO_H
00138 #define AUBIO_H
00139 
00140 /** @file aubio.h Global aubio include file.
00141 
00142   You will want to include this file as:
00143 
00144   @code
00145     #include <aubio/aubio.h>
00146   @endcode
00147 
00148   To access headers with unstable prototypes, use:
00149 
00150   @code
00151     #define AUBIO_UNSTABLE 1
00152     #include <aubio/aubio.h>
00153   @endcode
00154 
00155  */
00156 
00157 #ifdef __cplusplus
00158 extern "C"
00159 {
00160 #endif
00161 
00162 /* in this order */
00163 #include "types.h"
00164 #include "fvec.h"
00165 #include "cvec.h"
00166 #include "lvec.h"
00167 #include "fmat.h"
00168 #include "musicutils.h"
00169 #include "vecutils.h"
00170 #include "temporal/resampler.h"
00171 #include "temporal/filter.h"
00172 #include "temporal/biquad.h"
00173 #include "temporal/a_weighting.h"
00174 #include "temporal/c_weighting.h"
00175 #include "spectral/fft.h"
00176 #include "spectral/phasevoc.h"
00177 #include "spectral/filterbank.h"
00178 #include "spectral/filterbank_mel.h"
00179 #include "spectral/mfcc.h"
00180 #include "spectral/specdesc.h"
00181 #include "spectral/tss.h"
00182 #include "pitch/pitch.h"
00183 #include "onset/onset.h"
00184 #include "tempo/tempo.h"
00185 #include "io/source.h"
00186 #include "io/sink.h"
00187 #include "synth/sampler.h"
00188 #include "synth/wavetable.h"
00189 #include "utils/parameter.h"
00190 
00191 #if AUBIO_UNSTABLE
00192 #include "mathutils.h"
00193 #include "io/source_sndfile.h"
00194 #include "io/source_apple_audio.h"
00195 #include "io/source_avcodec.h"
00196 #include "io/source_wavread.h"
00197 #include "io/sink_sndfile.h"
00198 #include "io/sink_apple_audio.h"
00199 #include "io/sink_wavwrite.h"
00200 #include "io/audio_unit.h"
00201 #include "onset/peakpicker.h"
00202 #include "pitch/pitchmcomb.h"
00203 #include "pitch/pitchyin.h"
00204 #include "pitch/pitchyinfft.h"
00205 #include "pitch/pitchschmitt.h"
00206 #include "pitch/pitchfcomb.h"
00207 #include "pitch/pitchspecacf.h"
00208 #include "tempo/beattracking.h"
00209 #include "utils/scale.h"
00210 #include "utils/hist.h"
00211 #endif
00212 
00213 #ifdef __cplusplus
00214 } /* extern "C" */
00215 #endif
00216 
00217 #endif
 All Data Structures Files Functions Variables Typedefs Defines