Hi,
I'm trying to implement a simple Karpluss-Strong object for Teensy Audio, and I'm having a hard time.
I suspect that something I'm doing is crashing the audio library, but I can't see what I'm doing wrong.
The object has one input, which is hooked to an AudioSynthNoisePink object, to use it as a source of
excitation for the KS buffer. Normally the KS object would take a small sip from that and then
start iterating on its own buffer from there. However, to simplify debugging, I whittled down my
update() method to the point that all it *should* be doing is copying its input to its output. And then
I reduced it to simply retransmitting the block it receives. Either way, I'm still getting the same problem.
The symptoms are:
-- When I trigger the KS object, I hear a brief burst of noise, then no audio.
-- On the second & subsequent calls to my object's update() method, the receiveReadOnly() method always returns NULL. (Why, I can't say. The gain is still set to 1.)
-- Once this has happened, I hear no more sound out of the library until I reset the Teensy. Completely unrelated objects that work before I trigger the KS object go silent afterwards.
-- All of my midi-event-managing code continues to run, and I get debugging lines from my object which assure me that update() is still being called regularly.
Other things I've tried:
-- circumventing almost all of the audio network & plugging KS directly into the i2s output did not help at all.
-- circumventing the KS object & running the noise directly into the rest of the network seems to work just fine.
... Anyway, I'm going to presumptuously post the current (messy, incomplete, in-process) code here, in the hopes that someone might have time to play spot-the-bug. Thanks in advance! -mykle-
View attachment AudioSyn.h
View attachment AudioSynthKS.cpp
View attachment bleep.ino
I'm trying to implement a simple Karpluss-Strong object for Teensy Audio, and I'm having a hard time.
I suspect that something I'm doing is crashing the audio library, but I can't see what I'm doing wrong.
The object has one input, which is hooked to an AudioSynthNoisePink object, to use it as a source of
excitation for the KS buffer. Normally the KS object would take a small sip from that and then
start iterating on its own buffer from there. However, to simplify debugging, I whittled down my
update() method to the point that all it *should* be doing is copying its input to its output. And then
I reduced it to simply retransmitting the block it receives. Either way, I'm still getting the same problem.
The symptoms are:
-- When I trigger the KS object, I hear a brief burst of noise, then no audio.
-- On the second & subsequent calls to my object's update() method, the receiveReadOnly() method always returns NULL. (Why, I can't say. The gain is still set to 1.)
-- Once this has happened, I hear no more sound out of the library until I reset the Teensy. Completely unrelated objects that work before I trigger the KS object go silent afterwards.
-- All of my midi-event-managing code continues to run, and I get debugging lines from my object which assure me that update() is still being called regularly.
Other things I've tried:
-- circumventing almost all of the audio network & plugging KS directly into the i2s output did not help at all.
-- circumventing the KS object & running the noise directly into the rest of the network seems to work just fine.
... Anyway, I'm going to presumptuously post the current (messy, incomplete, in-process) code here, in the hopes that someone might have time to play spot-the-bug. Thanks in advance! -mykle-
View attachment AudioSyn.h
View attachment AudioSynthKS.cpp
View attachment bleep.ino