oscillator with amplitude envelope and filter envelope

stefano capas's icon

hello i need to do (as homework) a small subtractive synth. Need to have a saw osc with his amplitude envelope, and need to add a filter with also hs amplitude envelope. I started form saw + amplitude envelope, as i had it working
Then i copied from the help the biquad funcion, and i tried to copy the envelope amplitude, to be used with the filter
But there is something not going well
I think is when mixin the enevelope and the graph part of the biquad..there is somehting not correct
Thanks for helping!

Max Patch
Copy patch and select New From Clipboard in Max.

Sébastien Gay's icon

Shouldn't the output of the [filtergraph~] be an input of the [biquad~], and shouldn't be the output of the [biquad~] that gets multiplied by the envelop ?
Or, do you want to apply the envelop to the [biquad~] parameters and coefficients (Q or gain) ?

stefano capas's icon

ahh
like this seems to work..but i m not sure if it is correct

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

you have no idea what you are doing, right ?


start from checking function output to line~ when mode is set to curve.
use mode linear with line~ , mode curve with curve~ !!!
unless you need it opposite.
then ...
you feed filtergraph~ coefficients for biquad into
+~ and than as signal input to biquad ?
all of that makes no sense.
you need to pick output of function, scale and apply it to some parameter(s) of filtergraph.
then output fitergraph into biquad.
don't bang next if you have no sustain point, because that will restart function.

stefano capas's icon

no just discovered biquad and trying the first time ever to use an enevelope for filter

I know about the line with line und curve with curved..having copied the curved function..i removed the curving parameters and use line~ as output. The functon inside remained curved.. i see but i did not pay much attention to that now

The previous patch i used the suggestion of @sebastien gay for connecting together the function with filtergraph..
But i see it is not correct

Not sure what range use for scale, both for input and output

p.s. i am trying, meanwhile, to learn about modulation,..i have applied to gain, seems working..is that correct?
only thing i cannot apply it to cutoff

In this example it is not working as i am expect anyway
I want that the q Value reach a certain amount according to the envelope..so if q should be 10, i set a long attack for filter envelope and filter should start slowly to move to toe 10 value..but it does not do that

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

this again makes not much sense.
Why don't you go step by step.
1 resolve function output, it make no sense in your patch
2 decide what EQ parameter to use and what range
3 remove that modulator

Max Patch
Copy patch and select New From Clipboard in Max.

stefano capas's icon

ok!! i wasn't so far..my problem was not knowing the curve~--this was crucial to make it work
OIne question. Your cutpff value when no note is played is 426..where does this value is taken? i have it at 100..and cannot change it

p.s.
modulator was just a test..is that a correct way to use it?

aahh yes i have find out..you don't put the release down to 0

Source Audio's icon

426 is result of function/curve end value and scale object

I have no idea if it is "correct" to modulate EQ parameter using
oscilator, but I would not let it run all the time.

maybe start/stop using velocity switch ?



stefano capas's icon

oh yes that's right..i did not think on how to have it start

in modulator i see you use number~ to convert audio to data..is it better than snapshot?

stefano capas's icon

i have put another filter with its envelope

but i m not sure if i shall put it like this..serial..or i should put in parallel the 2 biquad

plus a modulation on 2 filter to move cutoff
is all correct?

Max Patch
Copy patch and select New From Clipboard in Max.

Max Patch
Copy patch and select New From Clipboard in Max.


Roman Thilenius's icon

>> no just discovered biquad and trying the first time ever to use an enevelope for filter

biquad filters are essential, but a bit an unlucky object when using filters for the first time ever, because it is a bit more complicated than some other filter types (or max objects)

to modulate the frequency of a biquad using signals you would not only have to understand that you cannot modulate the list of 5 coefficients coming out of filtergraph (but the frequency input to it), you will also have to calculate the coefficents as audio signals yourself or at least use [filtercoeff~] - which will means that you can no longer use [filtergraph~] for the mouse input and coefficients calculation (you could still use one as display-only though)


but before we make you an biquad practice expert now, i would suggest to look into the [svf~] object.

stefano capas's icon

