[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] mapping, interpolation



also, for complex mappings, look at InterplPairs, InterplXYC and on the server, IEnvGen

Josh

On Mar 9, 2009, at 3:26 PM, Dan Stowell wrote:

2009/3/9, Justin Yang <jyang03@xxxxxxxxx>:
A basics question here. Is there a simple way to do mapping/ normalizing - as x goes from 0-1 map a1 to z1 into a2 to z2?

Not completely sure if I understand you correctly but
SimpleNumber:linlin(inMin, inMax, outMin, outMax, clip) might help?
Maps a linear range onto a different linear range.

15.linlin(10, 20,  44, 45)      // gives 44.5

There's also linexp and explin, which map to/from exponential scales.

And is there a way to interpolate between arrays - as x goes from 0-1 [1, 2.33, 4.01, 7] goes to [15, 96.8, 301, 987.44]?

blendAt:

[[1, 2.33, 4.01, 7], [15, 96.8, 301, 987.44]].blendAt(0.5)

HTH
Dan

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/

******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono
*/


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/