DSP Functions

Superpowered offers some general purpose efficient DSP functions to use throughout your projects. These include:

  • Applying volume of an audio buffer (gain).
  • Changing volume of an audio buffer with a smooth ramp.
  • Mixing audio to existing audio in a buffer (with or without changing volume).
  • Crossfading audio between two buffers.
  • Getting the peak absolute audio sample value in a buffer.
  • Converting 32-bit, 24-bit and 16-bit audio in floating point or signed integer formats.
  • Interleaving or de-interleaving.

Please a look at the list of functions available to find the tool you need.

  • Add1

    METHOD
    Adds the values in input to the values in output: output[n] += input[n].
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Input data.
    outputNumber (pointer in Linear Memory)Output data.
    numberOfItemsNumberThe length of input.
    Returns
    None
  • Add1

    METHOD
    Adds the values in input to the values in output: output[n] += input[n].
    Parameters
    NameTypeDefaultDescription
    inputfloat *Input data.
    outputfloat *Output data.
    numberOfItemsunsigned intThe length of input.
    Returns
    None
  • Add2

    METHOD
    Adds the values in two inputs to the values in output: output[n] += inputA[n] + inputB[n].
    Parameters
    NameTypeDescription
    inputANumber (pointer in Linear Memory)Input data.
    inputBNumber (pointer in Linear Memory)Input data.
    outputNumber (pointer in Linear Memory)Output data.
    numberOfItemsNumberThe length of input.
    Returns
    None
  • Add2

    METHOD
    Adds the values in two inputs to the values in output: output[n] += inputA[n] + inputB[n].
    Parameters
    NameTypeDefaultDescription
    inputAfloat *Input data.
    inputBfloat *Input data.
    outputfloat *Output data.
    numberOfItemsunsigned intThe length of input.
    Returns
    None
  • Add4

    METHOD
    Adds the values in four inputs to the values in output: output[n] += inputA[n] + inputB[n] + inputC[n] + inputD[n].
    Parameters
    NameTypeDescription
    inputANumber (pointer in Linear Memory)Input data.
    inputBNumber (pointer in Linear Memory)Input data.
    inputCNumber (pointer in Linear Memory)Input data.
    inputDNumber (pointer in Linear Memory)Input data.
    outputNumber (pointer in Linear Memory)Output data.
    numberOfItemsNumberThe length of input.
    Returns
    None
  • Add4

    METHOD
    Adds the values in four inputs to the values in output: output[n] += inputA[n] + inputB[n] + inputC[n] + inputD[n].
    Parameters
    NameTypeDefaultDescription
    inputAfloat *Input data.
    inputBfloat *Input data.
    inputCfloat *Input data.
    inputDfloat *Input data.
    outputfloat *Output data.
    numberOfItemsunsigned intThe length of input.
    Returns
    None
  • Bit24ToFloat

    METHOD
    Converts 24-bit audio to 32-bit floating point.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)24-bit input.
    outputNumber (pointer in Linear Memory)32-bit output.
    numberOfFramesNumberThe number of frames to process.
    numberOfChannelsNumberThe number of channels.
    Returns
    None
  • Bit24ToFloat

    METHOD
    Converts 24-bit audio to 32-bit floating point.
    Parameters
    NameTypeDefaultDescription
    inputvoid *24-bit input.
    outputfloat *32-bit output.
    numberOfFramesunsigned intThe number of frames to process.
    numberOfChannelsunsigned int2The number of channels.
    Returns
    None
  • ChangeVolume

    METHOD
    Applies volume on a single stereo interleaved buffer: output = input * gain.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit interleaved stereo input.
    outputNumber (pointer in Linear Memory)32-bit interleaved stereo output. Can be equal to input (in-place processing).
    volumeStartNumberVolume for the first frame.
    volumeChangeNumberChange volume by this amount for every frame.
    numberOfFramesNumberNumber of frames to process.
    Returns
    None
  • ChangeVolume

    METHOD
    Applies volume on a single stereo interleaved buffer: output = input * gain.
    Parameters
    NameTypeDefaultDescription
    inputfloat *32-bit interleaved stereo input.
    outputfloat *32-bit interleaved stereo output. Can be equal to input (in-place processing).
    volumeStartfloatVolume for the first frame.
    volumeChangefloatChange volume by this amount for every frame.
    numberOfFramesunsigned intNumber of frames to process.
    Returns
    None
  • ChangeVolumeAdd

    METHOD
    Applies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit interleaved stereo input.
    outputNumber (pointer in Linear Memory)32-bit interleaved stereo output. Can be equal to input (in-place processing).
    volumeStartNumberVolume for the first frame.
    volumeChangeNumberChange volume by this amount for every frame.
    numberOfFramesNumberNumber of frames to process.
    Returns
    None
  • ChangeVolumeAdd

    METHOD
    Applies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.
    Parameters
    NameTypeDefaultDescription
    inputfloat *32-bit interleaved stereo input.
    outputfloat *32-bit interleaved stereo output. Can be equal to input (in-place processing).
    volumeStartfloatVolume for the first frame.
    volumeChangefloatChange volume by this amount for every frame.
    numberOfFramesNumberNumber of frames to process.
    Returns
    None
  • CharToFloat

    METHOD
    Converts 8-bit audio to 32-bit floating point.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)8-bit input.
    outputNumber (pointer in Linear Memory)32-bit output.
    numberOfFramesNumberThe number of frames to process.
    numberOfChannelsNumberThe number of channels.
    Returns
    None
  • CharToFloat

    METHOD
    Converts 8-bit audio to 32-bit floating point.
    Parameters
    NameTypeDefaultDescription
    inputsigned char *8-bit input.
    outputfloat *32-bit output.
    numberOfFramesunsigned intThe number of frames to process.
    numberOfChannelsunsigned int2The number of channels.
    Returns
    None
  • CopyMonoFromInterleaved

    METHOD
    Copy mono audio from an interleaved buffer.
    Parameters
    NameTypeDescription
    interleavedInputNumber (pointer in Linear Memory)Interleaved input.
    numInterleavedChannelsNumberThe total number of channels in the interleaved input.
    monoOutputNumber (pointer in Linear Memory)Mono output.
    channelIndexNumberCopy this channel.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • CopyMonoFromInterleaved

    METHOD
    Copy mono audio from an interleaved buffer.
    Parameters
    NameTypeDefaultDescription
    interleavedInputfloat *Interleaved input.
    numInterleavedChannelsunsigned intThe total number of channels in the interleaved input.
    monoOutputfloat *Mono output.
    channelIndexunsigned intCopy this channel.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • CopyMonoToInterleaved

    METHOD
    Copy a mono channel into an interleaved buffer.
    Parameters
    NameTypeDescription
    monoInputNumber (pointer in Linear Memory)Mono input.
    channelIndexNumberCopy to this channel.
    interleavedOutputNumber (pointer in Linear Memory)Interleaved output.
    numInterleavedChannelsNumberThe total number of channels in the interleaved output.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • CopyMonoToInterleaved

    METHOD
    Copy a mono channel into an interleaved buffer.
    Parameters
    NameTypeDefaultDescription
    monoInputfloat *Mono input.
    channelIndexunsigned intCopy to this channel.
    interleavedOutputfloat *Interleaved output.
    numInterleavedChannelsunsigned intThe total number of channels in the interleaved output.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • CopyStereoFromInterleaved

    METHOD
    Copy stereo audio from an interleaved buffer.
    Parameters
    NameTypeDescription
    interleavedInputNumber (pointer in Linear Memory)Interleaved input.
    numInterleavedChannelsNumberThe total number of channels in the interleaved input.
    stereoOutputNumber (pointer in Linear Memory)Stereo interleaved output.
    channelIndexNumberCopy this channel. channelIndex is the left side, channelIndex + 1 is the right side.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • CopyStereoFromInterleaved

    METHOD
    Copy stereo audio from an interleaved buffer.
    Parameters
    NameTypeDefaultDescription
    interleavedInputfloat *Interleaved input.
    numInterleavedChannelsunsigned intThe total number of channels in the interleaved input.
    stereoOutputfloat *Stereo interleaved output.
    channelIndexunsigned intCopy this channel. channelIndex is the left side, channelIndex + 1 is the right side.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • CopyStereoToInterleaved

    METHOD
    Copy interleaved stereo into an interleaved buffer.
    Parameters
    NameTypeDescription
    stereoInputNumber (pointer in Linear Memory)Stereo interleaved input.
    channelIndexNumberCopy to this channel pair. eg with 2: left channel goes to 2, right channel goes to 2 + 1.
    interleavedOutputNumber (pointer in Linear Memory)Interleaved output.
    numInterleavedChannelsNumberThe total number of channels in the interleaved output.
    numberOfFramesNumberThe number of frames to process.
    multiplierNumberMultiply the output with this number (constant volume).
    Returns
    None
  • CopyStereoToInterleaved

    METHOD
    Copy interleaved stereo into an interleaved buffer.
    Parameters
    NameTypeDefaultDescription
    stereoInputfloat *Stereo interleaved input.
    channelIndexunsigned intCopy to this channel pair. eg with 2: left channel goes to 2, right channel goes to 2 + 1.
    interleavedOutputfloat *Interleaved output.
    numInterleavedChannelsunsigned intThe total number of channels in the interleaved output.
    numberOfFramesunsigned intThe number of frames to process.
    multiplierfloatMultiply the output with this number (constant volume).
    Returns
    None
  • CrossMono

    METHOD
    Crossfades two mono input channels into a mono output: output = inputA * gain + inputB + gain.
    Parameters
    NameTypeDescription
    inputANumber (pointer in Linear Memory)First mono input.
    inputBNumber (pointer in Linear Memory)Second mono input.
    outputNumber (pointer in Linear Memory)Mono output. Can be equal with one of the inputs (in-place processing).
    inputAGainStartNumberGain of the first sample on the first input.
    inputAGainEndNumberGain for the last sample on the first input. Gain will be smoothly calculated between start and end.
    inputBGainStartNumberGain of the first sample on the second input.
    inputBGainEndNumberGain for the last sample on the second input. Gain will be smoothly calculated between start and end.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • CrossMono

    METHOD
    Crossfades two mono input channels into a mono output: output = inputA * gain + inputB + gain.
    Parameters
    NameTypeDefaultDescription
    inputAfloat *First mono input.
    inputBfloat *Second mono input.
    outputfloat *Mono output. Can be equal with one of the inputs (in-place processing).
    inputAGainStartfloatGain of the first sample on the first input.
    inputAGainEndfloatGain for the last sample on the first input. Gain will be smoothly calculated between start and end.
    inputBGainStartfloatGain of the first sample on the second input.
    inputBGainEndfloatGain for the last sample on the second input. Gain will be smoothly calculated between start and end.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • CrossStereo

    METHOD
    Crossfades two stereo inputs into a stereo output: output = inputA * gain + inputB + gain.
    Parameters
    NameTypeDescription
    inputANumber (pointer in Linear Memory)First stereo input.
    inputBNumber (pointer in Linear Memory)Second stereo input.
    outputNumber (pointer in Linear Memory)Stereo output. Can be equal with one of the inputs (in-place processing).
    inputAGainStartNumberGain of the first sample on the first input.
    inputAGainEndNumberGain for the last sample on the first input. Gain will be smoothly calculated between start and end.
    inputBGainStartNumberGain of the first sample on the second input.
    inputBGainEndNumberGain for the last sample on the second input. Gain will be smoothly calculated between start and end.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • CrossStereo

    METHOD
    Crossfades two stereo inputs into a stereo output: output = inputA * gain + inputB + gain.
    Parameters
    NameTypeDefaultDescription
    inputAfloat *First stereo input.
    inputBfloat *Second stereo input.
    outputfloat *Stereo output. Can be equal with one of the inputs (in-place processing).
    inputAGainStartfloatGain of the first sample on the first input.
    inputAGainEndfloatGain for the last sample on the first input. Gain will be smoothly calculated between start and end.
    inputBGainStartfloatGain of the first sample on the second input.
    inputBGainEndfloatGain for the last sample on the second input. Gain will be smoothly calculated between start and end.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • DeInterleave

    METHOD
    Deinterleaves an interleaved stereo input to two mono output channels: left = [L, L, L, L, ...], right = [R, R, R, R, ...].
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Stereo interleaved input.
    leftNumber (pointer in Linear Memory)Mono output for left channel.
    rightNumber (pointer in Linear Memory)Mono output for right channel.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • DeInterleave

    METHOD
    Deinterleaves an interleaved stereo input to two mono output channels: left = [L, L, L, L, ...], right = [R, R, R, R, ...].
    Parameters
    NameTypeDefaultDescription
    inputfloat *Stereo interleaved input.
    leftfloat *Mono output for left channel.
    rightfloat *Mono output for right channel.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • DeInterleaveAdd

    METHOD
    Deinterleaves an interleaved stereo input and adds the results to the two mono output channels: left = left + [L, L, L, L, ...], right = right + [R, R, R, R, ...]
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Stereo interleaved input.
    leftNumber (pointer in Linear Memory)Mono output for left channel.
    rightNumber (pointer in Linear Memory)Mono output for right channel.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • DeInterleaveAdd

    METHOD
    Deinterleaves an interleaved stereo input and adds the results to the two mono output channels: left = left + [L, L, L, L, ...], right = right + [R, R, R, R, ...]
    Parameters
    NameTypeDefaultDescription
    inputfloat *Stereo interleaved input.
    leftfloat *Mono output for left channel.
    rightfloat *Mono output for right channel.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • DeInterleaveMultiply

    METHOD
    Deinterleaves an interleaved stereo input to two mono output channels and multiplies the output (gain): left = [L, L, L, L, ...] * gain, right = [R, R, R, R, ...] * gain
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Stereo interleaved input.
    leftNumber (pointer in Linear Memory)Mono output for left channel.
    rightNumber (pointer in Linear Memory)Mono output for right channel.
    numberOfFramesNumberThe number of frames to process.
    multiplierNumberMultiply each output sample with this value.
    Returns
    None
  • DeInterleaveMultiply

    METHOD
    Deinterleaves an interleaved stereo input to two mono output channels and multiplies the output (gain): left = [L, L, L, L, ...] * gain, right = [R, R, R, R, ...] * gain
    Parameters
    NameTypeDefaultDescription
    inputfloat *Stereo interleaved input.
    leftfloat *Mono output for left channel.
    rightfloat *Mono output for right channel.
    numberOfFramesunsigned intThe number of frames to process.
    multiplierfloatMultiply each output sample with this value.
    Returns
    None
  • DeInterleaveMultiplyAdd

    METHOD
    Deinterleaves an interleaved stereo input to two mono output channels, multiplies the result (gain) and and adds the results to the two mono output channels: left = left + [L, L, L, L, ...] * gain, right = right + [R, R, R, R, ...] * gain
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Stereo interleaved input.
    leftNumber (pointer in Linear Memory)Mono output for left channel.
    rightNumber (pointer in Linear Memory)Mono output for right channel.
    numberOfFramesNumberThe number of frames to process.
    multiplierNumberMultiply each output sample with this value.
    Returns
    None
  • DeInterleaveMultiplyAdd

    METHOD
    Deinterleaves an interleaved stereo input to two mono output channels, multiplies the result (gain) and and adds the results to the two mono output channels: left = left + [L, L, L, L, ...] * gain, right = right + [R, R, R, R, ...] * gain
    Parameters
    NameTypeDefaultDescription
    inputfloat *Stereo interleaved input.
    leftfloat *Mono output for left channel.
    rightfloat *Mono output for right channel.
    numberOfFramesunsigned intThe number of frames to process.
    multiplierfloatMultiply each output sample with this value.
    Returns
    None
  • DotProduct

    METHOD
    Calculates the dot product of two vectors.
    Parameters
    NameTypeDescription
    inputANumber (pointer in Linear Memory)First input vector.
    inputBNumber (pointer in Linear Memory)Second input vector.
    numValuesNumberNumber of value pairs to process.
    Returns
    TypeDescription
    NumberThe dot product.
  • DotProduct

    METHOD
    Calculates the dot product of two vectors.
    Parameters
    NameTypeDefaultDescription
    inputAfloat *First input vector.
    inputBfloat *Second input vector.
    numValuesunsigned intNumber of value pairs to process.
    Returns
    TypeDescription
    floatThe dot product.
  • FloatTo24bit

    METHOD
    Converts 32-bit floating point audio to 24-bit.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit input.
    outputNumber (pointer in Linear Memory)24-bit output.
    numberOfFramesNumberThe number of frames to process.
    numberOfChannelsNumberThe number of channels.
    Returns
    None
  • FloatTo24bit

    METHOD
    Converts 32-bit floating point audio to 24-bit.
    Parameters
    NameTypeDefaultDescription
    inputfloat *32-bit input.
    outputvoid *24-bit output.
    numberOfFramesunsigned intThe number of frames to process.
    numberOfChannelsunsigned int2The number of channels.
    Returns
    None
  • FloatToChar

    METHOD
    Converts 32-bit floating point audio 8-bit audio.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit input.
    outputNumber (pointer in Linear Memory)8-bit output.
    numberOfFramesNumberThe number of frames to process.
    numberOfChannelsNumberThe number of channels.
    Returns
    None
  • FloatToChar

    METHOD
    Converts 32-bit floating point audio 8-bit audio.
    Parameters
    NameTypeDefaultDescription
    inputfloat *32-bit input.
    outputsigned char *8-bit output.
    numberOfFramesunsigned intThe number of frames to process.
    numberOfChannelsunsigned int2The number of channels.
    Returns
    None
  • FloatToInt

    METHOD
    Converts 32-bit floating point audio to 32-bit integer.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit input.
    outputNumber (pointer in Linear Memory)32-bit output.
    numberOfFramesNumberThe number of frames to process.
    numberOfChannelsNumberThe number of channels.
    Returns
    None
  • FloatToInt

    METHOD
    Converts 32-bit floating point audio to 32-bit integer.
    Parameters
    NameTypeDefaultDescription
    inputfloat *32-bit input.
    outputint *32-bit output.
    numberOfFramesunsigned intThe number of frames to process.
    numberOfChannelsunsigned int2The number of channels.
    Returns
    None
  • FloatToShortInt

    METHOD
    Converts 32-bit float input to 16-bit signed integer output.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit input.
    outputNumber (pointer in Linear Memory)16-bit output.
    numberOfFramesNumberThe number of frames to process.
    numberOfChannelsNumberThe number of channels.
    Returns
    None
  • FloatToShortInt

    METHOD
    Converts 32-bit float input to 16-bit signed integer output.
    Parameters
    NameTypeDefaultDescription
    inputfloat *32-bit input.
    outputshort int *16-bit output.
    numberOfFramesunsigned intThe number of frames to process.
    numberOfChannelsunsigned int2The number of channels.
    Returns
    None
  • FloatToShortIntInterleave

    METHOD
    Converts two 32-bit mono float input channels to stereo interleaved 16-bit signed integer output.
    Parameters
    NameTypeDescription
    inputLeftNumber (pointer in Linear Memory)32-bit input for the left side. Should be numberOfFrames + 8 big minimum.
    inputRightNumber (pointer in Linear Memory)32-bit input for the right side. Should be numberOfFrames + 8 big minimum.
    outputNumber (pointer in Linear Memory)Stereo interleaved 16-bit output. Should be numberOfFrames * 2 + 16 big minimum.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • FloatToShortIntInterleave

    METHOD
    Converts two 32-bit mono float input channels to stereo interleaved 16-bit signed integer output.
    Parameters
    NameTypeDefaultDescription
    inputLeftfloat *32-bit input for the left side. Should be numberOfFrames + 8 big minimum.
    inputRightfloat *32-bit input for the right side. Should be numberOfFrames + 8 big minimum.
    outputshort int *Stereo interleaved 16-bit output. Should be numberOfFrames * 2 + 16 big minimum.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • frequencyOfNote

    METHOD
    Returns the frequency of a specific note.
    Parameters
    NameTypeDescription
    noteNumberThe index of the note. Note 0 is the standard A note at 440 Hz.
    Returns
    TypeDescription
    NumberThe frequency in Hz.
  • frequencyOfNote

    METHOD
    Returns the frequency of a specific note.
    Parameters
    NameTypeDefaultDescription
    noteintThe index of the note. Note 0 is the standard A note at 440 Hz.
    Returns
    TypeDescription
    floatThe frequency in Hz.
  • GetPeaks

    METHOD
    Get the peak values of each channel in an interleaved buffer.
    Parameters
    NameTypeDescription
    interleavedInputNumber (pointer in Linear Memory)Interleaved input.
    numInterleavedChannelsNumberThe total number of channels in the interleaved input.
    numberOfFramesNumberThe number of frames to process.
    peaksNumber (pointer in Linear Memory)Peak value result, should be able to store totalChannels values minimum.
    Returns
    None
  • GetPeaks

    METHOD
    Get the peak values of each channel in an interleaved buffer.
    Parameters
    NameTypeDefaultDescription
    interleavedInputfloat *Interleaved input.
    numInterleavedChannelsunsigned intThe total number of channels in the interleaved input.
    numberOfFramesunsigned intThe number of frames to process.
    peaksfloat *Peak value result, should be able to store totalChannels values minimum.
    Returns
    None
  • HasNonFinite

    METHOD
    Checks if the audio samples has non-valid values, such as infinity or NaN (not a number).
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Floating point numbers to check.
    numberOfValuesNumberNumber of values in the buffer. Please note, this is NOT numberOfFrames. You need to provide the number of floating point numbers in the buffer.
    Returns
    TypeDescription
    Boolean
  • HasNonFinite

    METHOD
    Checks if the audio samples has non-valid values, such as infinity or NaN (not a number).
    Parameters
    NameTypeDefaultDescription
    inputfloat *Floating point numbers to check.
    numberOfValuesunsigned intNumber of values in the buffer. Please note, this is NOT numberOfFrames. You need to provide the number of floating point numbers in the buffer.
    Returns
    TypeDescription
    bool
  • Interleave

    METHOD
    Makes an interleaved stereo output from two mono input channels: output = [L, R, L, R, ...]..
    Parameters
    NameTypeDescription
    leftNumber (pointer in Linear Memory)Mono input for left channel.
    rightNumber (pointer in Linear Memory)Mono input for right channel.
    outputNumber (pointer in Linear Memory)Stereo interleaved output.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • Interleave

    METHOD
    Makes an interleaved stereo output from two mono input channels: output = [L, R, L, R, ...]..
    Parameters
    NameTypeDefaultDescription
    leftfloat *Mono input for left channel.
    rightfloat *Mono input for right channel.
    outputfloat *Stereo interleaved output.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • InterleaveAdd

    METHOD
    Makes an interleaved stereo output from two mono input channels and adds the result to the audio in the output buffer: output = output + [L, R, L, R, ...]
    Parameters
    NameTypeDescription
    leftNumber (pointer in Linear Memory)Mono input for left channel.
    rightNumber (pointer in Linear Memory)Mono input for right channel.
    outputNumber (pointer in Linear Memory)Stereo interleaved output.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • InterleaveAdd

    METHOD
    Makes an interleaved stereo output from two mono input channels and adds the result to the audio in the output buffer: output = output + [L, R, L, R, ...]
    Parameters
    NameTypeDefaultDescription
    leftfloat *Mono input for left channel.
    rightfloat *Mono input for right channel.
    outputfloat *Stereo interleaved output.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • InterleaveAndGetPeaks

    METHOD
    Makes an interleaved output from two input channels and measures the volume: output = [L, R, L, R, ...]
    Parameters
    NameTypeDescription
    leftNumber (pointer in Linear Memory)Mono input for left channel.
    rightNumber (pointer in Linear Memory)Mono input for right channel.
    outputNumber (pointer in Linear Memory)Stereo interleaved output.
    numberOfFramesNumberThe number of frames to process.
    peaksNumber (pointer in Linear Memory)Pointer to two floating point numbers in Linear Memory. Peak value result (left, right).
    Returns
    None
  • InterleaveAndGetPeaks

    METHOD
    Makes an interleaved output from two input channels and measures the volume: output = [L, R, L, R, ...]
    Parameters
    NameTypeDefaultDescription
    leftfloat *Mono input for left channel.
    rightfloat *Mono input for right channel.
    outputfloat *Stereo interleaved output.
    numberOfFramesunsigned intThe number of frames to process.
    peaksfloat *Pointer to two floating point numbers. Peak value result (left, right).
    Returns
    None
  • IntToFloat

    METHOD
    Converts 32-bit integer audio to 32-bit floating point.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit input.
    outputNumber (pointer in Linear Memory)32-bit output.
    numberOfFramesNumberThe number of frames to process.
    numberOfChannelsNumberThe number of channels.
    Returns
    None
  • IntToFloat

    METHOD
    Converts 32-bit integer audio to 32-bit floating point.
    Parameters
    NameTypeDefaultDescription
    inputint *32-bit input.
    outputfloat *32-bit output.
    numberOfFramesunsigned intThe number of frames to process.
    numberOfChannelsunsigned int2The number of channels.
    Returns
    None
  • MidSideToStereo

    METHOD
    Converts a mid-side signal to stereo.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Mid-side interleaved input.
    outputNumber (pointer in Linear Memory)Interleaved stereo output. Can be equal to input (in-place processing).
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • MidSideToStereo

    METHOD
    Converts a mid-side signal to stereo.
    Parameters
    NameTypeDefaultDescription
    inputfloat *Mid-side interleaved input.
    outputfloat *Interleaved stereo output. Can be equal to input (in-place processing).
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • Peak

    METHOD
    Returns the peak absolute value. Useful for metering.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Input values.
    numberOfValuesNumberThe number of values to process. For a stereo input this value should be 2 * numberOfFrames. Must be a multiply of 8.
    Returns
    TypeDescription
    NumberPeak absolute value.
  • Peak

    METHOD
    Returns the peak absolute value. Useful for metering.
    Parameters
    NameTypeDefaultDescription
    inputfloat *Input values.
    numberOfValuesunsigned intThe number of values to process. For a stereo input this value should be 2 * numberOfFrames. Must be a multiply of 8.
    Returns
    TypeDescription
    floatPeak absolute value.
  • ShortIntToFloat

    METHOD
    Converts 16-bit signed integer input to 32-bit float output.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Stereo interleaved 16-bit input.
    outputNumber (pointer in Linear Memory)Stereo interleaved 32-bit output.
    numberOfFramesNumberThe number of frames to process.
    numberOfChannelsNumberThe number of channels.
    Returns
    None
  • ShortIntToFloat

    METHOD
    Converts 16-bit signed integer input to 32-bit float output.
    Parameters
    NameTypeDefaultDescription
    inputshort int *Stereo interleaved 16-bit input.
    outputfloat *Stereo interleaved 32-bit output.
    numberOfFramesunsigned intThe number of frames to process.
    numberOfChannelsunsigned int2The number of channels.
    Returns
    None
  • ShortIntToFloatGetPeaks

    METHOD
    Converts stereo interleaved 16-bit signed integer input to stereo interleaved 32-bit float output, and provides peak measurement.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Stereo interleaved 16-bit input. Should be numberOfFrames + 8 big minimum.
    outputNumber (pointer in Linear Memory)Stereo interleaved 32-bit output. Should be numberOfFrames + 8 big minimum.
    numberOfFramesNumberThe number of frames to process.
    peaksNumber (pointer in Linear Memory)Pointer to two floating point numbers. Peak value result (left, right).
    Returns
    None
  • ShortIntToFloatGetPeaks

    METHOD
    Converts stereo interleaved 16-bit signed integer input to stereo interleaved 32-bit float output, and provides peak measurement.
    Parameters
    NameTypeDefaultDescription
    inputshort int *Stereo interleaved 16-bit input. Should be numberOfFrames + 8 big minimum.
    outputfloat *Stereo interleaved 32-bit output. Should be numberOfFrames + 8 big minimum.
    numberOfFramesunsigned intThe number of frames to process.
    peaksfloat *Pointer to two floating point numbers. Peak value result (left, right).
    Returns
    None
  • StereoToMidSide

    METHOD
    Converts a stereo signal to mid-side.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Interleaved stereo input.
    outputNumber (pointer in Linear Memory)Mid-side interleaved output. Can be equal to input (in-place processing).
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • StereoToMidSide

    METHOD
    Converts a stereo signal to mid-side.
    Parameters
    NameTypeDefaultDescription
    inputfloat *Interleaved stereo input.
    outputfloat *Mid-side interleaved output. Can be equal to input (in-place processing).
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • StereoToMono

    METHOD
    Makes mono output from stereo interleaved input: output = [L + R], [L + R], [L + R], ...
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)Stereo interleaved input.
    outputNumber (pointer in Linear Memory)Mono output.
    leftGainStartNumberGain of the first sample on the left channel.
    leftGainEndNumberGain for the last sample on the left channel. Gain will be smoothly calculated between start and end.
    rightGainStartNumberGain of the first sample on the right channel.
    rightGainEndNumberGain for the last sample on the right channel. Gain will be smoothly calculated between start and end.
    numberOfFramesNumberThe number of frames to process.
    Returns
    None
  • StereoToMono

    METHOD
    Makes mono output from stereo interleaved input: output = [L + R], [L + R], [L + R], ...
    Parameters
    NameTypeDefaultDescription
    inputfloat *Stereo interleaved input.
    outputfloat *Mono output.
    leftGainStartfloatGain of the first sample on the left channel.
    leftGainEndfloatGain for the last sample on the left channel. Gain will be smoothly calculated between start and end.
    rightGainStartfloatGain of the first sample on the right channel.
    rightGainEndfloatGain for the last sample on the right channel. Gain will be smoothly calculated between start and end.
    numberOfFramesunsigned intThe number of frames to process.
    Returns
    None
  • Version

    METHOD
    Returns the current version of the Superpowered SDK.
    Parameters
    None
    Returns
    TypeDescription
    NumberThe returned value is: major version * 10000 + minor version * 100 + revision. Example: 10402 means 1.4.2
  • Version

    METHOD
    Returns the current version of the Superpowered SDK.
    Parameters
    None
    Returns
    TypeDescription
    unsigned intThe returned value is: major version * 10000 + minor version * 100 + revision. Example: 10402 means 1.4.2
  • Volume

    METHOD
    Applies volume on a single stereo interleaved buffer: output = input * gain
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit interleaved stereo input.
    outputNumber (pointer in Linear Memory)32-bit interleaved stereo output. Can be equal to input (in-place processing).
    volumeStartNumberVolume for the first frame.
    volumeEndNumberVolume for the last frame. Volume will be smoothly calculated between the first and last frames.
    numberOfFramesNumberNumber of frames to process.
    Returns
    None
  • Volume

    METHOD
    Applies volume on a single stereo interleaved buffer: output = input * gain
    Parameters
    NameTypeDefaultDescription
    inputfloat *32-bit interleaved stereo input.
    outputfloat *32-bit interleaved stereo output. Can be equal to input (in-place processing).
    volumeStartfloatVolume for the first frame.
    volumeEndfloatVolume for the last frame. Volume will be smoothly calculated between the first and last frames.
    numberOfFramesunsigned intNumber of frames to process.
    Returns
    None
  • VolumeAdd

    METHOD
    Applies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.
    Parameters
    NameTypeDescription
    inputNumber (pointer in Linear Memory)32-bit interleaved stereo input.
    outputNumber (pointer in Linear Memory)32-bit interleaved stereo output. Can be equal to input (in-place processing).
    volumeStartNumberVolume for the first frame.
    volumeEndNumberVolume for the last frame. Volume will be smoothly calculated between the first and last frames
    numberOfFramesNumberNumber of frames to process.
    Returns
    None
  • VolumeAdd

    METHOD
    Applies volume on a single stereo interleaved buffer and adds it to the audio in the output buffer: output = output + input * gain.
    Parameters
    NameTypeDefaultDescription
    inputfloat *32-bit interleaved stereo input.
    outputfloat *32-bit interleaved stereo output. Can be equal to input (in-place processing).
    volumeStartfloatVolume for the first frame.
    volumeEndfloatVolume for the last frame. Volume will be smoothly calculated between the first and last frames
    numberOfFramesunsigned intNumber of frames to process.
    Returns
    None
v2.7.2