function interpolation with signal rate

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

is there a easy way to make the funcion object work with signal input?

hz37's icon

Aren't you sort of rebuilding [scope~] ? With a real world audio signal there can be many many points, and I don't think [function] will be the object for that.

Hens Zimmerman

double_UG's icon

i am trying to make a Gater ADSR M4L effect that is in sync with Live. You should set the Time lets say at 8 Bars and draw the Gater with the function object. I have already done this with function and line~. The problem is when you start live at the 3 Bar the Gater is out of sync. I wanna be able to sync the function with phasor~ but function accepts only float input and not audio input.

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

I'd write the function to a buffer, then you can do all types of audio stuff to it, including reading with a an index from a phasor~ using wave~:

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

I used javascript here, but you can do the same thing in MSP.

Function_to_buffer.zip
zip
hz37's icon

Alternatively, you can use [snapshot~] to regularly poll your audio stream.

Hens Zimmerman

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

double_UG's icon

I will write the function into a buffer. Thanx Evan for the javascript.

Evan's icon

You're welcome - do keep in mind that the JS does NOT handle curves, and will only work with straight line segments. I also didn't do much testing with this method, and it was kind of a proof of concept thing for me. Use at your own risk ;)

Roland Cahen's icon

Hello,

Thanks for this function to buffer~ example, which works(1). But all together, the all thing is pretty inadequate. Using the function object to drive signal should be straitforward.
Why looking to a set value instead of just interpolating in real time at any position with a signal between 0 and 1 ?
Why not adding a new mode to zigzag~, like mode 1 but without a frequency input.
techno~ could also be a good candidate, but with a function format instead of
the impossible technoui
Could someone at cycling find a proper way ?
Best

Roland

(see example which only works with phasor~ driver)

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

(1) - it works, but : - the .js is linked to a single buffer~ with a fixed name, so you have to duplicate it to use several instances - it is set to a fixed DSP rate (44100) and if you change you must modify the .js - looping transitions end to/from beginning using wave with buffer~ are not perfect.

Roland Cahen's icon

Here is my best solution using buffer~, but somehow in a cleaner way :

BufferLine~.maxhelp

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

and the abstraction BufferLine~.maxpat

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

The main problem is updating two objects (function + buffer) instead of one. Why making complex what could be simple ?

Roland