Teensyduino 1.53 Audio library issues vs 1.51

Status
Not open for further replies.

quarterturn

Well-known member
I have an Audio library synth project which works fine on 1.51 but on 1.53 has issues with the release phase of envelopes never happening - notes basically get stuck. Attack works fine, and I have decay set to 0.0 and sustain set to 1.0 manually. Has anyone noticed this or other problems with the Audio library due to recent Teensyduino changes?

Code in question is here: https://github.com/quarterturn/teensy3-string-machine
 
Hello, this is of no help, but I've not noticed particular problems with the Audio Lib in TD1.53 and I'm using about 260 audio objects and 546 patchcords. Can I suggest you create the waveform objects before the envelopes? It may do nothing, but the order of object creation does matter and I managed to get rid of digital noise by changing object order. For instance, objects that feed back to earlier objects need to be created near the start.

This is unrelated but I found AudioNoInterrupts() caused noise(!), so I removed these from my code.
 
I'm also creating enveloped before waveforms so it's something to consider. Unfortunately the way I cased my Teensy 3.6 setup precludes being able to keep it plugged into USB and it's major disassembly to get it out, so I'm holding off on serial debugging for the time being.

EDIT:
I want to mention that while 1.53 caused issues, I did notice that waveforms are now phase-locked by default, which in my use case is what I want, since I'm trying to replicate a top-divider sound.
 
The way the audio library connects AudioStream objects together relies on every source being defined before all its destinations
from what I can understand of the mechanism. Failure to do this can have random results as the system will basically work
but updates happen out of order w.r.t. dataflow and garbled audio can appear as audio blocks are recycled without being written,

I've encountered this switching from plausible behaviour to erroneous behaviour and back again in a mysterious way, dependent
on how big the parameter to AudioMemory was...

The design tool will get the order of definition right of course.

There's a TODO: comment in AudioStream.h about the possibility of adding a proper dataflow analysis to the AudioStream
tree to finesse this issue.
 
I re-ordered things to match what the online generator spits out, but this didn't result in a full fix. Now instead of voices always hanging they do so randomly until the same note is played again. In my code I re-use a voice if the same note is played while the note is active, and I make sure to do a noteOff() before the begin(), since I've read there can be issues if a waveform is re-triggered before it gets to the release phase otherwise.

So either there's something wrong in 1.53 or there's something broken in my code which nonetheless gets by in 1.51. I'm pretty sure of my voice-assigning and voice-stealing code at this point, but it's possible there's something I have overlooked.
 
Have you use AudioMemoryUsageMax ? The memory usage may have changed between releases for some components perhaps?
 
Status
Not open for further replies.
Back
Top