PWM on different objects

t.a's icon

hello,

new to max/msp obviously.Can anyone help me on how can I do a pulse width modulation on objects (cycle,saw etc) other than rect ?

thanks in advance

dnk777's icon

you can't
[rect] generates PULSE waveshape. PULSE waveshape does have PULSE width.
saw waveshape and sine waveshape does not have pulse in their waveshape, so you can't even set it's width, while it just doesn't exist.
You can shape their waves in other ways (for example morph SAW into TRI into RAMP), but you just can't modulate their pulse width, if they don't have any...

seejayjames's icon

You can draw arbitrary shapes for cycle~, it uses a sine wave by default but it can be anything, just make a buffer~ with 512 samples and draw into it using waveform~. All the info you need is in the help files for each :)

happy waveshaping

brendan mccloskey's icon

As I've been very vocal on this forum recently, I'd like to sing leafcutter's praises for this gen code, which allows one to vary the width between cycles. I hope he doesn't accuse me of being an in-formant

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

; )

Brendan

brendan mccloskey's icon

....so far, it's brought me a ray of sunshine, but no dough.

Or tea

Etc

AudioLemon's icon
Max Patch
Copy patch and select New From Clipboard in Max.

you can't pwm other waveforms very easily in MSP but you can bend their phase's...

Roman Thilenius's icon

however, i´d like to second seejayjames suggestion to start from cycle~ or wave~ and not from these modern all-in-one oscillator objects, which, in my opinion, are only getting you sidetracked from the fact that maxmsp is a programming language (and not a modular synth).

it will cause some headache at first when you build a PWM-able cycle-based oscillator yourself, but you will end up with a solution which works with ANY thinkable waveform - plus you will learn a lot from doing so.

-110