Creating MIDI files on the fly using Audiokit

Viewed 371

I'm currently using the following method to play stems in a song:

  1. Load stem_01.mp3 into AKAudioFile
  2. Add AKAudioFile to AKMIDISampler
  3. Add AKMIDISampler to AKMixer
  4. repeat 1-3 for number of stems
  5. Create AKSequencer using custom MIDI file: This MIDI file has a separate track for each stem in the song. There is one note on each track in the MIDI file (on C3) that lasts for the duration of the song.
  6. I add a new track to the AKSequencer for each stem, and use the sequencer to control playback of the stems

My question is this: is there any way to automate the creation of this MIDI file. I know the number of stems, and the duration of the song; can I dynamically create the MIDI file that Audiokit requires to enable AKSequencer?

Any thoughts or ideas on this most welcome, as it would save a lot of manual work when adding new songs. Thanks!

0 Answers
Related