Basic Midi Controlled Synthesizer Problem

goingdeaf's icon

Hi, I've been using Max for about a year now but so far I've been dealing with mostly DSP. Now that I'm into the realm of synthesis, I have a small issue with ramping/clipping, especially with a sine wave oscillator I'm trying to create as part of a synthesizer.

I have no problem getting the line object via function to 'draw' the envelope of the oscillator/sine wave when I press notes on my midi keyboard but when I release the notes before their time is up (before the envelope release is complete), I get a clipping in the audio signal. I think I understand why. It's due to the breaking of the waveform without fading it out, or smoothing it out, yeah?

Anyway, could someone recommend the best way to do this with synthesis in real time.

Thanks in advance!

: )

AudioLemon's icon

[adsr~] compensates for this by adding a little fade out when it detects a new trigger before the last envelope is finished.

stringtapper's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I *think* this is the problem, but [function] will return to zero if you hit a new note before the first has finished its amplitude envelope instead of ramping from the current value unless you route the first "0." of the list going to [line~]. Here's the solution I was given a while back:

goingdeaf's icon

Cheers folks! Much appreciated!