• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it


  • Subject: Re: How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
  • From: Douglas Scott <email@hidden>
  • Date: Tue, 02 Sep 2014 09:42:24 -0700

The failure is not when loading the EXS instrument — it is a failure to locate the external sample files associated with that instrument.
When you create your own EXS instruments, and you are adding your own external sample files to the instrument, you should follow
the rules described for .aupreset sample files:  The path must include (but not start with) “/Sounds/“.  AUSampler will search for this
marker, and then search your app folder and associated folders for directories and/or files which match what follows that marker.
So you should be able to include a sample with the path “/Users/dk/Library/Sounds/Acoustic Guitar/Acoustic Guitar_consolidated.caf”,
and AUSampler will then search for "<bundle>/Sounds/Acoustic Guitar/Acoustic Guitar_consolidated.caf”.  Hope that makes some sense.

-DS

On Sep 2, 2014, at 6:30 AM, Dmitry Klochkov <email@hidden> wrote:

I have read Technical Note TN2283, and successfully load some exs instrument from GarageBand into my application.
But I can't load exs instruments that I created myself.

What I did:

I opened default Acoustic Guitar instrument that goes with Logic pro and exported it to the home folder using EXS24. 

So now I have these files:

/Users/dk/Sampler Instruments/Acoustic Guitar.exs
/Users/dk/Acoustic Guitar/Acoustic Guitar_consolidated.caf

Executing command strings ./Acoustic\ Guitar.exs at folder /Users/dk/Sampler Instruments/ , 

I am getting this at the end of command execution result:

....... 

 TBOSAcoustic Guitar_con#17C03AD.caf

ffac

mcpl

/Users/dk/Acoustic Guitar

Acoustic Guitar_consolidated.caf


Then I put those files in my iOS app in this structure:

<bundle>/Acoustic Guitar.exs
<bundle>/dk/Acoustic Guitar/Acoustic Guitar_consolidated.caf

I am loading instruments to AUSampler with this code:

    NSString *path = [[NSBundle mainBundle] pathForResource:@"Acoustic Guitar" ofType:@"exs"];

    

    NSURL *presetURL = [[NSURL alloc] initFileURLWithPath: path];

    

    AUSamplerInstrumentData bpdata = {0};

    

    bpdata.fileURL = (__bridge CFURLRef)(presetURL);

    bpdata.instrumentType = kInstrumentType_EXS24;

    

    CheckError(AudioUnitSetProperty(player->instrumentUnit,

                                  kAUSamplerProperty_LoadInstrument,

                                  kAudioUnitScope_Global,

                                  0,

                                  &bpdata,

                                  sizeof(bpdata)), "Couldn't set exs instrument on AUSampler");


When I run my app I get the errors:

Failed to locate sample 'Acoustic Guitar_con#17C03AD.caf -- file:///Users/dk/Acoustic Guitar/'

GlobalState::LoadEXS24Instrument: Load failed


What I am doing wrong? What is the proper way to put custom exs instruments to an iOS application?




  
Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it (From: Dmitry Klochkov <email@hidden>)

  • Prev by Date: Re: from xcode5 to xcode6-beta6, sounds are now distorted on iOS7
  • Next by Date: Re: from xcode5 to xcode6-beta6, sounds are now distorted on iOS7
  • Previous by thread: Re: How to put a exs sample instrument to an iOS app bundle so AUSampler can properly load it
  • Next by thread: Effect units in iOS > 4
  • Index(es):
    • Date
    • Thread