Changeset a9eb93e


Ignore:
Timestamp:
Sep 21, 2016, 3:55:21 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch
Children:
4292013
Parents:
e2645cb
Message:

src/effects/pitchshift.h: use transpose, not pitchscale

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_code.py

    re2645cb ra9eb93e  
    2020    'method': '"default"',
    2121    'uri': '"none"',
    22     'pitchscale': '1.',
     22    'transpose': '0.',
    2323    }
    2424
  • src/effects/pitchshift.c

    re2645cb ra9eb93e  
    4949aubio_pitchshift_t *
    5050new_aubio_pitchshift (const char_t * mode,
    51     smpl_t pitchscale, uint_t hopsize, uint_t samplerate)
     51    smpl_t transpose, uint_t hopsize, uint_t samplerate)
    5252{
    5353  aubio_pitchshift_t *p = AUBIO_NEW (aubio_pitchshift_t);
    5454  p->samplerate = samplerate;
    5555  p->hopsize = hopsize;
    56   p->timeratio = 1.;
    57   p->pitchscale = pitchscale;
     56  p->pitchscale = 1.;
     57  if (transpose >= -24. && transpose <= 24.) {
     58    p->pitchscale = POW(2., transpose / 12.);
     59  } else {
     60    AUBIO_ERR("pitchshift: transpose should be in the range [-24, 24], got %f\n", transpose);
     61    goto beach;
     62  }
    5863
    5964  p->rboptions = RubberBandOptionProcessRealTime;
  • src/effects/pitchshift.h

    re2645cb ra9eb93e  
    5858
    5959  \param method set pitch shifting algorithm ("default")
    60   \param pitchscale initial pitch scaling factor
     60  \param transpose initial pitch transposition
    6161  \param hop_size step size between two consecutive analysis instant
    6262  \param samplerate sampling rate of the signal
     
    6666*/
    6767aubio_pitchshift_t *new_aubio_pitchshift (const char_t * method,
    68     smpl_t pitchscale, uint_t hop_size, uint_t samplerate);
     68    smpl_t transpose, uint_t hop_size, uint_t samplerate);
    6969
    7070/** get the latency of the pitch shifting object, in samples
Note: See TracChangeset for help on using the changeset viewer.