I sub classed the "HandleControlChange" method of the MonotimbralInstrument base like this to connect the MIDI CC to the AU :
case kMidiController_ModWheel :
for (int i = 0; i<kNumNotes; i++)mTestNotes[i].modMIDIVal = (float) inValue/127.0;
break;
case kMidiController_Volume:
for (int i = 0; i<kNumNotes; i++)mTestNotes[i].volumeMIDIVal = (float) inValue/127.0;
break;
I think that it is the right method. But how can I write a MIDI CC in a Cocoa Application? I founded this :
AudioUnit synthUnit;
AUGraphGetNodeInfo (_graph, _synthNode, NULL, NULL, NULL, &synthUnit);
resultA = MusicDeviceMIDIEvent(synthUnit,
kMidiMessage_ControlChange ,
kMidiController_ModWheel, val, //for modulation here
0);
But it does not work (result = nil). What must I write in the application to send a MIDI CC? (I want to use MIDI and not only AUParameters)
I wanted also to integrate in the render method the value of the MIDI Clock (the BMP). Do you know how to import this value in a Monotimbral Instrument? I did not find the correct method for instance.
Thanks in advance...