         setInternalRenderingBlock() // set internal rendering block to actually handle the audio buffers
     }
 
-    // convenience functions to highlight where we actually trigger the instrument
-    func noteOn(note: MIDINoteNumber, velocity: MIDIVelocity, channel: MIDIChannel) {
-        // react to notes however you want in here
-        conductor.playNote(noteNumber: note, velocity: velocity)
+    // MIDI Handling
+
+    func receivedMIDINoteOn(noteNumber: MIDINoteNumber, velocity: MIDIVelocity, channel: MIDIChannel) {
+        conductor.playNote(noteNumber: noteNumber, velocity: velocity)
     }
-    func noteOff(note: MIDINoteNumber, channel: MIDIChannel) {
-        conductor.stop(noteNumber: note)
+
+    func receivedMIDINoteOff(noteNumber: MIDINoteNumber, velocity: MIDIVelocity, channel: MIDIChannel) {
+        conductor.stop(noteNumber: noteNumber)
     }
 
     private func setInternalRenderingBlock() {


import AudioKit

class AUV3DemoAudioUnit: AKAUv3ExtensionAudioUnit {

    var engine = AVAudioEngine()    // each unit needs it's own avaudioEngine
    var conductor = Conductor()     // remember to add Conductor.swift to auv3 target

            let midiEvent = AKMIDIEvent(data: [event.data.0, event.data.1, event.data.2])
            if midiEvent.status?.type == .noteOn {
                if midiEvent.data[2] == 0 {
                    receivedMIDINoteOff(noteNumber: event.data.1, velocity: event.data.2, channel: midiEvent.channel ?? 0)
                } else {
                    receivedMIDINoteOn(noteNumber: event.data.1, velocity: event.data.2, channel: midiEvent.channel ?? 0)
                }
            } else if midiEvent.status?.type == .noteOff {
                receivedMIDINoteOff(noteNumber: event.data.1, velocity: event.data.2, channel: midiEvent.channel ?? 0)
            }
            AKLog("recd \(midiEvent.description)") //todo: handle all midi types of midi events
        }
