Skip to content

Commit

Permalink
Merge pull request #158 from markjeschke/main
Browse files Browse the repository at this point in the history
STK Demo: Change the updated beat value to be published on the main thread
  • Loading branch information
NickCulbertson committed Jun 26, 2024
2 parents 11dacc2 + a74acc1 commit b640a23
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ class ShakerConductor: ObservableObject, HasAudioEngine {
_ = sequencer.addTrack(for: shaker)

callbackInst = CallbackInstrument(midiCallback: { _, beat, _ in
self.data.currentBeat = Int(beat)
print(beat)
DispatchQueue.main.async { [unowned self] in
self.data.currentBeat = Int(beat)
print(beat)
}
})

_ = sequencer.addTrack(for: callbackInst)
Expand Down

0 comments on commit b640a23

Please sign in to comment.