Trying to build Pulse Width Modifier

Yot Magnet's icon

Hi all,

I'd like to build an equivalent of a VST plugin called Pulse Width Modifier from Anarchy Sound Software :
http://www.kvraudio.com/get/559.html

I don't really know where to start. If you can lead me to a good way...

Thanks

Tj Shredder's icon

The description on kvraudio doesn't make much sense to me. How a procedurally controlled variable length delay line should be related to a pulsewidth isn't clear, the next phrase contains an even weirder contradicton: The input signal's fundamental frequency is a sine wave an thus has nothing related to a pulswidth.
But you could have a look at kink~, the number of accessible controls makes me think, they might have a really simple procedure...;-)
You could also try to create a procedurally controlled variable length delay line. tapin~/tapout~...
Then play around and listen (I didn't listen to the vst, I have no idea what it soumds like...;-)

Stefan

Roman Thilenius's icon

anarchy rocks. when he came out with the fft stuff in 2003 i almost
bought a windows computer.

Yot Magnet's icon

The description sounds also weird to me. If I would describe what I hear, it's like the effect of a classic variation of pulsewidth on a square oscillator but for an entire audio Input. Don't know how this effect is done.

I'll try kink~ and let you know...

Yeah, these plugs rock.

Tim Lloyd's icon

"it's like the effect of a classic variation of pulsewidth on a square oscillator but for an entire audio Input"

...that's a confusing description...

Could you post an audio before/after demo? I'm on mac so I can't try it out for myself. What does it do to a static sine tone or a sweep?

Yot Magnet's icon

I agree it's a weird description but this is how I hear it. Here is an example (Dry then Wet then Dry)...
If you know a way to create this effect in Max/msp, tell me.

1738.Pulsewidtheffect.mp3
mp3
volker böhm's icon

if you modulate a delay line with a triangle-like function, you are indeed compressing and expanding the input waveform (changing delay time is changing pitch, is changing period).

so, here is my go on it, only from the short description and listening to your example soundfile, as i can't run the plug myself.
it's not there yet, but might serve as a starting point.

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

vb

Roman Thilenius's icon

i would basically say, phase distortion after the inputs base
frequency/zero crossing are analyzed.

should work the better the simpler the input is (which is why
the string pad example tends to distort.)

-110

Yot Magnet's icon

Thanks Volker. It's kind of that but I think there's a paramater that follows frequencies to avoid the simple distorsion effect.
Roman, do you how can I try this ?

Roman Thilenius's icon

from what i know there is no half wave object coming with maxmsp ... so
need to build your own.

quick and dirty version:
highpassfilter at 30 Hz, lowpassfilter at 340 Hz, then use zerox to find
zero crossings and make a sine or rect wave from it. you now have
something like an "oscillator" with a know frequency, which could be
manipulated with kink~or distorted line~driven, phase by phase.
of course you apply that to the input signal an not to the halfwave signal.

if it works and if it gives a nice result depens a lot on the input signal.