AudioKit 4.0 AKPeriodicFunctions无法启动

时间:2017-10-12 15:36:43

标签: audiokit

无法在XCode 9中启动AK4 AKPeriodic功能。在“Plucked String”游乐场的以下摘录中,我插入了两条日志消息来帮助识别处理事件。我从未在控制台日志中看到“定期函数启动”消息。我听到的只是一声非常短暂的咔哒声。

let scale = [0, 2, 4, 5, 7, 9, 11, 12]
let performance = AKPeriodicFunction(frequency: playRate) {
    print("periodic function startup")
    var note = scale.randomElement()
    let octave = [2, 3, 4, 5].randomElement() * 12
    if random(0, 10) < 1.0 { note += 1 }
    if !scale.contains(note % 12) { print("ACCIDENT!") }

    let frequency = (note + octave).midiNoteToFrequency()
    if random(0, 6) > 1.0 {
        pluckedString.trigger(frequency: frequency)
    }
}

AudioKit.output = reverb
AudioKit.start(withPeriodicFunctions: performance)
print("AK startup")
performance.start()

1 个答案:

答案 0 :(得分:0)

这个问题在开发分支中得到修复,根据这个问题:

https://github.com/AudioKit/AudioKit/issues/1066