Changeset ffd10fb for src


Ignore:
Timestamp:
Oct 3, 2016, 8:46:46 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler, yinfft+
Children:
54eba9d
Parents:
61a1e5d
Message:

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

Location:
src/notes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/notes/notes.c

    r61a1e5d rffd10fb  
    2525#include "notes/notes.h"
    2626
     27#define DEFAULT_NOTES_SILENCE -50.
     28
    2729struct _aubio_notes_t {
    2830
     
    9193  o->newnote = 0.;
    9294
    93   o->silence_threshold = -90.;
     95  aubio_notes_set_silence(o, DEFAULT_NOTES_SILENCE);
    9496
    9597  return o;
     
    98100  del_aubio_notes(o);
    99101  return NULL;
     102}
     103
     104uint_t aubio_notes_set_silence(aubio_notes_t *o, smpl_t silence)
     105{
     106  uint_t err = AUBIO_OK;
     107  if (aubio_pitch_set_silence(o->pitch, silence) != AUBIO_OK) {
     108    err = AUBIO_FAIL;
     109  }
     110  if (aubio_onset_set_silence(o->onset, silence) != AUBIO_OK) {
     111    err = AUBIO_FAIL;
     112  }
     113  return err;
     114}
     115
     116smpl_t aubio_notes_get_silence(const aubio_notes_t *o)
     117{
     118  return aubio_pitch_get_silence(o->pitch);
    100119}
    101120
  • src/notes/notes.h

    r61a1e5d rffd10fb  
    5252
    5353  \param o note detection object as returned by new_aubio_notes()
    54   \param in input signal of size [hop_size]
    55   \param out output notes of size [3] ? FIXME
     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
    5661
    5762*/
    5863void 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);
    5981
    6082#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.