adjust(actdev,desdev,actweight,pchval,framefirst,framelast) float actdev,desdev,actweight,*pchval,framefirst,framelast; { int i,j; float x,devfact; /* two heuristics here: only shrinking range, and no pitches < 50 hz */ devfact = (desdev > actdev) ? actdev : desdev/actdev; for(j=0,i=(int)framefirst; i<=(int)framelast; i++,j++) { x = (pchval[j]-actweight) * devfact + actweight; pchval[j] = (x >50) ? x : pchval[j]; } }