OSStatus AUInstrumentBase::HandleControlChange( UInt8 inChannel, UInt8 inController, UInt8 inValue, UInt32 inStartFrame) { #if DEBUG_PRINT printf("AUInstrumentBase::HandleControlChange ch %u ctlr: %u val: %u frm: %u\n", inChannel, inController, inValue, inStartFrame); #endif SynthGroupElement *gp = GetElForGroupID(inChannel); if (gp) { gp->ChannelMessage(inController, inValue); } else return kAudioUnitErr_InvalidElement; switch (inController) { case kMidiController_Sustain : if (inValue >= 64) SendPedalEvent(inChannel, SynthEvent::kEventType_SustainOn, inStartFrame); else SendPedalEvent(inChannel, SynthEvent::kEventType_SustainOff, inStartFrame); break; case kMidiController_Sostenuto : if (inValue >= 64) SendPedalEvent(inChannel, SynthEvent::kEventType_SostenutoOn, inStartFrame); else SendPedalEvent(inChannel, SynthEvent::kEventType_SostenutoOff, inStartFrame); break; } return noErr; }
void AUInstrumentBase::HandleControlChange( int inChannel, UInt8 inController, UInt8 inValue, long inStartFrame) { GetControls(inChannel)->mControls[inController] = inValue; switch (inController) { case kMidiController_Sustain : if (inValue >= 64) SendPedalEvent(inChannel, SynthEvent::kEventType_SustainOn, inStartFrame); else SendPedalEvent(inChannel, SynthEvent::kEventType_SustainOff, inStartFrame); break; case kMidiController_Sostenuto : if (inValue >= 64) SendPedalEvent(inChannel, SynthEvent::kEventType_SostenutoOn, inStartFrame); else SendPedalEvent(inChannel, SynthEvent::kEventType_SostenutoOff, inStartFrame); break; } }
void AUInstrumentBase::HandleAllSoundOff( int inChannel) { SendPedalEvent (inChannel, SynthEvent::kEventType_AllSoundOff, 0); }
void AUInstrumentBase::HandleResetAllControllers( int inChannel) { SendPedalEvent (inChannel, SynthEvent::kEventType_ResetAllControllers, 0); }
OSStatus AUInstrumentBase::HandleAllSoundOff( UInt8 inChannel) { return SendPedalEvent (inChannel, SynthEvent::kEventType_AllSoundOff, 0); }
OSStatus AUInstrumentBase::HandleResetAllControllers( UInt8 inChannel) { return SendPedalEvent (inChannel, SynthEvent::kEventType_ResetAllControllers, 0); }