[sharing] Digital PLL made with gen~

Mar 4, 2012 at 7:04pm

[sharing] Digital PLL made with gen~

I saw someone on another forum ask for advice on how to implement a real PLL using Max/MSP. It seemed like a great task for gen~, so I put this patch together. The gen~ object creates a square wave internally and tries to lock onto the signal from a cycle~ object.

PLLs can be a tricky subject, but playing with the patch doesn’t require understanding the math. I tried to add comments about how tuning controls affect the behavior.

This implementation uses a “bang-bang” phase detector and a PI control loop.
For the interested, wikipedia has a lot of information on PID control loops:
I removed the “D” term to simplify things.

– Pasted Max Patch, click to expand. –
Mar 4, 2012 at 10:37pm

brilliant – it sounds lovely – really crunchy – thanks.

Mar 6, 2012 at 7:07pm

Lovely sounds.

Mar 12, 2012 at 3:23pm

this is very cool, and a lot of possibilities thanks.

Mar 29, 2012 at 6:09pm

I made the post (at least I think it’s the one you mention) over at muffwiggler, so thanks for this, really interesting to see how you implemented it!

Nov 20, 2013 at 9:29am

Hello everyone, I’m looking desperately for a max 5 patch that implements the PLL. some help?
thanks in advance :)


You must be logged in to reply to this topic.