MIDI playback on iPhone

Subforum for discussion and help with ScummVM's iPhone port

Moderator: ScummVM Team

Post Reply
Jonathan Grynspan
Posts: 3
Joined: Sun Aug 31, 2008 3:32 pm

MIDI playback on iPhone

Post by Jonathan Grynspan »

Hi folks. I hope I'm asking about this in the right place--if not, my apologies. I'm working with a company to bring their game to iPhone. It's been around for a while on Windows and still uses MIDI playback for its music. There doesn't seem to be any native MIDI support on iPhone, but ScummVM seems to handle MIDI playback.

I was hoping somebody could point me in the right direction. How is MIDI playback accomplished in ScummVM on iPhone? Is there any actual native MIDI support, or is it all done in ScummVM?

Thanks much,
Jonathan Grynspan
User avatar
Vinterstum
ScummVM Developer
Posts: 580
Joined: Sun Oct 16, 2005 6:59 am

Re: MIDI playback on iPhone

Post by Vinterstum »

Jonathan Grynspan wrote:Hi folks. I hope I'm asking about this in the right place--if not, my apologies. I'm working with a company to bring their game to iPhone. It's been around for a while on Windows and still uses MIDI playback for its music. There doesn't seem to be any native MIDI support on iPhone, but ScummVM seems to handle MIDI playback.

I was hoping somebody could point me in the right direction. How is MIDI playback accomplished in ScummVM on iPhone? Is there any actual native MIDI support, or is it all done in ScummVM?

Thanks much,
Jonathan Grynspan
ScummVM handles all audio decoding internally, unfortunately (the iPhone port does, anyway). The only native interface it uses (soundwise) is AudioQueue to output a raw audio stream.

CoreAudio on the iPhone has a reference to kAudioFormatMIDIStream in its header files, but that may or may not be functional :). Haven't seen anyone using it.
Jonathan Grynspan
Posts: 3
Joined: Sun Aug 31, 2008 3:32 pm

Post by Jonathan Grynspan »

Thanks for the reply. Unfortunately, kAudioFormatMIDIStream is very much non-functional on iPhone -- it looks like the system-level support just isn't there. I guess Apple figures anybody using an iPhone is going to want MP3 music, not MIDI.

Do you think it would be possible to adapt ScummVM's MIDI synthesizer for use outside ScummVM? I'm not fluent in C++ so I'm not sure how complex or feasible that activity would be.
fingolfin
Retired
Posts: 1452
Joined: Wed Sep 21, 2005 4:12 pm

Post by fingolfin »

We don't really have a MIDI synthesizer -- rather, we have some hacky old code which uses our Adlib (FM OPL) audio generator to "emulate" MIDI. Which is better than nothing, but really far from being a true MIDI synth :).

One could try to get fluidsynth running on the iPhone, though I have my doubts whether it has the required CPU power. Then again, maybe I underestimate the iPhone / overestimate fluidsynth's needs, so it would be worth a try.
Jonathan Grynspan
Posts: 3
Joined: Sun Aug 31, 2008 3:32 pm

Post by Jonathan Grynspan »

Heh. Even half-baked AdLib is better than nothing for this game. Besides, it sounds pretty decent coming out of ScummVM on iPhone!

I tried to port fluidsynth, but I just don't have the background in audio necessary to do it right. Everybody around here does graphics code, not audio code.

:|
Post Reply