For our simple example we make several assumptions:
We ignore noteUpdates for now.
We assume that every parameter about which we care is present in every note.
Since our simple example has no envelopes, we need not implement the noteOffSelf: method. We can just use the default version that returns 0.
So we need to provide only two methods, noteOnSelf: and noteEndSelf.
+ noteOnSelf: aNote
{
[OSC setFreq: [aNote freq]];
[OSC setAmp: [aNote parAsDouble: MK_amp]];
[OUT setBearing: [aNote parAsDouble: MK_bearing]];
[synthElements makeObjectsPerform: @selector(run)];
return self;
}
+ noteEndSelf
{
[OSC setAmp: 0.0];
return self;
}
|