Need to recalculate a formula every sample based on result of previous sample.

Mar 14, 2010 at 8:23pm

Need to recalculate a formula every sample based on result of previous sample.

Basically, I want to set up a formula to take the values from the previous calculation and use them as initial values for the next calculation. It’s kind of like the accumulator functions. In C++ it would look like an endless loop that changes the value of x every time around, and x is used to calculate the new value of x.

However, when I try to connect the signal network back into the beginning, the whole thing shuts down (for good reason). I would use tap in and tap out, but they’re limited to vector sizes. I need something that is done per sample. I don’t really want to have to peek the whole thing into a buffer and play it as a sample. Is there another way?

#49146
Mar 14, 2010 at 9:21pm

The [delay~] object can be set to samples lower than the current vector size. Also you can specify a seperate vector size inside a [poly~] but depending on what you’re doing this could eat up a lot of CPU cycles. If you’re feeling adventurous you could write an external in java or C which would give you more control.

lh

#176569
Mar 14, 2010 at 9:34pm

You can’t use the delay~ object in a feedback loop at all though. I think the only way to do this in max/msp would be inside poly~ with a signal vec size of 1 like LH suggested.

It sounds like something better suited to a custom external.

#176570
Mar 14, 2010 at 9:44pm

I’m actually leaning towards making an external. However, there’s problems with that too…I’m having some serious problems getting that underway. I know how to program in C, but I have no idea where the Max API can be found or how to encode them into MXO files. Is there a page that helps get that going? I found a bunch for Java, but I would rather go with C.

It’s really simple, I want to make a lorenz attractor generator. However, it’s gotta work at signal rate. The code is already out there.

http://ozviz.wasp.uwa.edu.au/~pbourke/fractals/lorenz/

When I google on how to set up the API, i just find promotion pages for Max.

#176571
Mar 14, 2010 at 9:58pm
#176572
Mar 15, 2010 at 12:01am

GOT IT! Thanks y’all

#176573
Mar 15, 2010 at 12:34am

For the record, as the directly will be obsolete at the next update, the SDK is called the Max/MSP/Jitter Software Development Kit and can be downloaded from the download page.

#176574

You must be logged in to reply to this topic.