2 Copyright (C) 2003 Paul Brossier
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 Generic method for pitch detection
30 This file creates the objects required for the computation of the selected
31 pitch detection algorithm and output the results, in midi note or Hz.
35 /** pitch detection object */
36 typedef struct _aubio_pitch_t aubio_pitch_t;
38 /** execute pitch detection on an input signal frame
40 \param o pitch detection object as returned by new_aubio_pitch()
41 \param in input signal of size [hopsize x channels]
42 \param out output pitch candidates of size [1 x channes]
45 void aubio_pitch_do (aubio_pitch_t * o, fvec_t * in,
48 /** change yin or yinfft tolerance threshold
50 \param o pitch detection object as returned by new_aubio_pitch()
51 \param tol tolerance default is 0.15 for yin and 0.85 for yinfft
54 uint_t aubio_pitch_set_tolerance (aubio_pitch_t * o,
57 /** deletion of the pitch detection object
59 \param o pitch detection object as returned by new_aubio_pitch()
62 void del_aubio_pitch (aubio_pitch_t * o);
64 /** creation of the pitch detection object
66 \param mode set pitch detection algorithm
67 \param bufsize size of the input buffer to analyse
68 \param hopsize step size between two consecutive analysis instant
69 \param channels number of channels to analyse
70 \param samplerate sampling rate of the signal
73 aubio_pitch_t * new_aubio_pitch (char_t * mode,
74 uint_t bufsize, uint_t hopsize, uint_t channels, uint_t samplerate);
76 /** set the output unit of the pitch detection object
78 \param o pitch detection object as returned by new_aubio_pitch()
79 \param mode set pitch units for output
82 uint_t aubio_pitch_set_unit (aubio_pitch_t * o,