Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
cinder::audio Namespace Reference

Namespaces

 cocoa
 
 dsp
 

Classes

class  AddNode
 Node for performing an addition operation on its input. More...
 
class  AudioContextExc
 Audio exception originating from within the Context. More...
 
class  AudioDeviceExc
 Audio exception related to Device management. More...
 
class  AudioExc
 General Audio exception. More...
 
class  AudioFileExc
 Audio exception related to file i/o. More...
 
class  AudioFormatExc
 Audio exception that occurs when the format of a Node leads to an irrecoverable error. More...
 
class  BufferBaseT
 Base class for the various Buffer classes. The template parameter T defined the sample type (precision). More...
 
class  BufferDynamicT
 A resizable BufferT. The internally allocated buffer will grow as needed, but it will not shrink unless shrinkToFit() is called. TODO: enable move operator to convert BufferT to this. More...
 
class  BufferInterleavedT
 Audio buffer that stores its channels of type T in one interleaved array (ie. the first sample of channel 1 is directly after the first sample of channel 0). More...
 
class  BufferPlayerNode
 Buffer-based SamplePlayerNode, where all samples are loaded into memory before playback. More...
 
class  BufferRecorderNode
 Records its inputs to a Buffer. The Buffer record size should be specified by the user (the default size is 44100 frames). Also supports writing the recorded samples to file. More...
 
class  BufferSpectralT
 A buffer that contains frequency domain audio data. More...
 
class  BufferT
 Audio buffer that stores its channels of type T contiguously (ie. the first sample of channel 1 is directly after the last sample of channel 0). Bounds checking is accomplished with assertions that are disabled in release mode by default. More...
 
class  CallbackProcessorNode
 InputNode that processes audio with a std::function callback. More...
 
class  ChannelRouterNode
 Node for mapping input channels to output channels. More...
 
class  Context
 Manages the creation, connections, and lifecycle of audio::Node's. More...
 
class  DelayNode
 General purpose delay line, supporting variable delay with linear interpolation. More...
 
class  Device
 Object representing a hardware audio device. There is only ever one device per hardware device reported by the system, for both input and output. More...
 
class  DeviceManager
 Platform-specific Singleton for managing hardware devices. Applications normally should not need to use this, but instead should use the equivalent methods from Device. More...
 
class  DivideNode
 Node for performing a division operation on its input. More...
 
class  Event
 Class representing a sample-accurate parameter control instruction. More...
 
class  FilePlayerNode
 File-based SamplePlayerNode, where samples are constantly streamed from file. Suitable for large audio files. More...
 
class  FilterBandPassNode
 A band-pass filtering Node. This is a subclass of FilterBiquadNode and manages its configuration appropriately. More...
 
class  FilterBiquadNode
 General class for filtering nodes based on a biquad (two pole, two zero) filter. More...
 
class  FilterHighPassNode
 A high-pass filtering Node. This is a subclass of FilterBiquadNode and manages its configuration appropriately. More...
 
class  FilterLowPassNode
 A low-pass filtering Node. This is a subclass of FilterBiquadNode and manages its configuration appropriately. More...
 
struct  FreeDeleter
 Simple functor wrapping free(), suitable for unique_ptr's that allocate memory with malloc, calloc and realloc. More...
 
class  GainNode
 Node for changing the gain, or amplitude, of a signal. More...
 
class  GenNode
 Base class for InputNode's that generate audio samples. Gen's are always mono channel. More...
 
class  GenNoiseNode
 Noise generator. More...
 
class  GenOscNode
 General purpose, band-limited oscillator using wavetable lookup. More...
 
class  GenPhasorNode
 Phase generator, i.e. ramping waveform that runs from 0 to 1. More...
 
class  GenPulseNode
 Pulse waveform generator with variable pulse width. Based on wavetable lookup of two band-limited sawtooth waveforms, subtracted from each other. More...
 
class  GenSineNode
 Sine waveform generator. More...
 
class  GenTableNode
 Basic table-lookup oscillator. More...
 
class  GenTriangleNode
 Triangle waveform generator. More...
 
class  InputDeviceNode
 Interface representing a Node that communicates with a hardware input device. This is typically a microphone or a 'line-in' on an audio interface. More...
 
class  InputNode
 InputNode is the base class for Node's that produce audio. It cannot have any inputs. More...
 
class  MathNode
 Base class for an arithmetic based Node. More...
 
class  MonitorNode
 Node for retrieving time-domain audio PCM samples. More...
 
