[96fb8ad] | 1 | /* |
---|
[e6a78ea] | 2 | Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org> |
---|
| 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 | |
---|
| 19 | */ |
---|
[96fb8ad] | 20 | |
---|
[ca1abdd] | 21 | #ifndef PITCH_H |
---|
| 22 | #define PITCH_H |
---|
[96fb8ad] | 23 | |
---|
| 24 | #ifdef __cplusplus |
---|
| 25 | extern "C" { |
---|
| 26 | #endif |
---|
| 27 | |
---|
[f44b111] | 28 | /** \file |
---|
| 29 | |
---|
[6d4ec49] | 30 | Generic method for pitch detection |
---|
[f44b111] | 31 | |
---|
| 32 | This file creates the objects required for the computation of the selected |
---|
| 33 | pitch detection algorithm and output the results, in midi note or Hz. |
---|
| 34 | |
---|
[69b11d8] | 35 | \example pitch/test-pitch.c |
---|
| 36 | |
---|
[f44b111] | 37 | */ |
---|
| 38 | |
---|
| 39 | /** pitch detection object */ |
---|
[ca1abdd] | 40 | typedef struct _aubio_pitch_t aubio_pitch_t; |
---|
[f44b111] | 41 | |
---|
| 42 | /** execute pitch detection on an input signal frame |
---|
[6d4ec49] | 43 | |
---|
[ca1abdd] | 44 | \param o pitch detection object as returned by new_aubio_pitch() |
---|
[168337e] | 45 | \param in input signal of size [hop_size] |
---|
| 46 | \param out output pitch candidates of size [1] |
---|
[6d4ec49] | 47 | |
---|
[f44b111] | 48 | */ |
---|
[fddfa64] | 49 | void aubio_pitch_do (aubio_pitch_t * o, fvec_t * in, fvec_t * out); |
---|
[96fb8ad] | 50 | |
---|
[f44b111] | 51 | /** change yin or yinfft tolerance threshold |
---|
[6d4ec49] | 52 | |
---|
[ca1abdd] | 53 | \param o pitch detection object as returned by new_aubio_pitch() |
---|
[93177fa] | 54 | \param tol tolerance default is 0.15 for yin and 0.85 for yinfft |
---|
[6d4ec49] | 55 | |
---|
[f44b111] | 56 | */ |
---|
[fddfa64] | 57 | uint_t aubio_pitch_set_tolerance (aubio_pitch_t * o, smpl_t tol); |
---|
[f44b111] | 58 | |
---|
| 59 | /** deletion of the pitch detection object |
---|
[6d4ec49] | 60 | |
---|
[ca1abdd] | 61 | \param o pitch detection object as returned by new_aubio_pitch() |
---|
[6d4ec49] | 62 | |
---|
[f44b111] | 63 | */ |
---|
[ca1abdd] | 64 | void del_aubio_pitch (aubio_pitch_t * o); |
---|
[96fb8ad] | 65 | |
---|
[f44b111] | 66 | /** creation of the pitch detection object |
---|
[6d4ec49] | 67 | |
---|
[3ac7cb0] | 68 | \param method set pitch detection algorithm |
---|
| 69 | \param buf_size size of the input buffer to analyse |
---|
| 70 | \param hop_size step size between two consecutive analysis instant |
---|
[6d4ec49] | 71 | \param samplerate sampling rate of the signal |
---|
| 72 | |
---|
[f44b111] | 73 | */ |
---|
[3ac7cb0] | 74 | aubio_pitch_t *new_aubio_pitch (char_t * method, |
---|
[168337e] | 75 | uint_t buf_size, uint_t hop_size, uint_t samplerate); |
---|
[fe163ad] | 76 | |
---|
[93177fa] | 77 | /** set the output unit of the pitch detection object |
---|
| 78 | |
---|
[ca1abdd] | 79 | \param o pitch detection object as returned by new_aubio_pitch() |
---|
[93177fa] | 80 | \param mode set pitch units for output |
---|
| 81 | |
---|
| 82 | */ |
---|
[fddfa64] | 83 | uint_t aubio_pitch_set_unit (aubio_pitch_t * o, char_t * mode); |
---|
[96fb8ad] | 84 | |
---|
[426e6f7] | 85 | /** get the current confidence |
---|
| 86 | |
---|
| 87 | \param o pitch detection object as returned by new_aubio_pitch() |
---|
| 88 | \return the current confidence of the pitch algorithm |
---|
| 89 | |
---|
| 90 | The confidence |
---|
| 91 | |
---|
| 92 | */ |
---|
| 93 | smpl_t aubio_pitch_get_confidence (aubio_pitch_t * o); |
---|
| 94 | |
---|
[96fb8ad] | 95 | #ifdef __cplusplus |
---|
| 96 | } |
---|
| 97 | #endif |
---|
| 98 | |
---|
[ca1abdd] | 99 | #endif /*PITCH_H*/ |
---|