I ended up breaking out a hex editor and having a go at this myself – Initially I thought I could use AudioFileWriteBytes to write the header info before writing out the sample data however this resulted in the
bytes I was writing ending up in the ‘data’ chunk.
In the hex editor I noticed that all my caf files produced by afconvert had a bunch of empty space in the ‘free’ chunk so I ended up just reading the file, finding the ‘free’ chunk, adding an ‘inst’ chunk and
reducing the size of the ‘free ‘chunk accordingly.
I have no idea if this is the correct way to go about this? (for instance is it guaranteed that the ‘free’ chunk has enough room for all the other chunks?)
Neil
From: coreaudio-api-bounces+nwallace=email@hidden
[mailto:coreaudio-api-bounces+nwallace=email@hidden] On Behalf Of
Neil Wallace
Sent: 08 May 2012 11:21
To: email@hidden
Subject: Addin instrument data to caf files
I currently load my samples into an AUSampler using an .aupreset file, however I would prefer to just load
caf files with appropriate metadata relating to key range etc – the docs say this should be possible:
Each audio file should have been edited appropriately to contain instrument data (for example key range, velocity range, root key)
However I can’t see anywhere that tells me how exactly I add this metadata – can anyone point me in the right direction?
Cheers
Neil