I'm currently using the following method to play stems in a song:
- Load stem_01.mp3 into AKAudioFile
- Add AKAudioFile to AKMIDISampler
- Add AKMIDISampler to AKMixer
- repeat 1-3 for number of stems
- 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.
- 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!