Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Teensyduino 1.53 Audio library issues vs 1.51

  1. #1

    Teensyduino 1.53 Audio library issues vs 1.51

    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

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,231
    Other ref info:: What Teensy? PJRC Audio board Rev or other hardware?

  3. #3
    Quote Originally Posted by defragster View Post
    Other ref info:: What Teensy? PJRC Audio board Rev or other hardware?
    Teensy 3.6, Arduino 1.8.13 on Ubuntu 18.04, Blackaddr audio interface board.

  4. #4
    Senior Member
    Join Date
    Apr 2019
    Posts
    109
    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.

  5. #5
    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.

  6. #6
    Senior Member
    Join Date
    Jul 2020
    Posts
    348
    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.

  7. #7
    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.

  8. #8
    Senior Member
    Join Date
    Jul 2020
    Posts
    348
    Have you use AudioMemoryUsageMax ? The memory usage may have changed between releases for some components perhaps?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •