Signal Path Behaving Unexpectedly

Status
Not open for further replies.

AlwaysIterating

New member
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!
 

Attachments

  • Teensy_Synth.zip
    63.3 KB · Views: 55
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.
 
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 :p

For the record, AudioProcessorUsageMax() shows at most 40% usage.
 
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
 
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.

Synth Design Workflow.jpg

Signal Chain.jpg
 
Last edited:
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
 
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.
 
Status
Not open for further replies.
Back
Top