SkillAgentSearch skills...

MIDIPlayer

Swift example of using AVMIDIPlayer from a file or from a MusicSequence

Install / Use

/learn @genedelisa/MIDIPlayer
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

MIDIPlayer

license Build Status GitHub tag GitHub release [GitHub commits Swift 4

Platforms iOS

Sponsors Twitter @GeneDeLisaDev

Using AVMIDIPlayer from a MIDI file, and from a MusicSequence.

Neither SoundFonts nor DLS files will play in the simulator. They play on the device though.

Playing the "data" option takes a long time for the night on bald mountain file to be parsed.

It seems that tempo events cause the player to hiccup on the device.

SoundFonts

Download your own SoundFont. You can get some here:

MuseCore

You have to play it on a device to hear the sounds. Otherwise, in the simultor you will get just sine waves.

Blog post for this example.

Blog post

Bugs

Some goofiness when you move the slider. I want it to change when the slider is done. I specified that in the storyboard. But, it still gets called while sliding.

Using MusicTrack in Swift is still a pain. I have idea what to do about MIDIMetaEvent - especially the data field. I think they imported it into Swift incorrectly. So, I don't have any meta events.

GitHub issues

If you find one, please add it to issues

Buy my kitty Giacomo some cat food

paypal

<img src="http://www.rockhoppertech.com/blog/wp-content/uploads/2016/07/momocoding-1024.png" alt="Giacomo Kitty" width="400" height="300">

Licensing

MIT

Please read the LICENSE for details.

Credits

View on GitHub
GitHub Stars28
CategoryDevelopment
Updated3mo ago
Forks6

Languages

Swift

Security Score

87/100

Audited on Dec 11, 2025

No findings