Aviate Audio Multiverse Library
Classes | Enumerations | Functions | Variables
Aviate Namespace Reference

The Aviate library/namespace provides the primary API for working with Multiverse. More...

Classes

class  AudioEffectWrapper
 Audio Effect base class. More...
 
class  RingBuffer
 Customer RingBuffer with random access. More...
 
class  EfxLogger
 
struct  QueuePosition
 QueuePosition is used for storing the index (in an array of queues) and the offset within an audio_block_t data buffer. More...
 
class  AudioDelay
 Audio delays are a very common function in audio processing. More...
 
class  IirBiQuadFilter
 IIR BiQuad Filter - Direct Form I
y[n] = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2] + a1 * y[n-1] + a2 * y[n-2]
Some design tools (like Matlab assume the feedback coefficients 'a' are negated. More...
 
class  IirBiQuadFilterHQ
 A High-precision version of IirBiQuadFilter often necessary for complex, multistage filters. More...
 
class  IirBiQuadFilterFloat
 A single-precision floating-point biquad using CMSIS-DSP hardware instructions. More...
 
class  ParameterAutomation
 The class will automate a parameter using a trigger from a start value to an end value, using either a preprogrammed function or a user-provided LUT. More...
 
class  ParameterAutomationSequence
 This class allows you to create a sequence of automations where each stage has it's own configuration of start, end, function values. More...
 
class  LowFrequencyOscillatorVector
 The LFO is commonly used on modulation effects where some parameter (delay, volume, etc.) is modulated via waveform at a frequency below 20 Hz. More...
 
class  Compressor
 Simple Compressor. More...
 
class  ReportManager
 ReportManager provides a class to allows effects to report information back to the host computer. More...
 
class  SramMemSlot
 This object is used for data transfers to/from the external SPI SRAM. More...
 
class  SramManager
 SramManager provides a class to handle dividing an external SPI RAM into independent slots for general use. More...
 
class  TunerManager
 The TunerManager class provides an API to access the Tuner display on the Multiverse hardware screen. More...
 

Enumerations

enum class  Waveform : unsigned {
  SINE , TRIANGLE , SQUARE , SAWTOOTH ,
  RANDOM , NUM_WAVEFORMS
}
 Supported LFO waveforms. More...
 
enum class  TunerNote : unsigned {
  C_NATURAL = 0 , C_SHARP_D_FLAT , D_NATURAL , D_SHARP_E_FLAT ,
  E_NATURAL , F_NATURAL , F_SHARP_G_FLAT , G_NATURAL ,
  G_SHARP , A_FLAT , A_NATURAL , A_SHARP_B_FLAT ,
  B_NATURAL , NO_DETECT
}
 enum to specify detected notes to the TunerManager
 

Functions

QueuePosition AVIATE_API calcQueuePosition (float milliseconds)
 Calculate the exact sample position in an array of audio blocks that corresponds to a particular offset given as time. More...
 
QueuePosition AVIATE_API calcQueuePosition (size_t numSamples)
 Calculate the exact sample position in an array of audio blocks that corresponds to a particular offset given as a number of samples. More...
 
size_t AVIATE_API calcAudioSamples (float milliseconds)
 Calculate the number of audio samples (rounded up) that correspond to a given length of time. More...
 
float AVIATE_API calcAudioTimeMs (size_t numSamples)
 Calculate a length of time in milliseconds from the number of audio samples. More...
 
size_t AVIATE_API calcOffset (QueuePosition position)
 Calculate the number of audio samples (usually an offset) from a queue position. More...
 
void AVIATE_API clearAudioBlock (audio_block_t *block)
 Clear the contents of an audio block to zero. More...
 
void AVIATE_API alphaBlend (audio_block_t *out, audio_block_t *dry, audio_block_t *wet, float mix)
 Perform an alpha blend between to audio blocks. Performs
out = dry*(1-mix) + wet*(mix) More...
 
void AVIATE_API gainAdjust (audio_block_t *out, audio_block_t *in, float vol, int coeffShift=0)
 Applies a gain to the audio via fixed-point scaling according to
out = int * (vol * 2^coeffShift) More...
 
void AVIATE_API combine (audio_block_t *out, audio_block_t *in0, audio_block_t *in1)
 Combine two audio blocks through vector addition out[n] = in0[n] + in1[n]. More...
 
float AVIATE_API calcVolumeExp (float volumeIn)
 Calculate an exponential volume from a linear volume. E.g. convert a linear volume curve to an exponentional one that better matches human loudness perception. More...
 
float AVIATE_API convertLinearToLogPow (float inputValue, float midpoint=0.8f)
 Apply a non-linear taper to a normalized control. Input value must be between [0.0, 1.0]. Return value will be between [0.0, 1.0]. Recommend midpoint=0.8f for a pseudo-logarithmic curve (i.e. volume taper) and mdipoint 0.2f for an exponential taper. More...
 
float AVIATE_API log2Fast (float input)
 Fast log2() implementation. More...
 
float AVIATE_API log10Fast (float input)
 Fast log10() implementation. More...
 
float AVIATE_API dbfsFast (int16_t inputAbs)
 Fast convert 16-bit positive audio sample to dbFS value (decibal fullscale) More...
 
float dbfsFast (float inputAbs)
 Fast convert positive float value to dbFS value (decibal fullscale) More...
 
uint16_t AVIATE_API getPeakAbsIntegerValue (const int16_t *audioDataPtr)
 get the peak absolute value as from an audio block More...
 
template<typename T >
T AVIATE_API saturate (T val, T min, T max)
 min/max function More...
 

Variables

EfxLogger efxLogger
 
const size_t AUDIO_BLOCK_SIZE_BYTES
 size of an audio block in bytes
 
constexpr int MAX_PARAMETER_SEQUENCES = 32
 Maximum number of automation sequences.
 
volatile ReportManagerreportManagerPtr
 pointer to global SramManager pointer
 
volatile SramManagersramManagerPtr
 pointer to global SramManager pointer
 
TunerManagertunerManagerPtr
 pointer to global TunerManager pointer
 

Detailed Description

The Aviate library/namespace provides the primary API for working with Multiverse.

Enumeration Type Documentation

◆ Waveform

enum Aviate::Waveform : unsigned
strong

Supported LFO waveforms.

Enumerator
SINE 

sinewave

TRIANGLE 

triangle wave

SQUARE 

square wave

SAWTOOTH 

sawtooth wave

RANDOM 

a non-repeating random waveform

NUM_WAVEFORMS 

the number of defined waveforms

Function Documentation

◆ alphaBlend()

void AVIATE_API Aviate::alphaBlend ( audio_block_t *  out,
audio_block_t *  dry,
audio_block_t *  wet,
float  mix 
)

Perform an alpha blend between to audio blocks. Performs
out = dry*(1-mix) + wet*(mix)

Parameters
outpointer to the destination audio block
drypointer to the dry audio
wetpointer to the wet audio
mixfloat between 0.0 and 1.0.
Returns
void

◆ calcAudioSamples()

size_t AVIATE_API Aviate::calcAudioSamples ( float  milliseconds)

Calculate the number of audio samples (rounded up) that correspond to a given length of time.

Parameters
millisecondslength of the interval in milliseconds
Returns
the number of corresonding audio samples.

◆ calcAudioTimeMs()

float AVIATE_API Aviate::calcAudioTimeMs ( size_t  numSamples)

Calculate a length of time in milliseconds from the number of audio samples.

Parameters
numSamplesNumber of audio samples to convert to time
Returns
the equivalent time in milliseconds.

◆ calcOffset()

size_t AVIATE_API Aviate::calcOffset ( QueuePosition  position)

Calculate the number of audio samples (usually an offset) from a queue position.

Parameters
positionspecifies the index and offset within a queue
Returns
the number of samples from the start of the queue array to the specified position.

◆ calcQueuePosition() [1/2]

QueuePosition AVIATE_API Aviate::calcQueuePosition ( float  milliseconds)

Calculate the exact sample position in an array of audio blocks that corresponds to a particular offset given as time.

Parameters
millisecondslength of the interval in milliseconds
Returns
a struct containing the index and offset

◆ calcQueuePosition() [2/2]

QueuePosition AVIATE_API Aviate::calcQueuePosition ( size_t  numSamples)

Calculate the exact sample position in an array of audio blocks that corresponds to a particular offset given as a number of samples.

Parameters
numSampleslength of the interval in audio samples
Returns
a struct containing the index and offset

◆ calcVolumeExp()

float AVIATE_API Aviate::calcVolumeExp ( float  volumeIn)

Calculate an exponential volume from a linear volume. E.g. convert a linear volume curve to an exponentional one that better matches human loudness perception.

Parameters
volumeInvalue between 0 and 1.0 representing a linear volume. E.g. 0.5f means you perceived 50% volume
Returns
a volume scaling factor between 0 and 1.0 using an exponential approximation

◆ clearAudioBlock()

void AVIATE_API Aviate::clearAudioBlock ( audio_block_t *  block)

Clear the contents of an audio block to zero.

Parameters
blockpointer to the audio block to clear
Returns
void

◆ combine()

void AVIATE_API Aviate::combine ( audio_block_t *  out,
audio_block_t *  in0,
audio_block_t *  in1 
)

Combine two audio blocks through vector addition out[n] = in0[n] + in1[n].

Parameters
outpointer to output audio block
in0pointer to first input audio block to combine
in1pointer to second input audio block to combine
Returns
void

◆ convertLinearToLogPow()

float AVIATE_API Aviate::convertLinearToLogPow ( float  inputValue,
float  midpoint = 0.8f 
)

Apply a non-linear taper to a normalized control. Input value must be between [0.0, 1.0]. Return value will be between [0.0, 1.0]. Recommend midpoint=0.8f for a pseudo-logarithmic curve (i.e. volume taper) and mdipoint 0.2f for an exponential taper.

When midpoint is 0.5, the function is approximately linear (so not very interesting.) Values > 0.5 will take the top end of the linear scale and shift it down. This is good for controls where all the interesting values are at the top end. Use midpoint < 0.5 to make it exponential, so the low end of the linear scale is expanded, and the top end is compressed.

◆ dbfsFast() [1/2]

float Aviate::dbfsFast ( float  inputAbs)

Fast convert positive float value to dbFS value (decibal fullscale)

Parameters
inputAbsinput float audio sample (must be positive)
Returns
dbFS value of the input sample as float

◆ dbfsFast() [2/2]

float AVIATE_API Aviate::dbfsFast ( int16_t  inputAbs)

Fast convert 16-bit positive audio sample to dbFS value (decibal fullscale)

Parameters
inputAbsinput 16-bit audio sample (must be positive)
Returns
dbFS value of the input sample as float

◆ gainAdjust()

void AVIATE_API Aviate::gainAdjust ( audio_block_t *  out,
audio_block_t *  in,
float  vol,
int  coeffShift = 0 
)

Applies a gain to the audio via fixed-point scaling according to
out = int * (vol * 2^coeffShift)

Parameters
outpointer to output audio block
inpointer to input audio block
volvolume coefficient between -1.0 and +1.0
coeffShiftnumber of bits to shift the coefficient
Returns
void

◆ getPeakAbsIntegerValue()

uint16_t AVIATE_API Aviate::getPeakAbsIntegerValue ( const int16_t *  audioDataPtr)

get the peak absolute value as from an audio block

Parameters
audioDataPtrpointer to an audio block of integer data
Returns
the peak value

◆ log10Fast()

float AVIATE_API Aviate::log10Fast ( float  input)

Fast log10() implementation.

Parameters
inputinput float value
Returns
log10(input)

◆ log2Fast()

float AVIATE_API Aviate::log2Fast ( float  input)

Fast log2() implementation.

Parameters
inputinput float value
Returns
log2(input)

◆ saturate()

template<typename T >
T AVIATE_API Aviate::saturate ( val,
min,
max 
)

min/max function

Template Parameters
Tthe data type
Parameters
valthe value to saturate
minthe minimum return value
maxthe maximum return value
Returns
max(val)