0

In an AKSequencer track I add midi notes, the first is positioned at 0

trackOne?.add(noteNumber: MIDINoteNumber(64), velocity: 100, position: AKDuration(beats: 0.0), duration: AKDuration(beats: 0.5))

the note at position 0 never plays in a single run through of the sequence, but weirdly does play if it is in a loop. I have the track midi output going into a AKMidiCallBackInstrument and in the initial play, it does not register the noteOn byte it only seems to receive the note end byte.

Because the notes after the first one played I tried setting the position to 0.1 and that actually worked, maybe there is something that I need to call/activate just prior to sequence play...

Has anyone ever see anything like this before and if so how did you solve it? thanks.

JohnOfIreland
  • 271
  • 2
  • 11
  • Including your code for setting up the sequencer and/or the prep work you do before calling play (e.g., calling preroll, rewind etc) would be helpful. Also, since AKSequencer refers to 2 entirely different classes depending on whether you're using AudioKit before 4.8 or AudioKit 4.8+, it would be helpful to clarify the version. – c_booth Aug 28 '19 at 17:04
  • @c_booth, version: 4.7.2, your post actually solved my problem, well, started the chain of events where I discovered what was wrong...I have a static class in which I initalise a mixer, a AKCallBackInstrument and an oscillator bank, also another class where I handle the initialisation of two tracks, I was setting the output of the first of these to the midi input of the callback instrument but I wasn't setting the output of the second, while I was tidying up the code to paste it on here I removed the second track and started the app and the first note on the first track started to work... – JohnOfIreland Aug 28 '19 at 18:50
  • As for the things you mentioned, I rewind on a button press, don't rewind at the app start...is that a good practice? Also prerolling the sequence at the start, is that normal? – JohnOfIreland Aug 28 '19 at 18:53

1 Answers1

0

I stumbled across an answer to this, I had two tracks: The first had it's midi output assigned to the midi input of a AKCallbackInstrument, the problem was that the second track wasn't assigned an output. Either removing the unassigned track or setting its midi output to the input of a callback instrument seems to have fixed it.

JohnOfIreland
  • 271
  • 2
  • 11