please help :) simple question concerning oscillators

n871's icon

After having tried for hours I give up.. I'm just trying to make a very simple tone in Max Msp. Is there someone who can make a max oscillator sound like this:

(= simple triangular-ish tone at 440hz)

I'm not even getting close, it sounds different from tri, more like rect, but different...please help :)

jb@bmbcon.demon.nl's icon

Hi, if you open your file with an editor, it looks like it's a triangle wave with the points rounded off (it has been shaped or filtered somehow). Try using a tri~ object with a lores~ lowpass filter after it. try changing the frequency of the filter till it sounds the same.
2000 to 3000 hz ??? With this kind of thing it helps to look at an oscilloscope or scope~ ;-)
best, Justin

n871's icon

Hi Justin,

thank you for your reply, helps a lot. Seems like I have to use a combination of a sine and a triangular wave to make it perfect.

it's a lot more difficult, although you wouldn't think so at first...

Wetterberg's icon

>Seems like I have to use a combination of a sine and a triangular wave to make it perfect.

that will give you a roundedness that your original file doesn't have in it.

that last one looks like an oldschool analogue square, rect~ actually is a lot like that - play with the duty cycle, you're looking for less than 0.4, I think.

n871's icon

thanks, but still impossible to get the correct sound perfectly..

LSka's icon

what about loading the sample into [wave~]?

n871's icon

Thanks, wave~ is very useful for my oscillators that don't have to many upper harmonics. The sharper timbres are however more problematic : )

do.while's icon

HI Nate71 , why problematic ? you can map as many cycles of frequency (sampled notes) as you want and try to morph between them while you change your playing frequency . you know what i mean ? a two dimensional wavetable . or "jump" between these phase locked cycles . or something else is stopping you ?
u will never get this un-perfect sound of an analogue oscillator with quite aliased digital implementations . but band limited oscillators are our friends . i saw some Gen examples but never analyzed them .

n871's icon

...is this really possible with a 2 dimensional wavetable? could I load 88 sampled notes?

do.while's icon

an artificial one . if u can live with two playing objects for your oscillator implementation then you could load your cycles into polybuffer and reference it depending on played note , crossfade beetween last played with current note ( sin / cos ) if you dream about portamento or legato with more natural transition between quality of samples without resampling , also useful for FM . BUT you need to take care of your cycles , how you cut them etc .
another way would be more difficult , to use 2d.wave~ where you would be forced to resample all of your sampled cycles to the same amount of samples(size in samps) , lets say 512 samples per cycle ,and phase lock it into one wave to scrub through them using 2d.wave~ object .
or just play requested sample note wave from polybuffer .
i would go for the first solution i guess , so i can easily transite between octaves . im actually interested how would it work

do.while's icon

as for PWM stuff you would be forced to provide altered/distorted phase that runs your cycles (some strange calcs are required unfortunately ) . it may be clumsy for this sort of things but ive been trying to do it in the past with funny results . length and distortion of your phase (to run your cycles) need to compensate to its orginal duration to keep frequency untouched . not easy but doable . cool exercise , at some point gives you power to alter sampled cycles as normal oscillators .

n871's icon

I will have to read this a couple of times : )

do.while's icon

im chaotic , im sorry . i can try to implement this first solution but tomorrow if u dont mind and if u are interested of course

n871's icon

yes!!! I'm interested ! this would be awesome..

do.while's icon

all good then

n871's icon

thanks again man, looking forward to your patch!

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

does anyone know how to fix the last step in this patch? If this works I will have made an oscillator out of chromatic samples..