tags:

views:

133

answers:

2

Hi all,

My iPhone app should play midi files, unfortunelly iPhone does not supported them. I ported timidity for my project. It successfully compiles and installs on device. But when i try to convert midi to wav - get the following message in debugging console:

/usr/local/share/timidity/timidity.cfg: No such file or directory timidity: Can't read any configuration file. Please check /usr/local/share/timidity/timidity.cfg

Somebody! Please! Who have solutions or any ideas please help!)

+1  A: 

Caveat: I've never used timidity.

It would appear that timidity needs a configuration file, and I expect that there is a hardcoded (or possibly autoconf manipulated) default location for the configuration file. Clearly, this won't work on the iPhone since your application bundle will be installed in it's own sandbox.

Looking here: http://ccrma.stanford.edu/planetccrma/man/man5/timidity.cfg.5.html

It would appear that using the timidity utility you can pass in a configuration file (-c) or a path to search (-L). You will need to call the equivalent functionality in your port and at runtime use something like:

NSString *bundlePath = [[NSBundle mainBundle] bundlePath];

To pull out the location of where you've put the config file and soundfont files.

Hope that helps.

sckor
Thx sckor,I resolved this issue. In first launch when app is starting I generates timidity config and saves it to Documents folder also i added small changes in timdity sources (local path to Documents). It work correct. But have small issue, if I copy or write to config file then close it, timidity cannot read this and print error "Can't read any configuration file" to console - this bug occurs only in first app launch, if run program again it will be ok.
Altermann
A: 

Alterman, can you provide guidelines on how to port to iPhone? Did you only use the build_for_iphone script? Or do something else?

I'm just starting the process of looking to add MIDI to a project. Any guidance would be helpful.

Thanks!

zeroinverse