Last active
December 30, 2019 10:08
-
-
Save Pash237/95d0c1d377f390a544eaab6686e0f712 to your computer and use it in GitHub Desktop.
Creating MIDI file with AudioKit's AKSequencer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let sequencer = AKSequencer() | |
let track = sequencer.newTrack() | |
sequencer.setLength(AKDuration(seconds: 2.0)) | |
track?.add(noteNumber: MIDINoteNumber(60), | |
velocity: MIDIVelocity(100), | |
position: AKDuration(seconds: 1, tempo: 120), | |
duration: AKDuration(seconds: 0.5, tempo: 120)) | |
try! sequencer.genData()!.write(to: url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you Pash