ape  0.5.0
Audio Programming Environment
Namespaces | Classes | Typedefs | Functions
ape Namespace Reference

Namespaces

 detail
 

Classes

class  AudioFile
 Represents a loaded audio file from disk, as a umatrix More...
 
struct  circular_iterator
 LegacyForwardIterator with capability of iterating N steps around a flat source with an offset. In other words, if exceeding the "end" of any referenced container, it will wrap around and start from the beginning again.

See also
cyclic_begin, cyclic_end
More...
 
struct  circular_signal
 An infinitely indexable read-only signal that repeats the original signal. Supports signed and unsigned integer indices or hermite-interpolated fractional indices. More...
 
struct  consts
 Contains natural / math / utility constants typed as the template parameter More...
 
class  dB
 Provides methods for converting back and forth from decibels More...
 
struct  DynamicSampleMatrix
 An owned 2d rectangular matrix that supports a T** representation and being aliased as a umatrix. More...
 
class  Effect
 An effect is a simple processor that can modify an audio stream. An effect is guaranteed to the same number of inputs and outputs.

See also
GlobalData
More...
 
class  EmbeddedEffect
 A utility class to embed another Effect inside your own. It takes care of initialization. More...
 
class  EmbeddedGenerator
 A utility class to embed another Generator inside your own. It takes care of initialization.

See also
ape::EmbeddedEffect
More...
 
class  EmbeddedProcessor
 Class for easily embedding processors within your processor. Base functionality for EmbeddedEffect and EmbeddedGenerator. More...
 
class  FFT
 A typed FFT.

See also
FFT<float>, FFT<double>
More...
 
class  FFT< double >
 Class for performing power-of-two fast fourier transforms on 64-bit floats More...
 
class  FFT< float >
 Class for performing power-of-two fast fourier transforms on 32-bit floats More...
 
class  FFTBase
 Shared operations on typed FFTs.

See also
FFT<float>, FFT<double>
More...
 
class  Generator
 A generator is a processor that only creates sounds (so it has no inputs).

See also
GlobalData, Effect
More...
 
struct  IOConfig
 Configuration structure with information needed for running a plugin. More...
 
class  Label
 A Label is a printf-like format string displayed to the user, that is automatically updated in the GUI.

See also
print(), SharedValue
More...
 
class  MeteredValue
 A value you can continously assign to (at audio rate), and a meter with a decay in the GUI will display this value. More...
 
class  OutputAudioFile
 Provides capability to record streamed audio asynchronously to a file on disk. More...
 
class  Param
 Template for parameter specializations on different types. Parameters are based on an normalized PFloat the host automates, and automatically converts into a user-provided semantic Range when evaluated at a specific sample. See ParameterBase::at(). More...
 
class  Param< bool >
 A parameter suitable for automated boolean values.

See also
ParameterBase
More...
 
class  Param< double >
 A parameter suitable for automated double values.

See also
ParameterBase
More...
 
class  Param< float >
 A parameter suitable for automated float values.

See also
ParameterBase
More...
 
class  Param< int >
 A parameter suitable for automated integers. Note internally the integer is rounded from a floating point PFloat representation, but quantized before evaluated.

See also
ParameterBase
More...
 
class  Param< T, typename std::is_enum< T >::type >
 A parameter suitable for automating enumeration values. Choices are presented to the user in a combo box.

See also
ParameterBase
More...
 
class  ParameterBase
 Shared functionality for all specializations of parameters.

See also
ParameterBase
More...
 
class  Plot
 Fixed buffer of Plot::value_type elements that is plotted in the UI. More...
 
struct  PrintFormatter
 Helper type to automatically support formatted printing for user defined types through print() More...
 
class  Processor
 
class  ProtoCompiler
 
class  Range
 Represents a mapping function in a interval, suitable for evaluation between 0 .. 1 inclusive, and inversely evaluatable given original interval. Useful for transforming normalized ranges back and forth between a semantic mapping. More...
 
class  RealSourceResampler
 A real-time variably resampled view on a buffer, that wraps around. Capable of producing a batched, resampled slice of audio.

See also
AudioFile
More...
 
class  ResampledAudioFile
 An AudioFile that can be automatically resampled to the project sample rate. More...
 
