I have added the second call to MusicDeviceMIDIEvent, which sends Patch 72 to the default MIDI channel.
require_noerr (result = AUGraphInitialize (graph), home);
//set our bank
require_noerr (result = MusicDeviceMIDIEvent(synthUnit,
kMidiMessage_ControlChange << 4 | midiChannelInUse,
kMidiMessage_BankMSBControl, 0,
0/*sample offset*/), home);
require_noerr (result = MusicDeviceMIDIEvent(synthUnit, kMidiMessage_ControlChange << 4 | midiChannelInUse,
kMidiMessage_BankMSBControl, 0,
0/*sample offset*/), home);
// This code isn't in the project, and works to send a Program Change
require_noerr (result = MusicDeviceMIDIEvent(synthUnit, kMidiMessage_ProgramChange << 4 | midiChannelInUse,
72, 0,
0), home);
Note that on most software synths today you change sounds using their UIs, not using MIDI Program changes. This requires either showing the CocoaView or the GenericView for the AU. Good sample code is in the CocoaAUHost project.
HTH,
David