 }
 
 float pitchbyteToMidi(byte pitch) {
-    return (pitch / 2) + 36;
+    return (pitch / 2.0) + 36;
 }
 
 void flashled() {

 * communication commands
 *************************
 */
#define rQuery          2
#define rAccelturn      3
#define rGlissturn      4
#define sReady          6

byte serialIncoming   = 0;
int halfTurns         = 1;

void setup() {
    pinMode(LED_BUILTIN, OUTPUT);

    digitalWrite(dirPin, HIGH);
    Serial.begin(9600);
    findsensor(maxPulse);
    //Serial.write(sReady);
    Serial.println("arduino ready");
}

int pitchToPulse(float pitch) {
