swiftmidiaudiotoolboxcoremidiaudiokit

How to create a MIDI file with Swift?


I'm currently learning how use MIDI with swift. I sought how to create a MIDI file, but that sound like not so easy.
I checked frameworks like AudioKit, but i don't find too.
Which's informations i need to learn doing it? (for example to know MIDI file structure).


Solution

  • Hard to know exactly what you are trying to achieve from your question, but have you consulted The Core MIDI Framework Reference to see if that will fulfil your needs? If not, you can find it here:

    https://developer.apple.com/library/ios/documentation/MusicAudio/Reference/CACoreMIDIRef/

    There is also a good intro to the standard midi file format here:

    http://www.skytopia.com/project/articles/midi.html

    That should get you started if you are just trying to generate a MIDI file by writing characters to a file, but if you are trying to do anything fancy like convert audio to MIDI then that is, as you rightly say, "not so easy".