Apr 06 2013 | 6:58 pm

I'm working on an autotuner that only shifts to certain ratios from the root frequency defined in a list. I've worked out the math to select ratios I want and build a list from their multiples and divisors, so I have a long list of available ratios.

where I'm stuck somewhat is figuring out how to deal with this long list in an efficient way to determine which ratio to shift to. I've attached the portion of the patch that given two consecutive ratios from the list and the ratio of the input (determined by pitch~ and division by the root frequency) can determine which of the two to shift to. but for a list that could be up to a few hundred items long, breaking down the list into pairs and repeating this code for each pair seems tedious and probably ultimately not suited to a variable length list.

is there some way I can reference consecutive pairs in a list in an abstract way (without programming $f1 $f2 $f3 $f4 etc.) in vexpr? or am I leading myself towards an unnecessarily complicated solution with what I've got so far?