shift sequence startingpoint, wraparound?


    May 01 2019 | 3:52 pm
    Hi,
    i´m driving a sequencer with a counter and a coll which stores 16 values, each value a step.
    i use a dial to shift the start of the sequence but of course this shifts the whole sequence out of the 1-16 steps for the number of shifted steps.
    how could i wraparound the numbers so it becomes for example 5 .... 5 rather then 5 ... 21.
    Hope this makes sense :)
    thanks!

    • May 01 2019 | 4:15 pm
      pong @mode warp
    • May 01 2019 | 5:39 pm
      Great, thanks!
    • May 01 2019 | 5:54 pm
      . expr (($i1%16)!=0)*($i1%16) + (($i1%16)==0) * 16 or, if you want it to work with negative shifting, too, expr ((($i1%16) + (16)*(($i1%16)==0))*($i1>=0)) + ((((($i1%16)+16) + (-16)*((($i1%16)+16)==0))*($i1<0)))
    • May 03 2019 | 6:39 am
      Thank you, Roman!