Is it possible to make a polymetric sequence "restart"?

For example `"{1 2 3}%8"`

gives `|12312312|31231231|`

, but what I'm after is way to force `"1 2 3"`

to restart every bar (for example), to produce this: `|12312312|12312312|`

.

This is similar to euclidian patterns, but of course just doing "[1 2 3](3, 8)" doesn't give the correct result. Ideally it would be a function, `f`

, such that `f 3 8 "1 2 3 4 5 6 7 8"`

results in `|12312312|`

, `f 5 16 "1 2 3 4 5 6 7 8"`

results in `|1234512345123456|`

, etc. It's sort of a euclidian function that distributes restarts equally over the bar.