     findsensor(max(maxPulse, endpulse));
 }
 
-int timedturn(int halfturns, int duration, bool dir) {
+int timedturn(int halfturns, unsigned long duration, bool dir) {
     int fullspeedsteps = (halfTurnSteps * halfturns) - (accelSteps * 2);
     unsigned long pulse = ((duration * 1000L) - (maxPulse * accelSteps)) /
                           (accelSteps + fullspeedsteps);

            for (byte d=0; d<rDurlength; d++) {
                newDuration[d] = serialIncoming[++i];
            }
            midDuration = Duration; // midDuration is previous duration
            Duration = atoi(newDuration);
        } else if (data == rReset) {
            defaults();
        } else if (data == rDoubleGliss) {

    return glissTime;
}

void durationturn(unsigned long duration, float pitch, bool dir, bool recentre) {
    _durationgliss(duration, pitch, pitch, 0, 0, dir, recentre);
}

long durationgliss(unsigned long duration, float startpitch, float endpitch,
        bool dir, bool recentre, int sustain) {
    return _durationgliss(duration, startpitch, endpitch, sustain, sustain, dir, recentre);
}
