math/expr for ease in and ease out


    Jan 22 2006 | 10:52 pm
    Hi Maxlist,
    I'm trying to create some patches which (using line) numerically ease in, ease out, and ease in and out (like a window). It doesn't really matter what kind/range of numbers. I've tried a few things with Table and Buffer, but was hoping to figure out a way to do it all within an expr. I also wanted to avoid using a signal in MSP. I've gotten it to work fairly well using sin/cos, but was curious if there was a better way to do it. I haven't been able to figure out a good way to do both an ease in and ease out (i.e. easing out from 1 and going to 100 and easing in to 100).
    Here's what I've accomplished so far (seeing this will make more sense):
    I would greatly appreciate any suggestions.
    Thanks!
    www.bartwoodstrup.com

    • Jan 23 2006 | 12:18 am
      Hi Bart try this
      Martin~
      Dr. Martin Parker martin.parker@ed.ac.uk Lecturer - Sound Design Room G.02 extension 50 2333 Tel: +44(0)131 650 2333 http://sd.caad.ed.ac.uk/ http://ddm.caad.ed.ac.uk/
      Postal address Sound Design Department of Music University of Edinburgh Alison House Nicolson Square Edinburgh EH8 9DF, UK
    • Jan 23 2006 | 1:26 am
      On Jan 22, 2006, at 5:51 PM, vodstrup wrote:
      > Hi Maxlist, > > I'm trying to create some patches which (using line) numerically > ease in, ease out, and ease in and out (like a window). It doesn't > really matter what kind/range of numbers. I've tried a few things > with Table and Buffer, but was hoping to figure out a way to do it > all within an expr.
      If you're trying do windowing entirely with an expr, what you want to do is assume the input is in the range 0 to 1. You can create a number that moves repeatedly from 0 to 1 with the line object. Just run that through an expr, and you're all set.
      Below is an example of how to use just a line and expr object to create hann (aka hanning), hamming, and triangle windows without MSP objects. As you can see, it is quite easy.
      Formulas for many window types are available here: http://en.wikipedia.org/wiki/Window_function
      - John
    • Jan 23 2006 | 1:24 pm
      On around Jan 22, 2006, at 23:51, vodstrup said something like: > I'm trying to create some patches which (using line) numerically ease > in, ease out, and ease in and out (like a window). It doesn't really > matter what kind/range of numbers.
      You might want to look at lp.scampf and friends from the Litter Power Package. Using the symmetry and curve options you can get mappings like the one below. The lcd at right is generated by the scampf object with the values shown. You can easily set up arbitrary input and output ranges with arguments or the four middle inlets.
      You won't get a mathematically exact Hamming window (at least, that's not what lp.scampf was designed for), but you can get a wide and wild variety of ease in/ease out functions.
      Lp.scampf is in the Litter Starter Pack (free, see URI below), as is its integer-producing partner, lp.scampi. Their signal-processing pal, lp.scamp~, is in Litter Pro.
      Here are some more mappings generated with different mapping types (linear, exponential, power) and curve factors:
      (exp 30) (pow -2) (lin 14)
      Best, Peter
      -------------- http://www.bek.no/~pcastine/Litter/ -------------- Peter Castine | ^ | Litter Power & Litter Bundle for Jitter pcastine@gmx.net | pcastine@bek.no | iCE: Sequencing, Recording, and Interface Building 4-15@kagi.com | for Max/MSP | Extremely cool | http://www.dspaudio.com | http://www.dspaudio.com/software/software.html
    • Jan 23 2006 | 1:47 pm
      If you want the ramp to the new value to start and end smoothly here are two possibilities using tanh and cosine respectively:
      Best, Trond
    • Jan 23 2006 | 9:44 pm
      These are all very interesting and helpful - thank you!
      Bart