View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

fold

Home   How To   Code Pool   Public Library   Theory   Events
"wrap is like going off the edge in asteriods.
fold is like bouncing off the edge in pong."
(crucial, 2001)

Uploaded Image: fold.gif

red: input values
blue: minimum and maximum value
green: resulting values


s = Signal.sineFill(512, [0.5, 0.6]).plot;
s.collect({ arg item; item.fold(-0.3, 0.5) }).plot;
s.collect({ arg item; item.fold(0, 0.9) }).plot;


note
for UGens, use fold2(val), which will fold betwen -val and val:
scope({ SinOsc.ar(200).fold2(MouseX.kr(0, 1)) * 0.2  });


[pong]

Link to this Page