00001 /* 00002 Copyright (C) 2003-2014 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 /** \file 00022 00023 Note detection object 00024 00025 */ 00026 00027 #ifndef _AUBIO_NOTES_H 00028 #define _AUBIO_NOTES_H 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 /** notes detection object */ 00035 typedef struct _aubio_notes_t aubio_notes_t; 00036 00037 /** create notes detection object 00038 00039 \param method notes detection type as specified in specdesc.h 00040 \param buf_size buffer size for phase vocoder 00041 \param hop_size hop size for phase vocoder 00042 \param samplerate sampling rate of the input signal 00043 00044 \return newly created ::aubio_notes_t 00045 00046 */ 00047 aubio_notes_t * new_aubio_notes (const char_t * method, 00048 uint_t buf_size, uint_t hop_size, uint_t samplerate); 00049 00050 /** delete notes detection object 00051 00052 \param o notes detection object to delete 00053 00054 */ 00055 void del_aubio_notes(aubio_notes_t * o); 00056 00057 /** execute note detection on an input signal frame 00058 00059 \param o note detection object as returned by new_aubio_notes() 00060 \param input input signal of size [hop_size] 00061 \param output output notes, fvec of length 3 00062 00063 The notes output is a vector of length 3 containing: 00064 - 0. the midi note value, or 0 if no note was found 00065 - 1. the note velocity 00066 - 2. the midi note to turn off 00067 00068 */ 00069 void aubio_notes_do (aubio_notes_t *o, const fvec_t * input, fvec_t * output); 00070 00071 /** set notes detection silence threshold 00072 00073 \param o notes detection object as returned by new_aubio_notes() 00074 \param silence new silence detection threshold 00075 00076 \return 0 on success, non-zero otherwise 00077 00078 */ 00079 uint_t aubio_notes_set_silence(aubio_notes_t * o, smpl_t silence); 00080 00081 /** get notes detection silence threshold 00082 00083 \param o notes detection object as returned by new_aubio_notes() 00084 00085 \return current silence threshold 00086 00087 */ 00088 smpl_t aubio_notes_get_silence(const aubio_notes_t * o); 00089 00090 /** get notes detection minimum inter-onset interval, in millisecond 00091 00092 \param o notes detection object as returned by new_aubio_notes() 00093 00094 \return current minimum inter onset interval 00095 00096 */ 00097 smpl_t aubio_notes_get_minioi_ms(const aubio_notes_t *o); 00098 00099 /** set notes detection minimum inter-onset interval, in millisecond 00100 00101 \param o notes detection object as returned by new_aubio_notes() 00102 \param minioi_ms new inter-onset interval 00103 00104 \return 0 on success, non-zero otherwise 00105 00106 */ 00107 uint_t aubio_notes_set_minioi_ms (aubio_notes_t *o, smpl_t minioi_ms); 00108 00109 #ifdef __cplusplus 00110 } 00111 #endif 00112 00113 #endif /* _AUBIO_NOTES_H */
1.5.6