class  MonitorSpectralNode
 A Scope that performs spectral (Fourier) analysis. More...
 
class  MultiplyNode
 Node for performing a mulitplication operation on its input. More...
 
class  Node
 Fundamental building block for creating an audio processing graph. More...
 
class  NodeAutoPullable
 a Node that can be pulled without being connected to any outputs. More...
 
class  NodeCycleExc
 
class  OutputDeviceNode
 Interface representing a Node that communicates with a hardware output device. This is typically speakers or a 'line-out' on an audio interface. More...
 
class  OutputNode
 Base class for Node's that consume an audio signal, for example speakers. It cannot have any outputs. More...
 
class  Pan2dNode
 Simple stereo panning using an equal power cross-fade. The panning position is specified by a single position between the left and right speakers. More...
 
class  Param
 Allows an audio parameter to be controlled over time with sample accuracate curves. More...
 
class  SamplePlayerNode
 Base Node class for sampled audio playback. Can do operations like seek and loop. More...
 
class  SampleRecorderNode
 Base Node class for recording audio samples. Inherits from NodeAudioPullable, and therefore does not need to be connected to an output. More...
 
struct  ScopedEnableContext
 RAII-style utility class to set a Context's enabled state and have it restored at the end of the current scope block. More...
 
struct  ScopedEnableNode
 RAII-style utility class to set a Node's enabled state and have it restored at the end of the current scope block. More...
 
class  Source
 Base class that is used to load and read from an audio source. More...
 
class  SourceFile
 Loads and reads from an audio file source. More...
 
class  SourceFileOggVorbis
 SourceFile implementation for decoding ogg vorbis files. More...
 
class  SubtractNode
 Node for performing a subtration operation on its input. More...
 
class  TargetFile
 Base class that is used to create and write to an audio destination. Currently only supports .wav encoding. More...
 
class  Voice
 Interface for performing high-level audio playback tasks. More...
 
class  VoiceCallbackProcessor
 Concrete Voice for processing audio with a callback function. More...
 
class  VoiceSamplePlayerNode
 Concrete Voice for sample playback. More...
 
class  WaveTable
 Manages a table that is used for wavetable synthesis. Supports table lookup with linear interpolation. More...
 
class  WaveTable2d
 Manages an array of tables that is used for bandlimited wavetable synthesis. Supports table lookup with linear interpolation. More...
 

Typedefs

typedef std::unique_ptr< float,
FreeDeleter< float > > 
AlignedArrayPtr
 
typedef std::unique_ptr
< double, FreeDeleter< double > > 
AlignedArrayPtrd
 
typedef BufferT< float > Buffer
 
typedef BufferInterleavedT< float > BufferInterleaved
 
typedef BufferSpectralT< float > BufferSpectral
 
typedef BufferDynamicT< BufferBufferDynamic
 
typedef BufferDynamicT
< BufferInterleaved
BufferDynamicInterleaved
 
typedef BufferDynamicT
< BufferSpectral
BufferDynamicSpectral
 
typedef std::shared_ptr< BufferBufferRef
 
typedef std::shared_ptr
< BufferInterleaved
BufferInterleavedRef
 
typedef std::shared_ptr
< BufferSpectral
BufferSpectralRef
 
typedef std::shared_ptr
< BufferDynamic
BufferDynamicRef
 
typedef std::shared_ptr
< BufferDynamicInterleaved
BufferDynamicInterleavedRef
 
typedef std::shared_ptr
< BufferDynamicSpectral
BufferDynamicSpectralRef
 
typedef std::shared_ptr< class
ChannelRouterNode
ChannelRouterNodeRef
 
typedef std::shared_ptr< class
DelayNode
DelayNodeRef
 
typedef std::shared_ptr< class
Device
DeviceRef
 
typedef std::shared_ptr< class
FilterLowPassNode
FilterLowPassNodeRef
 
typedef std::shared_ptr< class
FilterHighPassNode
FilterHighPassNodeRef
 
typedef std::shared_ptr< class
FilterBandPassNode
FilterBandPassNodeRef
 
typedef std::shared_ptr< class
GainNode
GainNodeRef
 
typedef std::shared_ptr< class
GenNode
GenNodeRef
 Typedef for the base GenNode. If all you need to set on the GenNode is the frequency, you can reference the Node with this. More...
 
typedef std::shared_ptr< class
GenNoiseNode
GenNoiseNodeRef
 
