First time here? Check out the FAQ!
x

Ramping specific values with interpolateFrom: to:

+1 vote
44 views

http://kyma.symbolicsound.com/qa/?qa=blob&qa_blobid=3041581249605891469

How can I create ramps between two specific values set with interpolateFrom: to:?

So far I can only manage to create ramps that go from 0-1/1-0

and interpolateFrom: to: jumps straight to values but without ramping..

Thanks,

e.

asked Oct 8 in Capytalk & Smalltalk by eli (Practitioner) (920 points)
edited Oct 8 by eli
Hi Eli, could you please give an example expression that jumps without interpolating? Thanks!
Thanks.

I have just attached a sound from the library as an example now.

Here, the Interpolation Value jumps to a new value between !Value0 and !Value1 according to the value of !Position.

This is exactly what I’m looking for but rather than having the !InterpValue jumping straight to the new value when changing !Position, I would like to create a ramp between the current !InterpValue and the new value when changing !Position.

Hope that makes sense..

Thanks

1 Answer

+1 vote

One way to do this would be to smooth the receiver of the intepolateFrom:to: message. For example, you could do:

(!Position smooth: 5 s) interpolateFrom: !Value0 to: !Value1

answered Oct 9 by ssc (Savant) (109,640 points)
Thanks!

I was using ramp: instead of smooth:

That was my problem!

So what I have learned is:

ramp: is a linear function that increases from 0 to 1

smooth: transforms the discrete jumps in a controller value into a continuous linear interpolation from the previous value to the current value.

thanks
...