source: src/notes/notes.h @ 8d38841

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

src/notes/notes.h: add _{get,set}_silence methods

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2  Copyright (C) 2003-2014 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*/
20
21#ifndef _AUBIO_NOTES_H
22#define _AUBIO_NOTES_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/** notes detection object */
29typedef struct _aubio_notes_t aubio_notes_t;
30
31/** create notes detection object
32
33  \param method notes detection type as specified in specdesc.h
34  \param buf_size buffer size for phase vocoder
35  \param hop_size hop size for phase vocoder
36  \param samplerate sampling rate of the input signal
37
38  \return newly created ::aubio_notes_t
39
40*/
41aubio_notes_t * new_aubio_notes (const char_t * method,
42    uint_t buf_size, uint_t hop_size, uint_t samplerate);
43
44/** delete notes detection object
45
46  \param o notes detection object to delete
47
48*/
49void del_aubio_notes(aubio_notes_t * o);
50
51/** execute note detection on an input signal frame
52
53  \param o note detection object as returned by new_aubio_notes()
54  \param input input signal of size [hop_size]
55  \param output output notes, fvec of length 3
56
57  The notes output is a vector of length 3 containing:
58   - 0. the midi note value, or 0 if no note was found
59   - 1. the note velocity
60   - 2. the midi note to turn off
61
62*/
63void aubio_notes_do (aubio_notes_t *o, const fvec_t * input, fvec_t * output);
64
65/** set notes detection silence threshold
66
67  \param o notes detection object as returned by new_aubio_notes()
68  \param silence new silence detection threshold
69
70*/
71uint_t aubio_notes_set_silence(aubio_notes_t * o, smpl_t silence);
72
73/** get notes detection silence threshold
74
75  \param o notes detection object as returned by new_aubio_notes()
76
77  \return current silence threshold
78
79*/
80smpl_t aubio_notes_get_silence(const aubio_notes_t * o);
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif /* _AUBIO_NOTES_H */
Note: See TracBrowser for help on using the repository browser.