typedef std::shared_ptr< class
GenPhasorNode
GenPhasorNodeRef
 
typedef std::shared_ptr< class
GenSineNode
GenSineNodeRef
 
typedef std::shared_ptr< class
GenTriangleNode
GenTriangleNodeRef
 
typedef std::shared_ptr< class
GenTableNode
GenTableNodeRef
 
typedef std::shared_ptr< class
GenOscNode
GenOscNodeRef
 
typedef std::shared_ptr< class
GenPulseNode
GenPulseNodeRef
 
typedef std::shared_ptr< class
InputNode
InputNodeRef
 
typedef std::shared_ptr< class
InputDeviceNode
InputDeviceNodeRef
 
typedef std::shared_ptr< class
CallbackProcessorNode
CallbackProcessorNodeRef
 
typedef std::function< void(Buffer
*, size_t)> 
CallbackProcessorFn
 Callback used to allow simple audio processing without subclassing a Node. First parameter is the Buffer to which to write samples, second parameter is the samplerate. More...
 
typedef std::shared_ptr< class
MonitorNode
MonitorNodeRef
 
typedef std::shared_ptr< class
MonitorSpectralNode
MonitorSpectralNodeRef
 
typedef std::shared_ptr< class
Context
ContextRef
 
typedef std::shared_ptr< class
Node
NodeRef
 
typedef std::shared_ptr< class
OutputNode
OutputNodeRef
 
typedef std::shared_ptr< class
OutputDeviceNode
OutputDeviceNodeRef
 
typedef std::shared_ptr< class
Pan2dNode
Pan2dNodeRef
 
typedef std::shared_ptr< class
Event
EventRef
 A Reference to Event's returned by the ramping methods. More...
 
typedef std::function< void(float
*, size_t, float, float, const
std::pair< float, float > &)> 
RampFn
 note: unless we want to add _VARIADIC_MAX=6 in preprocessor definitions to all projects, number of args here has to be 5 or less for vc11 support More...
 
typedef std::shared_ptr< class
SamplePlayerNode
SamplePlayerNodeRef
 
typedef std::shared_ptr< class
BufferPlayerNode
BufferPlayerNodeRef
 
typedef std::shared_ptr< class
FilePlayerNode
FilePlayerNodeRef
 
typedef std::shared_ptr< class
SampleRecorderNode
SampleRecorderNodeRef
 
typedef std::shared_ptr< class
BufferRecorderNode
BufferRecorderNodeRef
 
typedef std::shared_ptr< class
Source
SourceRef
 
typedef std::shared_ptr< class
SourceFile
SourceFileRef
 
typedef std::shared_ptr< class
TargetFile
TargetFileRef
 
typedef std::shared_ptr< class
Voice
VoiceRef
 
typedef std::shared_ptr< class
VoiceSamplePlayerNode
VoiceSamplePlayerNodeRef
 
typedef std::shared_ptr< class
WaveTable
WaveTableRef
 
typedef std::shared_ptr< class
WaveTable2d
WaveTable2dRef
 

Enumerations

enum  SampleType { SampleType::INT_16, SampleType::INT_24, SampleType::FLOAT_32 }
 Identifiers sample types. Primarily used for encoding audio at different bitrates. More...
 
enum  WaveformType { WaveformType::SINE, WaveformType::SQUARE, WaveformType::SAWTOOTH, WaveformType::TRIANGLE }
 Identifiers for the classic waveform types. More...
 

Functions

template<typename T >
std::unique_ptr< T,
FreeDeleter< T > > 
makeAlignedArray (size_t size, size_t alignment=16)
 Returns an array of size elements of type T, aligned by alignment. More...
 
const ChannelRouterNodeRefoperator>> (const NodeRef &input, const ChannelRouterNode::RouteConnector &route)
 Enable routing connection syntax: More...
 
Contextmaster ()
 Returns the master Context that manages hardware I/O and real-time processing, which is platform specific. If none is available, returns null. More...
 
const NodeRefoperator>> (const NodeRef &input, const NodeRef &output)
 Enable connection syntax: input >> output, which is equivelant to input->connect( output ). Enables chaining. More...
 
void rampLinear (float *array, size_t count, float t, float tIncr, const std::pair< float, float > &valueRange)
 Array-based linear ramping function. More...
 
void rampInQuad (float *array, size_t count, float t, float tIncr, const std::pair< float, float > &valueRange)
 Array-based quadradic (t^2) ease-in ramping function. More...
 