class  SharedValue
 An assignable (from T ) value to be used as arguments for a Label. You should store these separately, and when you assign to them the linked Label will get updated. More...
 
struct  StatusCode
 Low level error code used in certian comms APIs. More...
 
class  TCCBindings
 
class  TCCDeleter
 
class  TransportEffect
 The same as Effect, except it also can query information about the playhead (TransportProcessor::getPlayHeadPosition(), as well as having play() and pause() callbacks. TransportProcessor for more information.

See also
GlobalData
More...
 
class  TransportGenerator
 A generator is a processor that only creates sounds (so it has no inputs).

See also
GlobalData, Effect
More...
 
class  TransportProcessor
 A Processor with additional access to the transport / playhead of the host. More...
 
struct  uarray
 An unowned array wrapper - a mutable "view" of something else, that cannot be resized. Construction parameters are referenced directly, and no copies of data are ever taken / made. This also means you should take care to ensure referred-to data outlives any uarray. Following that, uarrays should probably only ever exist on the stack. More...
 
class  UIObject
 Base traits class for all classes that are displayed in the GUI. More...
 
struct  umatrix
 A container representing a 2d rectangular array (and can be used syntactically like one). As with uarray, the source contents is unowned and the dimensionality is constant. Row-major order, where each "row" is a channel and can be accessed through a uarray. More...
 
struct  vector_traits
 Traits for vector_register More...
 
struct  windowed_signal
 An infinitely indexable read-only signal that windows the original signal (ie. it is zero outside of the bounds of the source material). Supports signed and unsigned integer indices or hermite-interpolated fractional indices. More...
 

Typedefs

typedef float fpoint
 A typedef for a data type supporting any floating point operation, with variable compile-time precision. The user has the capability to change this to a double for instance. This is a quick way to "template" your code, and hot-recompile it with different precision to evaluate precision / performance.

See also
consts<T>
More...
 
using float_t = fpoint
 Alias for fpoint More...
 
template<typename T >
using vector_register = T __attribute__((ext_vector_type(__CPPAPE_NATIVE_VECTOR_BYTES__/sizeof(T))))
 A machine sized SIMD register with as many lanes as possible for the given T More...
 
typedef std::unique_ptr< TCCState, TCCDeleterUniqueTCC
 

Functions

void * memoryAlloc (std::size_t am, std::size_t align)
 
void memoryFree (void *loc)
 
APE_SharedInterfacegetInterface ()
 Acquire the low-level C API. More...
 
template<typename T >
lanczos (T x, int size)
 Evaluates a lanczos kernel of size size at x More...
 
template<typename T >
sinc (T x)
 Evaluates the sinc() function at x at x More...
 
template<typename T , typename Container >
auto to_complex (const Container &c) -> decltype(std::begin(c), std::end(c), std::vector< std::complex< T >>())
 Converts the entire container c to a vector of complex numbers More...
 
template<typename T , typename Container >
auto to_complex (const Container &c, std::size_t size) -> decltype(std::begin(c), std::end(c), std::vector< std::complex< T >>())
 Converts size elements from the c to a vector of complex numbers More...
 
template<typename T , typename Container >
auto normalize (Container &c, T scale, double threshold=1e-8f) -> decltype(std::begin(c), std::end(c), void())
 Normalize each element in c by the reciprocal square root of scale More...
 
template<typename Container >
auto accumulate_norm (const Container &c) -> decltype(std::begin(c), std::end(c), std::norm(c[0]))
 Returns an accumulation of the norm (square) of each element in the c More...
 
template<typename T , typename Container >
auto multiply (Container &c, T scale) -> decltype(std::begin(c), std::end(c), void())
 Multiplies each element in c by scale More...
 
template<typename T , typename Signal >
lanczosFilter (const Signal &s, double x, long long wsize)
 Do lanczos interpolation at a specific point in a signal. More...
 
template<typename T , typename Signal >
sincFilter (const Signal &s, double x, long long wsize)
 Do sinc interpolation at a specific point in a signal. More...
 
template<typename T >
const T hermite4 (const T offset, const T ym1, const T y0, const T y1, const T y2)
 Do hermite 4 interpolation given the four y-coordinates More...
 
template<typename T , typename Signal >
const T hermite4 (const Signal &s, const T x)
 Do hermite 4 interpolation at a specific point in a signal. More...
 
template<typename T >
const T linear (const T offset, const T y0, const T y1)
 Do simple linear interpolation between two points. More...
 
template<typename T , typename Signal >
const T linear (const Signal &s, const T x)
 Do simple linear interpolation at a specific point in a signal. More...
 
template<typename T , std::size_t Order, typename Signal >
const T lagrange (const Signal &s, const T position) noexcept
 Do lagrange interpolation at a specific point in a signal, of Order order.

See also
lagrange5
More...
 
template<typename T >
const T lagrange5 (const T offset, const T ym2, const T ym1, const T y0, const T y1, const T y2)
 Do lagrange interpolation between the y parameters, with 5 terms. More...
 
std::size_t clamp_available (std::size_t position, std::size_t size, std::size_t available)
 Step N towards size given available "samples", if at position sample. This is a useful utility to count towards a task to be done every size samples, given variably sized sample inputs. More...
 
size_t nextpow2 (size_t current)
 Returns the next power of two, or equivalent to current More...
 
size_t nextpow2above (size_t current)
 Returns the next power of two, above current More...
 
template<typename UIntType >
std::enable_if< std::is_unsigned< UIntType >::value, bool >::type ispow2 (UIntType t)
 Tests whether t is a power of two. More...
 
template<typename Container >
auto cyclic_begin (Container &c, std::size_t offset)
 Constructs a suitable beginning iterator of a cyclic iteration on c . Iteration effectively wraps around, until it compares equal to something returned by cyclic_end. More...
 
template<typename Container >
auto cyclic_end (Container &c, std::size_t offset, std::size_t length)
 Specifies an "end" to cyclic_begin More...
 
template<typename T >
void clear (std::vector< T > &arr) noexcept
 Clear a uarray of non-const qualified T elements to a default-initialized value. More...
 
template<typename T >
std::enable_if<!std::is_const_v< T > >::type clear (uarray< T > arr) noexcept
 Clear a uarray of non-const qualified T elements to a default-initialized value. More...
 
template<typename T >
std::enable_if<!std::is_const_v< T > >::type clear (umatrix< T > mat, std::size_t offset=0) noexcept
 Clear a umatrix of non-const qualified T elements to a default-initialized value. More...
 
template<typename T >
uarray< T > as_uarray (std::vector< T > &vec)
 
template<typename T >
uarray< const T > as_uarray (const std::vector< T > &vec)
 
template<typename T >
uarray< T > as_uarray (T *data, std::size_t size)
 
template<typename T >
uarray< const T > as_uarray (const T *data, std::size_t size)
 
template<typename T >
std::complex< vector_register< T > > operator* (std::complex< vector_register< T >> a, std::complex< vector_register< T >> b)
 
template<typename T >
uarray< vector_register< T > > as_vectors (uarray< T > input)
 Reinterprets the input as a array of SIMD vectors More...
 
template<typename T >
uarray< std::complex< vector_register< T > > > as_vectors (uarray< std::complex< T >> input)
 Reinterprets the input as a array of complex SIMD vectors More...
 
template<typename T >
uarray< vector_register< T > > as_vectors (std::vector< T > &input)
 Reinterprets the input as a array of SIMD vectors More...
 
template<typename T >
uarray< std::complex< vector_register< T > > > as_vectors (std::vector< std::complex< T >> &input)
 Reinterprets the input as a array of complex SIMD vectors More...
 

Typedef Documentation

◆ float_t

using ape::float_t = typedef fpoint

Alias for fpoint

◆ fpoint

typedef float ape::fpoint

A typedef for a data type supporting any floating point operation, with variable compile-time precision. The user has the capability to change this to a double for instance. This is a quick way to "template" your code, and hot-recompile it with different precision to evaluate precision / performance.

See also
consts<T>

Default is 32-bits (ie. a float)

◆ UniqueTCC

typedef std::unique_ptr<TCCState, TCCDeleter> ape::UniqueTCC

◆ vector_register

template<typename T >
using ape::vector_register = typedef T __attribute__((ext_vector_type(__CPPAPE_NATIVE_VECTOR_BYTES__ / sizeof(T))))

A machine sized SIMD register with as many lanes as possible for the given T

Function Documentation

◆ accumulate_norm()

template<typename Container >
auto ape::accumulate_norm ( const Container &  c) -> decltype(std::begin(c), std::end(c), std::norm(c[0]))

Returns an accumulation of the norm (square) of each element in the c

◆ as_uarray() [1/4]

template<typename T >
uarray<const T> ape::as_uarray ( const std::vector< T > &  vec)
inline

◆ as_uarray() [2/4]

template<typename T >
uarray<const T> ape::as_uarray ( const T *  data,
std::size_t  size 
)
inline

◆ as_uarray() [3/4]

template<typename T >
uarray<T> ape::as_uarray ( std::vector< T > &  vec)
inline

◆ as_uarray() [4/4]

template<typename T >
uarray<T> ape::as_uarray ( T *  data,
std::size_t  size 
)
inline

◆ as_vectors() [1/4]

template<typename T >
uarray<std::complex<vector_register<T> > > ape::as_vectors ( std::vector< std::complex< T >> &  input)
inline

Reinterprets the input as a array of complex SIMD vectors

◆ as_vectors() [2/4]

template<typename T >
uarray<vector_register<T> > ape::as_vectors ( std::vector< T > &  input)
inline

Reinterprets the input as a array of SIMD vectors

◆ as_vectors() [3/4]

template<typename T >
uarray<std::complex<vector_register<T> > > ape::as_vectors ( uarray< std::complex< T >>  input)
inline

Reinterprets the input as a array of complex SIMD vectors

◆ as_vectors() [4/4]

template<typename T >
uarray<vector_register<T> > ape::as_vectors ( uarray< T >  input)
inline

Reinterprets the input as a array of SIMD vectors

◆ clamp_available()

std::size_t ape::clamp_available ( std::size_t  position,
std::size_t  size,
std::size_t  available 
)
inline

Step N towards size given available "samples", if at position sample. This is a useful utility to count towards a task to be done every size samples, given variably sized sample inputs.

◆ clear() [1/3]

template<typename T >
void ape::clear ( std::vector< T > &  arr)
inlinenoexcept

Clear a uarray of non-const qualified T elements to a default-initialized value.

◆ clear() [2/3]

template<typename T >
std::enable_if<!std::is_const_v<T> >::type ape::clear ( uarray< T >  arr)
inlinenoexcept

Clear a uarray of non-const qualified T elements to a default-initialized value.

◆ clear() [3/3]

template<typename T >
std::enable_if<!std::is_const_v<T> >::type ape::clear ( umatrix< T >  mat,
std::size_t  offset = 0 
)
inlinenoexcept

Clear a umatrix of non-const qualified T elements to a default-initialized value.

◆ cyclic_begin()

template<typename Container >
auto ape::cyclic_begin ( Container &  c,
std::size_t  offset 
)
inline

Constructs a suitable beginning iterator of a cyclic iteration on c . Iteration effectively wraps around, until it compares equal to something returned by cyclic_end.

Parameters
cAny "container" supporting size() and data()
offsetWhere to start in c .

◆ cyclic_end()

template<typename Container >
auto ape::cyclic_end ( Container &  c,
std::size_t  offset,
std::size_t  length 
)
inline

Specifies an "end" to cyclic_begin

Parameters
cAny "container" supporting size() and data()
offsetWhere to start in c . Must match the parameter given to cyclic_begin!
lengthHow many iterations to be performed before the pair compares equal.

◆ getInterface()

APE_SharedInterface& ape::getInterface ( )

Acquire the low-level C API.

◆ hermite4() [1/2]

template<typename T , typename Signal >
const T ape::hermite4 ( const Signal &  s,
const T  x 
)
inline

Do hermite 4 interpolation at a specific point in a signal.

Template Parameters
SignalA functor object supporting operator().
See also
circular_signal<T>, windowed_signal<T>

◆ hermite4() [2/2]

template<typename T >
const T ape::hermite4 ( const T  offset,
const T  ym1,
const T  y0,
const T  y1,
const T  y2 
)
inline

Do hermite 4 interpolation given the four y-coordinates

Parameters
offsetFractional offset to evaluate

This is Laurent de Soras' algorithm

◆ ispow2()

template<typename UIntType >
std::enable_if<std::is_unsigned<UIntType>::value, bool>::type ape::ispow2 ( UIntType  t)
inline

Tests whether t is a power of two.

◆ lagrange()

template<typename T , std::size_t Order, typename Signal >
const T ape::lagrange ( const Signal &  s,
const T  position 
)
inlinenoexcept

Do lagrange interpolation at a specific point in a signal, of Order order.

See also
lagrange5

Template Parameters
SignalA functor object supporting operator().
See also
circular_signal<T>, windowed_signal<T>

◆ lagrange5()

template<typename T >
const T ape::lagrange5 ( const T  offset,
const T  ym2,
const T  ym1,
const T  y0,
const T  y1,
const T  y2 
)
inline

Do lagrange interpolation between the y parameters, with 5 terms.

Parameters
offsetFractional offset to evaluate.

◆ lanczos()

template<typename T >
T ape::lanczos ( x,
int  size 
)

Evaluates a lanczos kernel of size size at x

If x is 0, the function returns 1.

◆ lanczosFilter()

template<typename T , typename Signal >
T ape::lanczosFilter ( const Signal &  s,
double  x,
long long  wsize 
)
inline

Do lanczos interpolation at a specific point in a signal.

Parameters
wsizeThe kernel size of the lanczos function.
xA fractional point in the s to compute.
Template Parameters
SignalA functor object supporting operator().
See also
circular_signal<T>, windowed_signal<T>

◆ linear() [1/2]

template<typename T , typename Signal >
const T ape::linear ( const Signal &  s,
const T  x 
)
inline

Do simple linear interpolation at a specific point in a signal.

Template Parameters
SignalA functor object supporting operator().
See also
circular_signal<T>, windowed_signal<T>

◆ linear() [2/2]

template<typename T >
const T ape::linear ( const T  offset,
const T  y0,
const T  y1 
)
inline

Do simple linear interpolation between two points.

Parameters
offsetFractional offset to evaluate between y0 and y1

◆ memoryAlloc()

void* ape::memoryAlloc ( std::size_t  am,
std::size_t  align 
)

◆ memoryFree()

void ape::memoryFree ( void *  loc)

◆ multiply()

template<typename T , typename Container >
auto ape::multiply ( Container &  c,
scale 
) -> decltype(std::begin(c), std::end(c), void())

Multiplies each element in c by scale

◆ nextpow2()

size_t ape::nextpow2 ( size_t  current)
inline

Returns the next power of two, or equivalent to current

◆ nextpow2above()

size_t ape::nextpow2above ( size_t  current)
inline

Returns the next power of two, above current

◆ normalize()

template<typename T , typename Container >
auto ape::normalize ( Container &  c,
scale,
double  threshold = 1e-8f 
) -> decltype(std::begin(c), std::end(c), void())

Normalize each element in c by the reciprocal square root of scale

◆ operator*()

template<typename T >
std::complex<vector_register<T> > ape::operator* ( std::complex< vector_register< T >>  a,
std::complex< vector_register< T >>  b 
)
inline

◆ sinc()

template<typename T >
T ape::sinc ( x)

Evaluates the sinc() function at x at x

If x is 0, the function returns 1.

◆ sincFilter()

template<typename T , typename Signal >
T ape::sincFilter ( const Signal &  s,
double  x,
long long  wsize 
)
inline

Do sinc interpolation at a specific point in a signal.

Parameters
wsizeThe kernel size of the sinc function.
xA fractional point in the s to compute.
Template Parameters
SignalA functor object supporting operator().
See also
circular_signal<T>, windowed_signal<T>

◆ to_complex() [1/2]

template<typename T , typename Container >
auto ape::to_complex ( const Container &  c) -> decltype(std::begin(c), std::end(c), std::vector<std::complex<T>>())

Converts the entire container c to a vector of complex numbers

◆ to_complex() [2/2]

template<typename T , typename Container >
auto ape::to_complex ( const Container &  c,
std::size_t  size 
) -> decltype(std::begin(c), std::end(c), std::vector<std::complex<T>>())

Converts size elements from the c to a vector of complex numbers