aaah ok. I will try
But why one should use biquad or svf then? is there pourposes for one and for the other?is one newer than the other? I'd like to understand better
thanks

Roman Thilenius's icon

(dont get irritated by the message cables from filtercoeff. that is an old abstraction by me and not the real object.)

Source Audio's icon

I prefer number~ in this case because it smooths output,
where snapshot~ jumps at set interval.


Last patch you posted - it is all wrong.
you should use only one instance of filtergraph~
to control one biquad~.
if you want to modulate same EQ parameter which gets controlled
by function, neither modulator nor function will be able to perform it's task
100 % because they will affect each other.
but if you want that, merge both controls into one,
which would let modulator scale output of function.

that would make sense to me only in sustain phase of function.

you could modulate different parameter, or even use different scale output of function to control different EQ parameter, but using same filtergraph~

You have to dive a bit more into docs, help, and tutorials,
and at the end ask your teacher, what for does he/she get payed ?





stefano capas's icon

I don't know if you watched the patch now..as i changed both 30 minutes ago for a error
i want to have the 2 filter, (biquad+filtergraph+ envelope), to tweak the sound
So i have 2 differeent section of filter (with all the things) but i am not sure hotow to "mix" them

In short..i just copied all the section you post yesterday and double it
ANd then connected serial and parallel, as the 2 example show

Source Audio's icon

again - if you use filtergraph~ -> biquad~ - only one instance of it !

if you want to modulate 2 parameters - feed 2 values to single filtergraph

about cascading filters etc - you should find out yourself
if what you hear makes sense or not.
I would use one filter that adds enough color to the sound.

Roman Thilenius's icon

biquad is in fact on of the oldest filter models, thought up by mr. nyquist himself in the 1940ies, and it is the most versatile IIR of all.

there are other filters which can do high, low, bandpass and bandreqject, but these others will always sound the same, while in a biquad you can create different sounding filters.

it is also the most effective way how to code a filter with (settable) variable filter types (except when you only use one pole one zero with the max object yada yada, doesnt belong here)

Sébastien Gay's icon

@Stefano : the second patch of your OCT 31 2023 | 6:18 PM message may be a bit odd, but I find this soft-attack viola-like sound, really beautiful.

stefano capas's icon

i am glad you like that sound!Anyway at this stage i am not really focussing on creating sound but rather on the possibility of build a sound maker patch, for experimental sound creation. So in this case i was thinking to build a synth that use 2 filter. Leave modulators aside for now (even if they are there) and just focus on the 2 filter. I put 2 filter not for having 2 modulators...but to have 2 filters.

So i don't understand one thing first:
If i want 2 filters, is it correct to have 2 biquad and 2 filtergraph, and perhaps 2 envelope filter?

Then, yes, i understand that the way they are used (cascade or parallel) may be an individual choiche, depending on the result i want to have

p.s.
I have started study Max for a while round 1 years and an half ago, then i leave it as i realize that it would take too much to master it to be able to produce nice things, and having not so much time i'd rather concentrate on produce sound with softsynth.
Lately i decided to go deeply in the exeperimental electronic music, to use with video i should also create. i searched lessons...and i find a teacher that wants to use max. I don't like so much max for visual (at least for what i have see round), i much prefer Touchdesigner which also i studied a little.
Anyway, i am still undecided though...because now i have clear that max makes me forgot music, in a sense, and just go more and more deep in the "projecting" part of the whole things. I love this i must say, to learn how to, to learn hot to build Still i miss some times to produce some music though...
Do you think people that use max in general have this trend...that in a way prefer to "project" than to play?
Is it "normal"? :=)

Source Audio's icon

just for a bit of fun

Max Patch
Copy patch and select New From Clipboard in Max.

Sébastien Gay's icon

@Stefano : conversations here may indeed sometimes give the impression that people spend more time combining objects and outputting numbers than playing, but I am sure that's not the case !

@S.A. : I got inspired by your patch. Sounds something like Donald Duck singing in a trumpet ? ;-)

HEHE.mp3.zip
zip 388.18 KB

Source Audio's icon

@Sebastian
that is great, if you can also get Daizy, Mini & Co, we could create
Duckburg Sound Bank and try to sell it to Disney ?