14 logMsg(
"BinaryOp::add input and operand UGs");
21 logMsg(
"BinaryOp::add input UG and float operand");
28 logMsg(
"BinaryOp::add operand UG and float input");
47 if (opPort->
mUGen != 0)
55 fprintf(stderr,
"BinaryOp left: ");
57 fprintf(stderr,
"right: ");
59 fprintf(stderr,
"\n");
73 logMsg(
"AddOp nextBuffer");
75 SampleBuffer outputBufferPtr = outputBuffer.buffer(outBufNum);
76 unsigned numFrames = outputBuffer.mNumFrames;
79 for (
unsigned i = 0; i < numFrames; i++) {
80 *outputBufferPtr++ = *inValue + opValue;
94 logMsg(
"MulOp nextBuffer");
96 SampleBuffer outputBufferPtr = outputBuffer.buffer(outBufNum);
97 unsigned numFrames = outputBuffer.mNumFrames;
101 for (
unsigned i = 0; i < numFrames; i++) {
102 *outputBufferPtr++ = * inValue * opValue;
sample * SampleBuffer
1-channel buffer data type, vector of (sample)
void logMsg(const char *format,...)
These are the public logging messages.
void dump()
Prints instance info.
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
Effect – mix-in for classes that have unit generators as inputs (like filters).
#define DECLARE_OPERAND_CONTROLS
Declare the operand port (accessing the mInputs map) and current value.
bool isFixed()
Is the input fixed or a dynamic UnitGenerator?
BinaryOp(UnitGenerator &op1, UnitGenerator &op2)
The constructor for dual-UnitGenerator operation.
Illegal operation at run time.
void dump()
pretty-print the receiver
float mValue
my value (in case I'm fixed [mUGen == NULL])
AddOp(UnitGenerator &op1, UnitGenerator &op2)
The constructor for dual-UnitGenerator operation.
virtual ~BinaryOp()
The destructor.
MulOp(UnitGenerator &op1, UnitGenerator &op2)
The constructor for dual-UnitGenerator operation.
#define UPDATE_OPERAND_CONTROLS
Update the op-related value in the loop.
void setOperand(float op)
Set the operand from a fixed float.
void nextBuffer(Buffer &outputBuffer, unsigned outBufNum)
Returns the next individual frame (for fixed values)
#define LOAD_OPERAND_CONTROLS
Load the op-related values at the start of the callback; if the operand is a dynamic UGen input...
BinaryOp – An Effect that takes two input sources (UnitGenerators or scalars) and gives a single Uni...
UnitGenerator * mUGen
my unit generator (pointer or NULL)
void nextBuffer(Buffer &outputBuffer, unsigned outBufNum)
Function that implements the adding routine.
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.
PortMap mInputs
the map of my inputs or controls (used by the mix-in classes)
bool operandIsFixed()
Is the operand fixed or a dynamic UnitGenerator?
Base class of CSL exceptions (written upper-case). Has a string message.