[Intermediate/Advanced Max6 gen~ Challenge] gen~ version of MoogVCF pseudocode

Oct 27, 2011 at 4:15am

[Intermediate/Advanced Max6 gen~ Challenge] gen~ version of MoogVCF pseudocode

Been beta-testing like crazy. Max6 is beautiful. gen~ is brilliant and i’m ecstatic about it. I can’t wait for all the kinks to be worked out(like poke channel referencing…) and for the environment to be more comprehensive( loop-ability added to codebox(if/then, while, for, etc.)… and arrays, etc. added to codebox…)…
But i thought i found something i could try and implement using the resources available in gen~ so far… and for now… I’ve failed. I have to keep moving on to other things… must prioritize my time…

HOWEVER! instead of becoming one of the hundreds of other patches I have that sit idly destined to be forgotten in a reservoir of ‘almost-made-its’, I thought I’d throw this one out there.

It is an attempt to create a gen~ version of some pseudocode for a MoogVCF i found at musicdsp.org. The pseudocode is included in a comment within the gen~ patcher here along with a link to the exact page where i found the code originally.

Here’s my attempt at the patch for anyone who feels like carrying on the torch:

– Pasted Max Patch, click to expand. –

Apologies if this is not appropriate for a ‘beta’ forum.
(But it is a Max6 patch… before Max6 has been released.)
There is no bug here.
I’m confident of that. The failure is purely mine as far as I can tell. There is probably something about the order of operations in the pseudocode which i’m not completely understanding, or it may be the lines where an out variable is included in its own definition(for example: out1 = …… * out1). (

#59579
Oct 27, 2011 at 6:10am

yeah, fun idea!
now it does something:

– Pasted Max Patch, click to expand. –

things I fixed:
use + instead of +=
and * instead of *=
first scale frequency as mentioned in the pseudocode fc = in1 / ( samplerate / 2 );

issues left:
smooth parameter changes
blow up for low frequencies (is it possible to reset history somehow?, similar to ‘clear’ with filterobjects?)

#214401
Oct 27, 2011 at 6:20am

“first scale frequency as mentioned in the pseudocode fc = in1 / ( samplerate / 2 );”

awww crap, i can’t believe i completely overlooked that. :p

“use + instead of +=
and * instead of *=”

hmmm…. interesting, didn’t even think of that, just assumed it needed to accumulate, but i see now.

“(is it possible to reset history somehow?, similar to ‘clear’ with filterobjects?)”

in a later version i set the history objects with a third argument of ’0′ as they are supposed to be initialized that way. and likewise, with the history objects named “a1″, etc. you can send a message to gen~’s left-most inlet that reads, “a1 0, a2 0, a3 0, a4 0, b4 0″ to clear everything and reset the history.

as for smooth parameter changes, i bet that would be a bit simpler, either implement the gen~ example for slide~ or some creative use of the mix or smoothstep operators within gen~… just ideas…

Great stuff, Timo! Thanks!

#214402
Oct 27, 2011 at 8:30am

Nice one for the pseudocode, raja. All over this one!

BTW, did you spot my [gen~]-based sinc interpolator? You might be interested.

:)

#214403
Dec 9, 2011 at 4:49am

Here it is. I tweaked it to improve the tuning and adjust for volume discrepancies; feel free to get rid of the latter if it doesn’t suit your purposes. I think it sounds pretty decent. I’ve also posted it in my toolbox, so it’ll be showing up there soon.

– Pasted Max Patch, click to expand. –

And the helpfile:

– Pasted Max Patch, click to expand. –
#214404
May 3, 2012 at 6:59pm

finally revisited this :p

christripledot, no, never saw that, feel free to drop a link if you find this.

peter, nice work.

#214405

You must be logged in to reply to this topic.