source: src/aubio.h @ f77820d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5sampler
Last change on this file since f77820d was ed66e34, checked in by Paul Brossier <piem@piem.org>, 8 years ago

src/aubio.h: use https, format examples as list

  • Property mode set to 100644
File size: 6.3 KB
RevLine 
[96fb8ad]1/*
[f549b98d]2  Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org>
[a6db140]3
4  This file is part of aubio.
5
6  aubio is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10
11  aubio is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15
16  You should have received a copy of the GNU General Public License
17  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
18
[96fb8ad]19*/
20
[f549b98d]21/** \mainpage
22
[4ef9a9b]23  \section introduction Introduction
[f549b98d]24
[4ef9a9b]25  aubio is a library to extract annotations from audio signals: it provides a
26  set of functions that take an input audio signal, and output pitch estimates,
27  attack times (onset), beat location estimates, and other annotation tasks.
[f549b98d]28
29  \section basics Basics
30
[4ef9a9b]31  All object structures in aubio share the same function prefixes and suffixes:
[f549b98d]32
[4ef9a9b]33    - \p new_aubio_foo creates the object \p foo
34    - \p aubio_foo_do executes the object \p foo
35    - \p del_aubio_foo destroys the object \p foo
36
37  All memory allocation and deallocation take place in the \p new_ and \p del_
38  functions. Optionally, more than one \p _do methods are available.
39  Additional parameters can be adjusted and observed using:
[f549b98d]40
[4ef9a9b]41    - \p aubio_foo_get_param, getter function, gets the value of a parameter
42    - \p aubio_foo_set_param, setter function, changes the value of a parameter
43
44  Unless specified in its documentation, no memory operations take place in the
45  getter functions. However, memory resizing can take place in setter
46  functions.
47
48  \subsection vectors Vectors
49
50  Two basic structures are being used in aubio: ::fvec_t and ::cvec_t. The
[02a01dd]51  ::fvec_t structures are used to store vectors of floating pointer number.
52  ::cvec_t are used to store complex number, as two vectors of norm and phase
53  elements.
54
[4ef9a9b]55  Additionally, the ::lvec_t structure can be used to store floating point
56  numbers in double precision. They are mostly used to store filter
57  coefficients, to avoid instability.
[02a01dd]58
[4ef9a9b]59  \subsection objects Available objects
60
61  Here is a list of some of the most common objects for aubio:
62
63  \code
64
65  // fast Fourier transform (FFT)
[02a01dd]66  aubio_fft_t *fft = new_aubio_fft (winsize);
[4ef9a9b]67  // phase vocoder
[02a01dd]68  aubio_pvoc_t *pv = new_aubio_pvoc (winsize, stepsize);
69  // onset detection
70  aubio_onset_t *onset = new_aubio_onset (method, winsize, stepsize, samplerate);
71  // pitch detection
72  aubio_pitch_t *pitch = new_aubio_pitch (method, winsize, stepsize, samplerate);
[4ef9a9b]73  // beat tracking
[02a01dd]74  aubio_tempo_t *tempo = new_aubio_tempo (method, winsize, stepsize, samplerate);
[4ef9a9b]75
76  \endcode
77
78  See the <a href="globals_type.html">list of typedefs</a> for a complete list.
79
80  \subsection example Example
81
82  Here is a simple example that creates an A-Weighting filter and applies it to a
83  vector.
[02a01dd]84
[4ef9a9b]85  \code
86
[02a01dd]87  // set window size, and sampling rate
88  uint_t winsize = 1024, sr = 44100;
[4ef9a9b]89  // create a vector
[02a01dd]90  fvec_t *this_buffer = new_fvec (winsize);
[4ef9a9b]91  // create the a-weighting filter
[02a01dd]92  aubio_filter_t *this_filter = new_aubio_filter_a_weighting (sr);
93
[4ef9a9b]94  while (running) {
[998d4d6]95    // here some code to put some data in this_buffer
96    // ...
97
[4ef9a9b]98    // apply the filter, in place
99    aubio_filter_do (this_filter, this_buffer);
[998d4d6]100
[02a01dd]101    // here some code to get some data from this_buffer
[998d4d6]102    // ...
[4ef9a9b]103  }
[02a01dd]104
[4ef9a9b]105  // and free the structures
106  del_aubio_filter (this_filter);
107  del_fvec (this_buffer);
108
109  \endcode
110
111  Several examples of C programs are available in the \p examples/ and \p tests/src
[ed66e34]112  directories of the source tree.
113
114  Some examples:
115  - @ref spectral/test-fft.c
116  - @ref spectral/test-phasevoc.c
117  - @ref onset/test-onset.c
118  - @ref pitch/test-pitch.c
119  - @ref tempo/test-tempo.c
120  - @ref test-fvec.c
121  - @ref test-cvec.c
[4ef9a9b]122
123  \subsection unstable_api Unstable API
124
125  Several more functions are available and used within aubio, but not
126  documented here, either because they are not considered useful to the user,
127  or because they may need to be changed in the future. However, they can still
128  be used by defining AUBIO_UNSTABLE to 1 before including the aubio header:
129
130  \code
131  #define AUBIO_UNSTABLE 1
132  #include <aubio/aubio.h>
133  \endcode
134
135  Future versions of aubio could break API compatibility with these functions
136  without warning. If you choose to use functions in AUBIO_UNSTABLE, you are on
137  your own.
138
139  \section download Download
[02a01dd]140
[4ef9a9b]141  Latest versions, further documentation, examples, wiki, and mailing lists can
[ed66e34]142  be found at https://aubio.org .
[02a01dd]143
[96fb8ad]144 */
145
146#ifndef AUBIO_H
147#define AUBIO_H
148
[4ef9a9b]149/** @file aubio.h Global aubio include file.
150
[8c4560e]151  You will want to include this file as:
[02a01dd]152
[4ef9a9b]153  @code
154    #include <aubio/aubio.h>
155  @endcode
[02a01dd]156
[8c4560e]157  To access headers with unstable prototypes, use:
158
159  @code
160    #define AUBIO_UNSTABLE 1
161    #include <aubio/aubio.h>
162  @endcode
163
[96fb8ad]164 */
165
166#ifdef __cplusplus
[bf9d8a6]167extern "C"
168{
[96fb8ad]169#endif
170
171/* in this order */
172#include "types.h"
[6c7d49b]173#include "fvec.h"
174#include "cvec.h"
[658cb41]175#include "lvec.h"
[02a01dd]176#include "fmat.h"
[83963b3]177#include "musicutils.h"
[2fcb973]178#include "vecutils.h"
[0af05d3]179#include "temporal/resampler.h"
[32d6958]180#include "temporal/filter.h"
[b01bd4a]181#include "temporal/biquad.h"
[a253fd4]182#include "temporal/a_weighting.h"
183#include "temporal/c_weighting.h"
[fc6c831]184#include "spectral/fft.h"
185#include "spectral/phasevoc.h"
[c03e777]186#include "spectral/filterbank.h"
187#include "spectral/filterbank_mel.h"
[83963b3]188#include "spectral/mfcc.h"
[31907fd]189#include "spectral/specdesc.h"
[2fcb973]190#include "spectral/tss.h"
[ca1abdd]191#include "pitch/pitch.h"
[83963b3]192#include "onset/onset.h"
193#include "tempo/tempo.h"
[4da806c]194#include "notes/notes.h"
[a40eea8]195#include "io/source.h"
[afbd7e7]196#include "io/sink.h"
[04c8346]197#include "synth/sampler.h"
[dd15573]198#include "synth/wavetable.h"
[509e8f9]199#include "utils/parameter.h"
[c8228c7]200#include "utils/log.h"
[83963b3]201
202#if AUBIO_UNSTABLE
203#include "mathutils.h"
[2fcb973]204#include "io/source_sndfile.h"
205#include "io/source_apple_audio.h"
[1b0755d]206#include "io/source_avcodec.h"
[5158c22]207#include "io/source_wavread.h"
[2fcb973]208#include "io/sink_sndfile.h"
209#include "io/sink_apple_audio.h"
[52ca8a3]210#include "io/sink_wavwrite.h"
[df5eab4]211#include "io/audio_unit.h"
[2fcb973]212#include "onset/peakpicker.h"
[2d8cffa]213#include "pitch/pitchmcomb.h"
214#include "pitch/pitchyin.h"
215#include "pitch/pitchyinfft.h"
216#include "pitch/pitchschmitt.h"
217#include "pitch/pitchfcomb.h"
[258d441]218#include "pitch/pitchspecacf.h"
[bcf38fe]219#include "tempo/beattracking.h"
[2fcb973]220#include "utils/scale.h"
221#include "utils/hist.h"
[83963b3]222#endif
[96fb8ad]223
224#ifdef __cplusplus
225} /* extern "C" */
226#endif
227
228#endif
Note: See TracBrowser for help on using the repository browser.