Search code examples
iosswiftaudiokit

Migrating from AK4 to AK5 - AKOscillatorBank change to Synth


I'm migrating my project from AudioKit 4 to AudioKit 5 and currently stuck on a bad access error. The variables look like they are passed correctly into the SynthVoiceStart method. I'm quite stumped why it's throwing the error as it should be a simple change from AKOScillatorBank to the Synth object.

The project code is accessible HERE on GitHub.

I've attached a screenshot below.

XCode Error


Solution

  • This is more of a comment, but I don't have enough reputation.

    In the past I've investigated and managed to solve EXC_BAD_ACCESS errors with AudioKit by using Address Sanitizer (ASan). In XCode go to Edit Scheme, Diagnostics tab, and tick the Address Sanitizer option. When your program is recompiled and run, ASan will print a report whenever a memory error occurs. This sometimes gives useful information to resolve the error.

    Edit Scheme with the Address Sanitizer option shown