Help with little script

I am new here and have a little question.
Its about this script:

import random
folderSize = op(‘folder1’).numRows
def onValueChange(channel, sampleIndex, val, prev):
op(‘select1’).par.rowindexstart = random.randint(1, folderSize-1)

Now i want it not random but sequentional, so it starts row 1 and then row 2 etc. to a certain row, lets say 20 and then start again with row 1. It would be great if some one can help me with this.


look into modulo operation

op(‘select1’).par.rowindexstart = (op(‘select1’).par.rowindexstart +1)%20

1 Like

Hi thanks very much! It works!