20 mFiltJoin(mLLPF, mRLPF),
58 for (
unsigned i = 0; i <
mSources.size(); i++) {
77 float half = 1.0f/2.0f;
78 if (mSources.size() == 0)
81 for (
unsigned i = 0; i < mSources.size(); i++) {
83 while (az < 0.0f) az += 1.0f;
84 while (az > 1.0f) az -= 1.0f;
86 if (pos > half) pos = 1.0f - pos;
89 ((
Panner *) mPanners[i])->setPosition(pos);
92 float distScale = 1.0f / sqrt(((
SpatialSource *) mSources[i])->distance());
94 mRevMix.scaleInput(*mPanners[i], 1.0f - distScale);
98 mFiltMix.scaleInput(*mPanners[i], 0.0f);
99 mDryMix.scaleInput(*mPanners[i], distScale);
101 float ratio = fabs(0.75f - az) * 4.0f;
102 mFiltMix.scaleInput(*mPanners[i], (1.5f - ratio) * distScale);
103 mDryMix.scaleInput(*mPanners[i], ratio * distScale);
106 mOutMix.nextBuffer(outputBuffer);
Mixer mDryMix
direct send mixer
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
Mixer mRevMix
reverb send mixer
UGenVector mPanners
Vector of pointers to the panners.
UGenVector mSources
SpatialSource... refers to its input UGen, but with the knowledge of its position within a space...
void removeInput(UnitGenerator &inp)
void setDryLevel(float level)
Mixer mFiltMix
LPF filter send mix.
Temp Spatial Sound Source.
Joiner mFiltJoin
mono-to-stereo joiner (for filters)
Stereoverb mReverb
stereo freeverb
void scaleInput(UnitGenerator &inp, float val)
set the scale of an input
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
virtual void nextBuffer(Buffer &outputBuffer)
fill the buffer with the next buffer_length of values
SimplePanner()
Default constructor.
The CSL mono-to-stereo L/R panner class.
void addInput(UnitGenerator &inp)
void removeSource(SpatialSource &s)
Remove a sound source.
Mixer mOutMix
master output mixer
void setWetLevel(float level)
void addSource(SpatialSource &s)
Implement Panner's addSource, inserting a panner to each source.
Base class of CSL exceptions (written upper-case). Has a string message.