18 : mIO(anIO), mMap(outChans,
CGestalt::blockSize()),
19 mInChans(inChans), mOutChans(outChans),
26 : mIO(anIO), mMap(outChans,
CGestalt::blockSize()),
27 mInChans(inChans), mOutChans(outChans),
33 for (
unsigned i = 0; i < outChans; i++)
39 : mIO(NULL), mMap(outChans,
CGestalt::blockSize()),
40 mInChans(inChans), mOutChans(outChans),
47 : mIO(NULL), mMap(outChans,
CGestalt::blockSize()),
48 mInChans(inChans), mOutChans(outChans),
54 for (
unsigned i = 0; i < outChans; i++)
78 unsigned numFrames = outputBuffer.mNumFrames;
82 mIO->getInput(outputBuffer.mNumFrames, outputBuffer.mNumChannels);
83 inputBuffer = &(mIO->mInputBuffer);
92 for (
unsigned i = 0; i < mOutChans; i++)
93 memcpy(outputBuffer.buffer(i), inputBuffer->
buffer(i % mInChans), outputBuffer.mMonoBufferByteSize);
96 for (
unsigned i = 0; i < mOutChans; i++) {
97 sample * outPtr = outputBuffer.buffer(i);
100 for (
unsigned j = 0; j < numFrames; j++)
101 *outPtr++ = (*inPtr1++ * mGains[i]) + (*inPtr2++* mGains[i]);
108 for (
unsigned i = 0; i < mOutChans; i++) {
109 sample * outPtr = outputBuffer.buffer(i);
110 int which = mMap.mChannelMap[i];
111 if (which < 0)
continue;
113 for (
unsigned j = 0; j < numFrames; j++)
114 *outPtr++ = *inPtr1++ * mGains[i];
void pullInput(Buffer &outputBuffer)
BufferCMap mMap
the mapped buffer pointers for the output channels
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
void setChanGains(float *values)
set gain array
void setGain(unsigned index, float value)
set gain value at index
unsigned mOutChans
out chans
virtual SampleBuffer buffer(unsigned bufNum)
convenience accessors for sample buffers
virtual void nextBuffer(Buffer &outputBuffer)
get a buffer of Frames – this is the core CSL "pull" function; the given buffer can be written into...
bool mInterleaved
flag if IO is interleaved
std::vector< int > mChannelMap
the map between virtual and real channels
void setChanMap(unsigned *chans)
set channel map
The CSL system defaults class.
float * mGains
amplitude scales
float sample
(could be changed to int, or double)
IO – the abstract I/O scheduling class; subclasses interface to specific I/O APIs.
Buffer * mBuffer
the buffer used to hold my output
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
Port – used to represent constant, control-rate or signal inputs and outputs in named maps; holds a ...
void addInput(CSL_MAP_KEY name, UnitGenerator &ugen)
Plug in a unit generator to the named input slot.
InOut(IO *anIO, unsigned inChans, unsigned outChans, InOutFlags f=kNoProc)
Constructor with IO, number of channels in & out, and processing.
Base class of CSL exceptions (written upper-case). Has a string message.