Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/pitch/pitch.c

    rce3ff2b rafa21cdc  
    9797static void aubio_pitch_do_specacf (aubio_pitch_t * p, const fvec_t * ibuf, fvec_t * obuf);
    9898
    99 /* conversion functions for frequency conversions */
    100 smpl_t freqconvbin (smpl_t f, uint_t samplerate, uint_t bufsize);
    101 smpl_t freqconvmidi (smpl_t f, uint_t samplerate, uint_t bufsize);
    102 smpl_t freqconvpass (smpl_t f, uint_t samplerate, uint_t bufsize);
     99/* internal functions for frequency conversion */
     100static smpl_t freqconvbin (smpl_t f, uint_t samplerate, uint_t bufsize);
     101static smpl_t freqconvmidi (smpl_t f, uint_t samplerate, uint_t bufsize);
     102static smpl_t freqconvpass (smpl_t f, uint_t samplerate, uint_t bufsize);
    103103
    104104/* adapter to stack ibuf new samples at the end of buf, and trim `buf` to `bufsize` */
     
    127127    pitch_type = aubio_pitcht_default;
    128128  else {
    129     AUBIO_ERR ("unknown pitch detection method %s, using default.\n",
    130         pitch_mode);
    131     pitch_type = aubio_pitcht_default;
     129    AUBIO_ERR ("pitch: unknown pitch detection method ‘%s’\n", pitch_mode);
     130    goto beach;
    132131  }
    133132
     
    284283    pitch_mode = aubio_pitchm_default;
    285284  else {
    286     AUBIO_ERR ("unknown pitch detection unit %s, using default\n", pitch_unit);
     285    AUBIO_WRN("pitch: unknown pitch detection unit ‘%s’, using default\n",
     286        pitch_unit);
    287287    pitch_mode = aubio_pitchm_default;
    288288    err = AUBIO_FAIL;
     
    325325}
    326326
     327smpl_t
     328aubio_pitch_get_tolerance (aubio_pitch_t * p)
     329{
     330  smpl_t tolerance = 1.;
     331  switch (p->type) {
     332    case aubio_pitcht_yin:
     333      tolerance = aubio_pitchyin_get_tolerance (p->p_object);
     334      break;
     335    case aubio_pitcht_yinfft:
     336      tolerance = aubio_pitchyinfft_get_tolerance (p->p_object);
     337      break;
     338    default:
     339      break;
     340  }
     341  return tolerance;
     342}
     343
    327344uint_t
    328345aubio_pitch_set_silence (aubio_pitch_t * p, smpl_t silence)
     
    332349    return AUBIO_OK;
    333350  } else {
    334     AUBIO_ERR("pitch: could not set silence to %.2f", silence);
     351    AUBIO_WRN("pitch: could not set silence to %.2f\n", silence);
    335352    return AUBIO_FAIL;
    336353  }
Note: See TracChangeset for help on using the changeset viewer.