condense pitch search method

Also it's more efficient to do a .length method once per loop than every iteration ;)