Any can help with the problem of glide effect with using oscillator. Here is the part of code, I need that every cycle oscillator sounds on new random frequency. But frequencies are changed smoothly with glide effect. How to remove glide effect?
for _ in 1...20 {
oscillator.frequency = Double.random(in: 0...10000)
oscillator.start()
sleep(1)
oscillator.stop()
}
Try adding oscillator.rampDuration:
oscillator.frequency = Double.random(in: 0...10000)
oscillator.rampDuration = 0.0
oscillator.start()
sleep(1)
oscillator.stop()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With