AudioKit / AudioKit

Audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

Home Page:http://audiokit.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppleSequencer and MIDISampler are stuttering on the first note

herrDerToene opened this issue · comments

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

Whenever I play a sequence with AppleSequencer through a MIDISampler the first note is too short. It sounds like this:

xx x x x x x though it should sound like this:
x x x x x x

The higher the tempo the more obvious the effect. The same problem can be heard in AudioKit CookBooks DrumSequencer. It occurs every time you start playing a sequence, no matter if it is from the start or from within a sequence.

I can only speculate that the first samples get triggered to late. It's like it starts playing though it's not really ready to play.

Crash Logs, Screenshots or Other Attachments (if applicable)

No response

Well know Apple Sequencer bug, not AudioKit's fault as far as we can tell.

@herrDerToene Here is a potential workaround for this issue: https://youtu.be/uwJQK6FQLVY?si=rYnOPHaCjkVYpY2T&t=322

With AppleSequencer your best bet is to have the sequencer always running or do a pre-roll like I did in the video. The other options for standalone are to use AudioKit's other Sequencer which I've never used and doesn't currently have an example, or use Ableton LinkKit, CADisplayLink, or a Timer. In AUv3 you'd use the musicalContextBlock.