Bends the frequency by the given amount of seminotes.
Creates the alpha value for a HP20 filter. Filter formula: y[n] = (y[n-1] + x[n] - x[n-1]) * alpha Where alpha is: 1 / (1 + 2 * pi * timeConstantInSeconds * samplerate)
Calculates the time factor for an LP6 filter. Filter formula: y[n] = y[n-1] + (x[n] - y[n-1]) * factor Where factor is: 1.0 - exp(-1.0 / (timeConstantInSeconds * samplerate))
Converts a 32 bit extended integer stream to 32 bit floating point.
Converts MIDI 1.0 14 bit control values to MIDI 2.0 32 bit. Might not work the best with certain values.
Calculates biquad band pass filter (constant skirt gain, peak gain = Q) filter coefficients from the supplied values.
Calculates biquad band pass filter (constant 0 db peak gain) filter coefficients from the supplied values.
Calculates biquad high-pass filter coefficients from the supplied values.
Calculates biquad low-pass filter coefficients from the supplied values.
Decodes an amount of 16 bit signed PCM to extended 32 bit. Amount is decided by dest.length. src is a full waveform. Position is stored in wp.pos.
Decodes an amount of 4 bit Oki/Dialogic ADPCM stream to extended 32 bit. Amount is decided by dest.length. src is a full waveform. Position is stored in wp.pos.
Decodes an amount of 4 bit IMA ADPCM stream to extended 32 bit. Amount is decided by dest.length. src is a full waveform. Position is stored in wp.pos.
Decodes an amount of 8 bit unsigned PCM to extended 32 bit. Amount is decided by dest.length. src is a full waveform. Position is stored in wp.pos.
Decodes an A-Law encoded stream.
Decodes a Mu-Law encoded stream.
Original algorithm for C++ by Martin Leitner-Ankerl (https://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/). Computes the power of a on the bth much faster than std.math.pow, at the cost of some accuracy. Good enough for envelop curve shaping.
Returns the Cubic Lagrange coefficients for the supplied positions
Returns the Cubic Lagrange coefficients for positions -1, 0, 1, 2.
Interleaves two channels. dest must be as big as the length of srcL and srcR.
Converts MIDI note to frequency.
Mixes an audio stream to the destination.
Converts note number to frequency.
Sets an array (buffer) to all zeros.
Streches a buffer to the given amount using no interpolation. Amount decided by dest.length. Can be used to pitch the sample.
For IMA ADPCM Needs less storage at the cost of worse quality
For IMA ADPCM Needs less storage at the cost of worse quality
For IMA and Dialogic ADPCM Standard quality and size
For IMA ADPCM Better quality, but needs more storage
Used for decoding A-Law encoded PCM streams.
Most OKI and Yamaha chips seems to use this step-table
Used by IMA ADPCM and its derivatives.
Used for decoding Mu-Law encoded PCM samples
For the Yamaha ADPCM A found in YM2610 and probably other chips
Constant for fast integer to floating point conversion