4

Does anyone know if there is a free/cheap MIDI player/synthesizer library that I can incorporate into my iPhone application?

As I understand it the iPhone doesn't have native support for MIDI playback.

To work around this limitation I've created a bank of .caf sound samples that I playback myself but I'd really like to improve the implementation and use MIDI if possible.

Any advice would be greatly appreciated.

user55674
  • 51
  • 1
  • 4

4 Answers4

4

Since 10 october of 2011, that is since iOS5, Apple has started delivering basic API for midi files playback. The API is called MusicPlayer along with MusicSequence Check this out :

https://developer.apple.com/library/ios/#documentation/AudioToolbox/Reference/MusicPlayerServices_Reference/Reference/reference.html#//apple_ref/doc/uid/TP40009301-CH1-SW1

By setting up an appropriate Audio Unit Processing Graph you can output the sound you like.

couicoui
  • 51
  • 3
3

Look at TiMidity++; it looks like something that should be portable to the iPhone platform.

TiMidity++ is a software synthesizer. It can play MIDI files by converting them into PCM waveform data; give it a MIDI data along with digital instrument data files, then it synthesizes them in real-time, and plays. It can not only play sounds, but also can save the generated waveforms into hard disks as various audio file formats. TiMidity++ is a free software, distributed under the terms of GNU general public license.

Many people have ported TiMidity++ into various platforms; FreeBSD, NetBSD, many Linux distributions, Windows (and/or Cygwin environment), and Mac OS are known to have their own versions.

rupello
  • 8,361
  • 2
  • 37
  • 34
  • 1
    TiMidty++ is GPL I think , which would lead to you to release the source of your application for free. Also the people who built this project obtain a binary library which is only usable in Jailbroken iPhones. – Goles Feb 13 '10 at 12:35
0

This is a library I've used for MIDI synthesis in Android: https://code.google.com/p/android-midi-lib/

Although it can't be used for iOS, I think you(and anyone who's interested) can still take a look at the implementation of the MIDI file format(i.e. how bytes are written to a .mid file) and possibly implement a MIDI library yourself.

StephenChen
  • 711
  • 2
  • 8
  • 20
0

There is a commercial library available from Crimson Technology

Crimson Technology Library

I have never used it so I can't vouch for it's quality.

R.daneel.olivaw
  • 2,681
  • 21
  • 31
Nick Long
  • 1,908
  • 3
  • 18
  • 28