void rampOutQuad (float *array, size_t count, float t, float tIncr, const std::pair< float, float > &valueRange)
 Array-based quadradic (t^2) ease-out ramping function. More...
 
SourceFileRef load (const DataSourceRef &dataSource, size_t sampleRate=0)
 Convenience method for loading a SourceFile from dataSource. More...
 
float linearToDecibel (float gainLinear)
 Scale gainLinear from linear (0-1) to decibel (0-100) scale. More...
 
void linearToDecibel (float *array, size_t length)
 Scale array of length length from linear (0-1) to decibel (0-100) scale. More...
 
float decibelToLinear (float gainDecibels)
 Scale gainLinear from decibel (0-100) to linear (0-1) scale. More...
 
void decibelToLinear (float *array, size_t length)
 Scale array of length length from decibel (0-100) to linear (0-1) scale. More...
 
float freqToMidi (float freq)
 Scale freq from frequency (hertz) to MIDI note values, so as one can refer to pitches using the equal temperament scale. More...
 
float midiToFreq (float midi)
 Scale midi from MIDI note values to frequency (hertz). Adapted from Pure Data's mtof function. More...
 
bool thresholdBuffer (const Buffer &buffer, float threshold, size_t *recordFrame=nullptr)
 Checks if the absolute value of any sample in buffer is over threshold. Optionally provide recordFrame to record the frame index. More...
 

Variables

bool sIsRegisteredForShutdown = false
 
const float kGainNegative100Decibels = 0.00001f
 
const float kGainNegative100DecibelsInverse = 1.0f / kGainNegative100Decibels
 

Typedef Documentation

typedef std::unique_ptr<float, FreeDeleter<float> > cinder::audio::AlignedArrayPtr
typedef std::unique_ptr<double, FreeDeleter<double> > cinder::audio::AlignedArrayPtrd
typedef std::shared_ptr<Buffer> cinder::audio::BufferRef
typedef std::shared_ptr<class DelayNode> cinder::audio::DelayNodeRef
typedef std::shared_ptr<class Device> cinder::audio::DeviceRef
typedef std::shared_ptr<class GainNode> cinder::audio::GainNodeRef
typedef std::shared_ptr<class GenNode> cinder::audio::GenNodeRef

Typedef for the base GenNode. If all you need to set on the GenNode is the frequency, you can reference the Node with this.

typedef std::shared_ptr<class GenNoiseNode> cinder::audio::GenNoiseNodeRef
typedef std::shared_ptr<class GenPhasorNode> cinder::audio::GenPhasorNodeRef
typedef std::shared_ptr<class GenSineNode> cinder::audio::GenSineNodeRef
typedef std::shared_ptr<class GenTriangleNode> cinder::audio::GenTriangleNodeRef
typedef std::shared_ptr<class GenTableNode> cinder::audio::GenTableNodeRef
typedef std::shared_ptr<class GenOscNode> cinder::audio::GenOscNodeRef
typedef std::shared_ptr<class GenPulseNode> cinder::audio::GenPulseNodeRef
typedef std::shared_ptr<class InputNode> cinder::audio::InputNodeRef
typedef std::shared_ptr<class InputDeviceNode> cinder::audio::InputDeviceNodeRef
typedef std::function<void( Buffer *, size_t )> cinder::audio::CallbackProcessorFn

Callback used to allow simple audio processing without subclassing a Node. First parameter is the Buffer to which to write samples, second parameter is the samplerate.

typedef std::shared_ptr<class MonitorNode> cinder::audio::MonitorNodeRef
typedef std::shared_ptr< class Context > cinder::audio::ContextRef
typedef std::shared_ptr< class Node > cinder::audio::NodeRef
typedef std::shared_ptr<class OutputNode> cinder::audio::OutputNodeRef
typedef std::shared_ptr<class OutputDeviceNode> cinder::audio::OutputDeviceNodeRef
typedef std::shared_ptr<class Pan2dNode> cinder::audio::Pan2dNodeRef
typedef std::shared_ptr<class Event> cinder::audio::EventRef

A Reference to Event's returned by the ramping methods.

See also
applyRamp()
appendRamp()
typedef std::function<void ( float *, size_t, float, float, const std::pair<float, float>& )> cinder::audio::RampFn

note: unless we want to add _VARIADIC_MAX=6 in preprocessor definitions to all projects, number of args here has to be 5 or less for vc11 support

