Changeset ffd10fb for src/notes/notes.c


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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.