Search code examples
iosswiftxcodeaudiokit

AKCallbackInstrument midiIn and status on callback not working


I have upgraded AudioKit to 4.6.1 and now cannot compile my application. 2 issues came up are connected to the AKCallbackInstrument class.

first:

callbackTrack?.setMIDIOutput(callbackInstrument.midiIn) which comes up with Value of type 'AKCallbackInstrument' has no member 'midiIn' which is wiered because AKCallbackInstrument inherits from AKMIDIInstrument

second:

callbackInstrument.callback = { status, noteNumber, velocity in
    if(status == .noteOn){
        // ...
    }
}

this notes: Ambiguous reference to member '==' , this isuue I saw on SO already but nothing helped.

Thanks :)


Solution

  • Because I got few questions personally I'll post here what worked for me as an accepted answer.

    change AKCallbackInstrument with AKMIDICallbackInstrument and the API should work as expected.

    * Please make sure you use a version that is newer than 4.6.1 as fixes and changes to MIDI components were made in this version release.