Prototyping a transfer function graphically

Hi guys,

I’m looking for a way to map a series of input values (coming from another application via OSC) to as many synthesis parameters in a relatively quick and easily editable manner.

I am used to using .linlin or .linexp methods, but in this particular case, I am looking for a different method.

In particular, I looking for a sort of method that can call up an in-out transfer function that can be manipulated via a graph, where the control points can be adjusted via mouse interaction.

Is there something similar out-of-the-box in sc? or maybe some quark I can use?
Thank you so much for your help
n

You can do something like this using a OpFunction. Maybe you can write a method similar to linexp, so you can use another function instead? Or are you thinking about a lookup table?

(
a = { (b + 1)/(b**3 + 2*b - 1) }; 
c = (0,0.01..1) collect: { |i| b = i; a.value};
c.plot;
)

Or:

(
f =  { |a, b| sin(a) * cos(b) };
g = (0,0.01..1) collect: {|i| f.applyTo(i, 3-(i))} ;
g.plot
)

2 Likes

To create a lookup table that allows mouse-based input, I’d suggest using a MultiSliderView to generate an Array. You can then employ Array.blendAt(Float) to use it a bit like you would use linexp. I think that’s what you really asked, sorry.

( // multislider:
var size = 200;
w = Window(bounds:Rect(700,200,830, 150));
w.view.decorator = FlowLayout(w.view.bounds);
m = MultiSliderView(w, Rect(0, 0, 820, 100));
m.value_(Array.fill(size, {0.01}));
m.isFilled_(true).indexThumbSize_(2.0).gap_(2);
w.front;
)

// use blendAt for interpolation:
a = m.value;
f = {|i| a.blendAt(i * a.size)};

// 0-1 range:
f.(0)
f.(0.1)
f.(0.5)
f.(0.8)
2 Likes

Maybe you are looking for this: New class VisualBuffer
Have a look at the demo video, it’s quite impressive!

1 Like