AudioKit / AudioKit

Audio synthesis, processing, & analysis platform for iOS, macOS and tvOS
http://audiokit.io
MIT License
10.7k stars 1.56k forks source link

MIDISampler issue with XCode 15.3RC #2901

Closed matts9000 closed 6 months ago

matts9000 commented 8 months ago

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

The Drum Sequencer from the AudioKit Cookbook does not work anymore with XCode 15.3.

I know that you don't want to work with unreleased versions, but as I have seen this issue with beta versions and the current release candidate of XCode 15.3, so I think this will stay with the official release.

Versions:

What I found is that the issue seem to be connected to the MIDI handling in MIDISampler (in conjunction AppleSequencer). Playing single notes with MIDISampler play function works fine.

Crash Logs, Screenshots or Other Attachments (if applicable)

No response

NickCulbertson commented 8 months ago

I'm on Xcode 15.0 and it's working there so it must be version specific. Is the Music Toy example working? Those examples are pretty similar. Are there any clues in the console?

matts9000 commented 8 months ago

Yes, it this issue appears only with Xcode 15.3 - it does not show up to Xcode 15.2 I just tried with the Music Toy, and it has the same issue - no sound after start playing.

NickCulbertson commented 8 months ago

I just downloaded the Xcode beta and I'm getting the issue too. If you create a MIDICallback instrument it works, but not with drums.midiIn. I'll add a MIDICallback in the Drum Sequencer as a workaround, but I'll leave the Toy example as-is for now since it might still be working in the release version. The workaround for Drum Sequencer should work on the Toy example too if the Xcode release borks things.

michaelsteeber commented 6 months ago

For me, MIDI playback is completely silent when building on Xcode 15.3. The same code works flawlessly with Xcode 15.2. It fails silently — no errors are thrown, so I'm not sure how to debug it.

NickCulbertson commented 6 months ago

@michaelsteeber Is the DrumSequencer example working? That one uses AppleSequencer with a MIDICallback to play the instruments.

NickCulbertson commented 6 months ago

I'm downloading the new Xcode version now. If I can't figure it out, I'll update all the Cookbook examples to use the MIDICallback. There is also a second Sequencer class in AudioKit that isn't facing this issue. An example of that is in the Arpeggio recipe.

michaelsteeber commented 6 months ago

DrumSequencer is working when building on Xcode 15.3 now, older versions of the Cookbook are silent built on 15.3. My project also uses AppleSequencer and MIDISampler.

NickCulbertson commented 6 months ago

I just submitted a new PR to AudioKit that should fix the issue. I updated the enableMIDI method on AppleSequencer.

NickCulbertson commented 6 months ago

This should now be resolved in the latest version of AudioKit and the Cookbook.

michaelsteeber commented 6 months ago

Tested today, it works great.