[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:
http://en.wikipedia.org/wiki/PID_controller
I removed the "D" term to simplify things.
brilliant - it sounds lovely - really crunchy - thanks.
Lovely sounds.
this is very cool, and a lot of possibilities thanks.
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!
Hello everyone, I'm looking desperately for a max 5 patch that implements the PLL. some help?
thanks in advance :)
I could be barking up the wrong tree, but I'm trying to implement this as a M4L audio device. I've swapped plugout~ for ezdac~ and I hear it, but I'm not sure if I should expect it to respond to input other than the mono sine wave that feeds it here. I'd like to keep the input stereo to retain any panorama effects that feedforward into this as a device, but it seems like I'd need to edit the gen~ object and it only works for me in runtime mode. I'll try replacing the sine input with a mono signal from Live and see if it works...
So it works with the mono input, but doesn't always sound that musical. I filtered down the input signal with a Live EQ8 and that helped to make it behave a bit more musically. I really want to use this as a guitar effect after seeing this stomp box PLL today: http://www.sunsineaudio.com/Harmonic-Decoder-045.htm
@antoniosvisa : you can easily implement PLL with rate~ and some feedback.
If you need a real accurate and stable PLL, you'll need to work sample tight which you can do by packing your PLL in a poly~ @ vs 1.
I've been using such an implementation in this example : http://vimeo.com/25740547