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

Thread: Signal Path Behaving Unexpectedly

  1. #1

    Signal Path Behaving Unexpectedly

    Hello first time poster here.

    I am working on a synth using the audio library and ran into an issue while using the audio system design tool. The audio line splits off into 3 paths before meeting back up in a mixer. One goes in dry, one passes through a waveshaper and the last passes through a rectifier. For some odd reason, the dry signal has become rectified even though it should not have passed through the effect at all. I double checked that the pathing in the actual code is correct and as far as I can tell everything checks out. Either I'm missing an obvious mistake or there is some weird interaction happening that goes against the intuitive design tool.

    Attached is a zip of my code, a screenshot of the signal chain, and a Pure Data file that I use to modulate parameters while running the synth.

    Any help would be much appreciated!
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,101
    Which teensy?
    Have you checked audio memory with AudioMemoryUsageMax()? Failure to ensure enough audio blocks will
    lead to many odd symptoms as blocks get reused erroneously in this circumstance.

  3. #3
    Quote Originally Posted by MarkT View Post
    Which teensy?
    Have you checked audio memory with AudioMemoryUsageMax()? Failure to ensure enough audio blocks will
    lead to many odd symptoms as blocks get reused erroneously in this circumstance.
    I'm using a Teensy 3.2.

    I currently have 40 blocks allocated and the AudioMemoryUsageMax() function outputs at most 5 blocks in use. (I'm assuming to monitor usage you just add a println() in the main loop with that usage function in the argument?)
    I went ahead and upped to 64 blocks and still no change. Tried 80 blocks and for some reason no audio is being generated.

    Now that I see I'm only using about 5 blocks I'm realizing that 40 might be overkill

    For the record, AudioProcessorUsageMax() shows at most 40% usage.

  4. #4
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,687
    You are probably getting signal clipping from mixer1. The audio design tool docs for the mixer indicate that the sum of the gains into the mixer should be no more than 1. The three gains into mixer1 are each 1 so the total is 3 which will cause clipping. Try changing the gains on mixer1 to 0.33.

    Pete

  5. #5
    Quote Originally Posted by el_supremo View Post
    You are probably getting signal clipping from mixer1. The audio design tool docs for the mixer indicate that the sum of the gains into the mixer should be no more than 1. The three gains into mixer1 are each 1 so the total is 3 which will cause clipping. Try changing the gains on mixer1 to 0.33.

    Pete
    By default the dry signal is set to 1 and the others are set to 0 but the dry is still rectified. I am able to dial in the three volumes using MIDI CC messages from Pure Data. My idea is to blend the three signals and make sure to balance volume so as to not clip unless intended. I am monitoring the waveform with a scope in my DAW as I test things so I can see when clipping occurs as the waveform starts getting squashed.

    Here's a pic of what I'm looking at in order to test the synth and just for reference here's the pic of the signal chain in the zip from my original post.

    Click image for larger version. 

Name:	Synth Design Workflow.jpg 
Views:	15 
Size:	108.9 KB 
ID:	25082

    Click image for larger version. 

Name:	Signal Chain.jpg 
Views:	7 
Size:	25.5 KB 
ID:	25083
    Last edited by AlwaysIterating; 06-19-2021 at 02:18 AM.

  6. #6
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,687
    By default the dry signal is set to 1
    That is true for mixer2 but not for mixer1. The amplitudes of the waveforms going into mixer1 are each set at 0.5 and the amplitude of pink1 is 1, so the total out of mixer1 would be 2.5.

    Pete

  7. #7
    Quote Originally Posted by el_supremo View Post
    the total out of mixer1 would be 2.5.
    Ah I see what you mean. I guess those lines of code in the setup are unnecessary as the amp of each wave is being altered by velocity during the oscPlay() function. The velocity is first divided by 127 to fall somewhere between 0 and 1 and then multiplied by 0.4 so each osc will never be more than 0.4 in amplitude. That is a good point though and I oughta change that scaling value to 0.33 or even 0.25.

    However, in the example pic I added, I have osc2 osc3 and the noise turned all the way down to 0 using Pure Data. (That would be the block titled "MIXER" in the top center that controls mixer1)

    Only osc1 is on at that time with a gain value of at most 0.4 out of mixer1 and as you can see it's still being rectified.

Posting Permissions

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