Variable pulse width (PWM) phasor~ based on this Leafcutter patch?
I'm trying to adjust the pulse width of the phasor object.
I found some gen code by Leafcutter John which created a PWM phasor from a line~ input. As an experiment I tried sending a phasor~ into the input designated for the line~ and was able to get a slow pulse from the output. I was then able to multiply this slow pulse inside gen~ and get the PWM or pseudo-PWM phasor~ modifier that I wanted.
The caveat is that the output is a bit dirty. It appears to have a slow moving crescent shaped PWM moving across the waveform without applying any of my own PWM signal.
So, I'm not totally sure how this gen~ code works but I want to get a clean PWM phasor from the output. Maybe someone could give me an overview of whats going on in this gen~ so I can get the output I'm looking for?
The gen code was found in this thread: https://cycling74.com/forums/pwm-on-different-objects
Here's the code itself. I can't actually find the patch that this originates from, but maybe someone here knows so proper credit can be given for Leafcutter's work.
I realize that this patch can already create PWM phasors from a line~, but I want to create more than one PWM in series and modify them with rate~.
Figured it out after reading some gen~ and accum documentation. The input just needed some filtering. Seems to work now!