Allolib  1.0
C++ Components For Interactive Multimedia
al::AmbiEncode Class Reference

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/sound/al_Ambisonics.hpp>

Inheritance diagram for al::AmbiEncode:
al::AmbiBase

Public Member Functions

 AmbiEncode (int dim, int order)
 
void encode (float *ambiChans, int numFrames, int timeIndex, float timeSample) const
 Encode a single time sample. More...
 
void encode (float *ambiChans, const float *input, int numFrames)
 Encode buffer with constant position throughout buffer. More...
 
template<class XYZ >
void encode (float *ambiChans, const XYZ *dir, const float *input, int numFrames)
 Encode a buffer of samples. More...
 
void direction (float az, float el)
 Set spherical direction of source to be encoded.
 
void direction (Vec3f direction)
 
void direction (float x, float y, float z)
 
void print (std::ostream &stream)
 
int dim () const
 Get number dimensions.
 
void dim (int dim)
 Set the number of dimensions.
 
int order () const
 Get order.
 
void order (int order)
 Set the order.
 
const float * weights () const
 Get Ambisonic channel weights.
 
int channels () const
 Returns total number of Ambisonic domain (B-format) channels.
 
virtual void onChannelsChange ()
 Called whenever the number of Ambisonic channels changes.
 

Static Public Member Functions

static int channelsToUniformOrder (int channels)
 
static void encodeWeightsFuMa (float *weights, int dim, int order, float azimuth, float elevation)
 
static void encodeWeightsFuMa (float *ws, int dim, int order, float x, float y, float z)
 
static void encodeWeightsFuMa16 (float *weights, float azimuth, float elevation)
 Brute force 3rd order. Weights must be of size 16.
 
static void encodeWeightsFuMa16 (float *ws, float x, float y, float z)
 (x,y,z unit vector in the listener's coordinate frame)
 
static int orderToChannels (int dim, int order)
 
static int orderToChannelsH (int orderH)
 
static int orderToChannelsV (int orderV)
 
static int channelsToOrder (int channels)
 
static int channelsToDimensions (int channels)
 

Static Protected Member Functions

template<typename T >
static void resize (T *&a, int n)
 

Protected Attributes

int mDim
 
int mOrder
 
int mChannels
 
float * mWeights
 

Detailed Description

Higher Order Ambisonic encoding class

Definition at line 260 of file al_Ambisonics.hpp.

Constructor & Destructor Documentation

◆ AmbiEncode()

al::AmbiEncode::AmbiEncode ( int  dim,
int  order 
)
inline
Parameters
[in]dimnumber of spatial dimensions (2 or 3)
[in]orderhighest spherical harmonic order

Definition at line 264 of file al_Ambisonics.hpp.

Member Function Documentation

◆ direction() [1/2]

void al::AmbiEncode::direction ( float  x,
float  y,
float  z 
)
inline

Set Cartesian direction of source to be encoded (x,y,z unit vector in the listener's coordinate frame)

Definition at line 450 of file al_Ambisonics.hpp.

◆ direction() [2/2]

void al::AmbiEncode::direction ( Vec3f  direction)
inline

Set Cartesian direction of source to be encoded direction vector must be normalized

Definition at line 445 of file al_Ambisonics.hpp.

◆ encode() [1/3]

void al::AmbiEncode::encode ( float *  ambiChans,
const float *  input,
int  numFrames 
)
inline

Encode buffer with constant position throughout buffer.

Parameters
ambiChansAmbisonic domain channels (non-interleaved)
inputtime-domain sample buffer to encode
numFramesnumber of frames to encode

Definition at line 474 of file al_Ambisonics.hpp.

◆ encode() [2/3]

template<class XYZ >
void al::AmbiEncode::encode ( float *  ambiChans,
const XYZ *  dir,
const float *  input,
int  numFrames 
)

Encode a buffer of samples.

Parameters
[in]ambiChansAmbisonic domain channels (non-interleaved)
[in]dirunit vector in the listener's coordinate frame)
[in]inputtime-domain sample buffer to encode
[in]numFramesnumber of frames to encode

Definition at line 489 of file al_Ambisonics.hpp.

◆ encode() [3/3]

void al::AmbiEncode::encode ( float *  ambiChans,
int  numFrames,
int  timeIndex,
float  timeSample 
) const
inline

Encode a single time sample.

Parameters
[out]ambiChansAmbisonic domain channels (non-interleaved)
[in]numFramesnumber of frames in time buffer
[in]timeIndexindex at which to encode time sample
[in]timeSamplevalue of time sample

Definition at line 454 of file al_Ambisonics.hpp.

◆ encodeWeightsFuMa() [1/2]

static void al::AmbiBase::encodeWeightsFuMa ( float *  weights,
int  dim,
int  order,
float  azimuth,
float  elevation 
)
staticinherited

Compute spherical harmonic weights based on azimuth and elevation azimuth is anti-clockwise; both azimuth and elevation are in degrees

◆ encodeWeightsFuMa() [2/2]

static void al::AmbiBase::encodeWeightsFuMa ( float *  ws,
int  dim,
int  order,
float  x,
float  y,
float  z 
)
staticinherited

Compute spherical harmonic weights based on unit direction vector (in the listener's coordinate frame)


The documentation for this class was generated from the following file: