MIDISequencer
MIDISequencer copied to clipboard
Bunch of issues when installing and following instructions
Hi there,
I was just going to try this library for an app I'm building. However, I'm running into quite a few issues when trying to follow the example on the README.
Mainly:
MIDISequencer:
Value of type 'AKSequencer' has no member 'setTempo'
Value of type 'AKSequencer' has no member 'newTrack'
Value of type 'AKSequencer' has no member 'setLength'
Value of type 'AKSequencer' has no member 'enableLooping'
MIDISequencerArpeggiator.swift:
Use of undeclared type 'NoteType'
MIDISequencerStep.swift
Use of undeclared type 'Note'
I've seen a closed issue regarding the last issue but I've installed the latest version now (0.0.4 according to Podfile.lock) so not sure if I'm missing anything.
This is the code I'm using:
let track = MidiSequencerTrack(name: "Track 1", midiChannel: 1)
sequencer.tracks.append(track)
sequencer.tempo = Tempo(
timeSignature: TimeSignature(
beats: 4,
noteValue: .quarter
),
bpm: 80
)
track.steps = [
MIDISequencerStep(
note: Note(type: .c, octave: 4),
noteValue: NoteValue(type: .quarter),
velocity: .standard(100)),
MIDISequencerStep(
note: Note(type: .d, octave: 4),
noteValue: NoteValue(type: .quarter),
velocity: .standard(100)),
MIDISequencerStep(
note: Note(type: .e, octave: 4),
noteValue: NoteValue(type: .quarter),
velocity: .standard(100)),
MIDISequencerStep(
note: Note(type: .f, octave: 4),
noteValue: NoteValue(type: .quarter),
velocity: .standard(100)),
]
sequencer.addTrack(track: track)
sequencer.playAsync(completion: {
print(">>> MIDI SEQUENCER FINISHED PLAYING")
})
Would love some input as this lib seems perfect for what I'm trying to do :)
Also - I couldn't find it anywhere and obviously it's not running for me but does your lib take care of actual sound output? If not, what would you recommend to go with it for simple piano sounds (possible other sounds in the future)
Thanks
David