Dear Dmitry, From my own observations with SoundFonts I have concluded that by convention bank MSB 128 contains percussive presets. GM Level 1 does not specify a bank but in a SoundFont you somehow need to separate the melodic presets from percussive presets.
General MIDI Level 2 introduced banks but SoundFonts historically already used bank 128 for GM1. Also there is the technical problem that you cannot send MSB value 128 in a MIDI CC, as the possible range is 0-127. So I believe that AUMIDISynth and AUSampler both convert the given GM2 bank to the appropriate SoundFont bank: kAUSampler_DefaultPercussionBankMSB = 0x78 -> SF bank 128 kAUSampler_DefaultMelodicBankMSB = 0x79 -> SF bank 0 There may be other SF banks with MSB=128 and varying LSB. Try sending bank LSB controller (CC#32) with matching numbers according to your SoundFont, while sending kAUSampler_DefaultPercussionBankMSB as the value for bank MSB (CC#0) which is then converted by the AU to SF bank 128. Sven > Am 14.10.2019 um 10:06 schrieb Dmitry Klochkov via Coreaudio-api > <[email protected]>: > > Ok, I got it working somehow, but still can not fully understand what is > going on there. > > I tried changing the bank number assigned to the drum preset inside the > soundfont using Polyphone app. The sound bank was set to 128 and I set it to > 1. > And then when I tried to load this updated soundfont into the AUMIDISynth I > got the following error messages: > > BankEntry::LoadInstrument: Unable to find patch 0 bank 0x78/0 > EXCEPTION (-10851): "LoadInstrument: Failed to load patch from bank" > DLS/SF2 bank load failed > > So I reverted updated bank number back to 128 and instead of sending a bank > select message with value 128, I sent it with value 0x78(which is 120 in > decimal). And voila! She preset loaded! > > Also to got the bank selection working I need to update my code so it doesn't > send bank select using two messages(MSB and LSB) but only sends the provided > bank value as MSB > > MusicDeviceMIDIEvent(instrumentUnit, 0xB0 | channel, 0, bank, 0) > > > So I am wondering is there any meaningful explanation why bank number 128 > became 120 after the soundfont was loaded into AUMIDISynth? > > > > Best wishes, > Dmitry
_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com This email sent to [email protected]
