How to make a waveform using x and y values

Cedric Christ's icon

Hey,

I'm on a project for university and we have to do a synth with Max.

I want to send numbers (x and y values) from processing via osc to max. Fine, no problem with that.
But how can I make these values create a waveform and then make it oscillate in Max?

I dont want to use objects like cycle or saw. I want to create my own waveform.

Do you guys have any experience here and can you help me?

Thank you!

Source Audio's icon

insert or append sample values into buffer using peek~

it depends on your plot - I mean how it translates to

samples.

example x = 100, y = -0.89453

that would mean insert sample value -0.89453 at sample index 100.

what is next x ?

101 ? and so on ?

if not , you need to draw a line that travels from last set sample value to next one

at new sample position.

if you use fixed sample table size of 512 for example, you don't need to send x at all, send all y values as one list.

set buffer to 512 samples size, assign that buffer to cycle~