2 Copyright (C) 2014 Paul Brossier <piem@aubio.org>
4 This file is part of aubio.
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.
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.
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/>.
21 #include "aubio_priv.h"
23 #include "pitch/pitch.h"
24 #include "onset/onset.h"
25 #include "notes/notes.h"
27 struct _aubio_notes_t {
29 uint_t onset_buf_size;
30 uint_t pitch_buf_size;
48 aubio_notes_t * new_aubio_notes (char_t * notes_method,
49 uint_t buf_size, uint_t hop_size, uint_t samplerate) {
50 aubio_notes_t *o = AUBIO_NEW(aubio_notes_t);
52 o->onset_buf_size = buf_size;
53 o->pitch_buf_size = buf_size * 4;
54 o->hop_size = hop_size;
56 o->samplerate = samplerate;
60 if (strcmp(notes_method, "default") != 0) {
61 AUBIO_ERR("unknown notes detection method %s, using default.\n",
65 o->note_buffer = new_fvec(o->median);
66 o->note_buffer2 = new_fvec(o->median);
78 void del_aubio_notes (aubio_notes_t *o) {
79 if (o->note_buffer) del_fvec(o->note_buffer);
80 if (o->note_buffer2) del_fvec(o->note_buffer2);