typedef std::shared_ptr<class SamplePlayerNode> cinder::audio::SamplePlayerNodeRef
typedef std::shared_ptr<class BufferPlayerNode> cinder::audio::BufferPlayerNodeRef
typedef std::shared_ptr<class FilePlayerNode> cinder::audio::FilePlayerNodeRef
typedef std::shared_ptr<class Source> cinder::audio::SourceRef
typedef std::shared_ptr<class SourceFile> cinder::audio::SourceFileRef
typedef std::shared_ptr<class TargetFile> cinder::audio::TargetFileRef
typedef std::shared_ptr<class Voice> cinder::audio::VoiceRef
typedef std::shared_ptr<class WaveTable> cinder::audio::WaveTableRef
typedef std::shared_ptr<class WaveTable2d> cinder::audio::WaveTable2dRef

Enumeration Type Documentation

Identifiers sample types. Primarily used for encoding audio at different bitrates.

Enumerator
INT_16 
INT_24 
FLOAT_32 

Identifiers for the classic waveform types.

Enumerator
SINE 
SQUARE 
SAWTOOTH 
TRIANGLE 

Function Documentation

template<typename T >
std::unique_ptr<T, FreeDeleter<T> > cinder::audio::makeAlignedArray ( size_t  size,
size_t  alignment = 16 
)

Returns an array of size elements of type T, aligned by alignment.

const ChannelRouterNodeRef & cinder::audio::operator>> ( const NodeRef &  input,
const ChannelRouterNode::RouteConnector &  route 
)

Enable routing connection syntax:

input >> output->route( inputChannelIndex, outputChannelIndex, numChannels );

.

Returns
the output ChannelRouterNode after connection is made.
Context* cinder::audio::master ( )

Returns the master Context that manages hardware I/O and real-time processing, which is platform specific. If none is available, returns null.

const NodeRef& cinder::audio::operator>> ( const NodeRef &  input,
const NodeRef &  output 
)

Enable connection syntax: input >> output, which is equivelant to input->connect( output ). Enables chaining.

Returns
the connected output
void cinder::audio::rampLinear ( float *  array,
size_t  count,
float  t,
float  tIncr,
const std::pair< float, float > &  valueRange 
)

Array-based linear ramping function.

void cinder::audio::rampInQuad ( float *  array,
size_t  count,
float  t,
float  tIncr,
const std::pair< float, float > &  valueRange 
)

Array-based quadradic (t^2) ease-in ramping function.

void cinder::audio::rampOutQuad ( float *  array,
size_t  count,
float  t,
float  tIncr,
const std::pair< float, float > &  valueRange 
)

Array-based quadradic (t^2) ease-out ramping function.

SourceFileRef cinder::audio::load ( const DataSourceRef &  dataSource,
size_t  sampleRate = 0 
)

Convenience method for loading a SourceFile from dataSource.

Returns
SourceFileRef.
See also
SourceFile::create()
float cinder::audio::linearToDecibel ( float  gainLinear)

Scale gainLinear from linear (0-1) to decibel (0-100) scale.

void cinder::audio::linearToDecibel ( float *  array,
size_t  length 
)

Scale array of length length from linear (0-1) to decibel (0-100) scale.

float cinder::audio::decibelToLinear ( float  gainDecibels)

Scale gainLinear from decibel (0-100) to linear (0-1) scale.

void cinder::audio::decibelToLinear ( float *  array,
size_t  length 
)

Scale array of length length from decibel (0-100) to linear (0-1) scale.

float cinder::audio::freqToMidi ( float  freq)

Scale freq from frequency (hertz) to MIDI note values, so as one can refer to pitches using the equal temperament scale.

For example, 'middle C' equals 261.6 hertz and has a midi value of 60. Adapted from Pure Data's ftom function.

float cinder::audio::midiToFreq ( float  midi)

Scale midi from MIDI note values to frequency (hertz). Adapted from Pure Data's mtof function.

See also
freqToMidi()
bool cinder::audio::thresholdBuffer ( const Buffer &  buffer,
float  threshold,
size_t *  recordFrame = nullptr 
)

Checks if the absolute value of any sample in buffer is over threshold. Optionally provide recordFrame to record the frame index.

Returns
true if one is found, false otherwise.

Variable Documentation

bool cinder::audio::sIsRegisteredForShutdown = false
const float cinder::audio::kGainNegative100Decibels = 0.00001f
const float cinder::audio::kGainNegative100DecibelsInverse = 1.0f / kGainNegative100Decibels