My use case is to play a MIDI file using a backing SF2 instrument. I have a SF2 file that contains sound samples for just one ethnic instrument. However, I am not able to successfully load that soundbank into the AVAudioUnitSampler instance.I have been able to successfully load a popular GM soundfont (using the sample code found on the internet). Below is the code snippet that works fine._sf2URL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"GeneralUser GS MuseScore v1.442"ofType:@"sf2"]];
[_sampler loadSoundBankInstrumentAtURL:_sf2URL program:6 bankMSB: kAUSampler_DefaultMelodicBankMSB bankLSB:0error:&error];However, for my sf2 file, the load fails. So, I am pretty confident that the issue is with supplying the right values for the below parameters of the loadSoundankInstrumentAtURL method:
a) Program number
b) Soundbank MSB
c) Soundbank LSBI tried several combinations, but none worked. I would like to understand a proven approach to get the right values for these parameters. May be to use a soundfont editor and look for some specific values in there?Appreciate your help.