Wavetable:
Filter:
Classes | Collections > Ordered

Wavetable : FloatArray : RawArray : ArrayedCollection : SequenceableCollection : Collection : Object

sampled audio buffer in wavetable format
Source: Signal.sc

Description

A Wavetable is a FloatArray in a special format used by SuperCollider's interpolating oscillators. Wavetables cannot be created by new.

Class Methods

Wavetable.sineFill(size, amplitudes, phases)

Fill a Wavetable of the given size with a sum of sines at the given amplitudes and phases. The Wavetable will be normalized.

Arguments:

size

must be a power of 2.

amplitudes

an Array of amplitudes for each harmonic beginning with the fundamental.

phases

an Array of phases in radians for each harmonic beginning with the fundamental.

Wavetable.chebyFill(size, amplitudes, normalize: true, zeroOffset: false)

Fill a Wavetable of the given size with a sum of Chebyshev polynomials at the given amplitudes for use in waveshaping by the Shaper ugen.

Arguments:

size

must be a power of 2 plus 1, eventual wavetable is next power of two size up.

amplitudes

an Array of amplitudes for each Chebyshev polynomial beginning with order 1.

normalize

a Boolean indicating whether to normalize the resulting Wavetable. If the zeroOffset argument is true, the normalization is done for use as a transfer function, using normalizeTransfer, otherwise it just uses normalize to make the absolute peak value 1. Default is true.

zeroOffset

a Boolean indicating whether to offset the middle of each polynomial to zero. If true, then a zero input will always result in a zero output when used as a waveshaper. If false, then the "raw" (unshifted) Chebyshev polynomials are used. Default is false.

Discussion:

NOTE: In previous versions, chebyFill always offset the curves to ensure the center value was zero. The zeroOffset argument was added in version 3.7, and the default behavior was changed, so that it no longer offsets.

Inherited class methods

Undocumented class methods

Wavetable.chebyFill_old(size, amplitudes)

Wavetable.new

Wavetable.newClear

Wavetable.readNew(file)

Instance Methods

.plot: METHOD NOT FOUND!

Plot the Wavetable in a window. The arguments are not required and if not given defaults will be used.

Arguments:

name

a String, the name of the window.

bounds

a Rect giving the bounds of the window.

minval

the minimum value in the plot. Defaults to the highest value in the data.

maxval

the maximum value in the plot. Defaults to the lowest value in the data.

.asSignal

Convert the Wavetable into a Signal.

Advanced notes: wavetable format

This strange format is not a standard linear interpolation (integer + frac), but for (integer part -1) and (1+frac)) due to some efficient maths for integer to float conversion in the underlying C code.

Inherited instance methods

Undocumented instance methods

.blend(anotherWavetable, blendFrac: 0.5)

.write(path)