WaveTable2d /

#includecinder/audio/WaveTable.h

Manages an array of tables that is used for bandlimited wavetable synthesis. Supports table lookup with linear interpolation.


Public Member Functions

  • WaveTable2d (size_t sampleRate, size_t tableSize, size_t numTables)
  • void
    fillBandlimited (WaveformType type)
  • float
    lookupBandlimited (float phase, float f0) const
  • float
    lookupBandlimited (float *outputArray, size_t outputLength, float currentPhase, float f0) const
  • float
    lookupBandlimited (float *outputArray, size_t outputLength, float currentPhase, const float *f0Array) const
  • void
    copyTo (float *array, size_t tableIndex) const
  • void
    copyFrom (const float *array, size_t tableIndex)
  • float
    calcBandlimitedTableIndex (float f0) const
  • size_t
    getNumTables () const
  • void
    resize (size_t tableSize)
  • void
    fillSine ()
  • size_t
    getSampleRate () const
  • size_t
    getTableSize () const
  • float
    lookup (float phase) const
  • float
    lookup (float *outputArray, size_t outputLength, float currentPhase, float freq) const
  • float
    lookup (float *outputArray, size_t outputLength, float currentPhase, const float *freqArray) const
  • void
    copyTo (float *array) const
  • void
    copyFrom (const float *array)

Protected Member Functions

  • void
    calcLimits ()
  • void
    fillBandLimitedTable (WaveformType type, float *table, size_t numPartials)
  • size_t
    getMaxHarmonicsForTable (size_t tableIndex) const
  • const float *
    getBandLimitedTable (float f0) const
  • std::tuple< const float *, const float *, float >
    getBandLimitedTablesLerp (float f0) const
  • void
    fillSinesum (float *array, size_t length, const std::vector< float > &partialCoeffs)

Protected Attributes

  • size_t
    mNumTables
  • float
    mMinMidiRange
  • float
    mMaxMidiRange
  • size_t
    mSampleRate
  • size_t
    mTableSize
  • float
    mSamplePeriod
  • mBuffer