42 #ifndef CSL_AMBISONIC_H
43 #define CSL_AMBISONIC_H
50 #define HOA_MAX_ORDER 2 // maximum order that the CSL HOA will handle
sample * SampleBuffer
1-channel buffer data type, vector of (sample)
AmbisonicOrder(unsigned hOrder=0, unsigned vOrder=0)
AmbisonicDecoder(AmbisonicUnitGenerator &input, SpeakerLayout *layout=SpeakerLayout::defaultSpeakerLayout(), AmbisonicDecoderMethod method=kPROJECTION, AmbisonicDecoderFlavour flavour=kBASIC)
Defaults to standard speaker layout as defined in "HOA_SpeakerLayout" class and to Ambisonic order of...
void setOrder(AmbisonicOrder order)
Returns the Ambisonic order.
void makeMaxRE(unsigned greaterOrder)
Adjusts the decoding matrix D for Max rE flavour.
void asProjection()
Create the decoding matrix "D" using the projection method.
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
void channelIndexer(unsigned *indexArray)
Calculates a lookup table to map Ambisonic channel index to actually used UnitGenerator channel...
unsigned orderToChannels(const AmbisonicOrder order)
Returns the number of Ambisonic channels from a hybrid Ambisonic order: N = 2*M_h + 1 + (M_v + 1)^2 -...
SampleBuffer mWeights
Encoding weights for each order (per source)
unsigned greaterOrder(const AmbisonicOrder order)
Compares the horizontal and vertical Ambisonic order of a hybrid order and returns the largest...
AmbisonicDecoderFlavour mDecoderFlavour
AmbisonicUnitGenerator(unsigned order=0)
Initialize with uniform Ambisonic order. Defaults to zeroth order.
Ambisonic order structure (separate definition for horizontal and vertical order): ...
virtual void nextBuffer(Buffer &outputBuffer, unsigned outBufNum)
Does the DSP processing for the Ambisonic Decoder.
unsigned orderToHorizontalChannels(const AmbisonicOrder order)
Returns the number of horizontal Ambisonic channels from a hybrid Ambisonic order: N_h = 2*M_h + 1...
virtual ~AmbisonicUnitGenerator()
void asPseudoInverse()
create the decoding matrix "D" using the pseudoinverse method
bool isUniform
Returns true if horizontal and verical orders are identical.
void initialize(UnitGenerator &input, AmbisonicDecoderMethod method, AmbisonicDecoderFlavour flavour)
initializing method called by constructors
void makeTransposedReEncodingMatrix(float **transposeMatrix)
Utility method that creates the transposed re-encoding matrix C'.
Temp Spatial Sound Source.
~AmbisonicDecoder()
Destructor.
void makeInPhase(unsigned greaterOrder)
Adjusts the decoding matrix D for in-phase flavour.
virtual ~AmbisonicEncoder()
Destructor.
void initialize()
Initializing method called by constructors.
AmbisonicDecoderFlavour
Flag for the decoder flavour.
unsigned orderToVerticalChannels(const AmbisonicOrder order)
Returns the number of vertical Ambisonic channels from a hybrid Ambisonic order: N_v = (M_v + 1)^2 - ...
void invChannelIndexer(unsigned *indexArray)
Calculates a lookup table to map actually used UnitGenerator channel to Ambisonic channel index...
SpeakerLayout * mSpeakerLayout
UnitGenerator * mUGen
my unit generator (pointer or NULL)
void setInput(SpatialSource &input)
Set my input.
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
AmbisonicEncoder()
Default constructor.
Ambisonic Abstract Base Class.
AmbisonicOrder mOrder
the order of the Unit Generator
AmbisonicDecoderMethod
Flag for the decoding method.
SampleBuffer * SampleBufferVector
Multi-channel buffer data type, vector of (SampleBuffer)
Port – used to represent constant, control-rate or signal inputs and outputs in named maps; holds a ...
AmbisonicDecoderMethod mDecodingMethod
virtual void nextBuffer(Buffer &outputBuffer, unsigned outBufNum)
Does the DSP processing for the Ambisonic Encoder.
static SpeakerLayout * defaultSpeakerLayout()
Returns a pointer to the default layout. If no default exists, it creates one.
unsigned channelsToUniformOrder(const unsigned channels)
Port * mInputPort
Holds the input to be encoded.
SampleBufferVector mDecodingMatrix
Base class of CSL exceptions (written upper-case). Has a string message.