 
 void setup()   /*----( SETUP: RUNS ONCE )----*/
 {
-// Nothing  (Stepper Library sets pins as outputs)
+  // Nothing  (Stepper Library sets pins as outputs)
   Serial.begin(115200);
   pinMode(laserPin, OUTPUT);
 }/*--(end setup )---*/
 
 void parsePosition() {
   switch (stepID) {
-    case 1:
-      noteOn(0x90, note1, 0x7F);
-      break;
-    case 2:
-      noteOn(0x90, note2, 0x7F);
-      break;
-    case 3:
-      noteOn(0x90, note3, 0x7F);
-      break;
-    case 4:
-      noteOn(0x90, note4, 0x7F);
-      break;
-    case 5:
-      noteOn(0x90, note5, 0x7F);
-      break;
-    case 6:
-      noteOn(0x90, note6, 0x7F);
-      break;
-    case 7:
-      noteOn(0x90, note7, 0x7F);
-      break;
-    case 8:
-      noteOn(0x90, note8, 0x7F);
-      break;
-    default:
-      noteOn(0x90, note1, 0x00);
-      break;
+  case 1:
+    noteOn(0x90, note1, 0x7F);
+    break;
+  case 2:
+    noteOn(0x90, note2, 0x7F);
+    break;
+  case 3:
+    noteOn(0x90, note3, 0x7F);
+    break;
+  case 4:
+    noteOn(0x90, note4, 0x7F);
+    break;
+  case 5:
+    noteOn(0x90, note5, 0x7F);
+    break;
+  case 6:
+    noteOn(0x90, note6, 0x7F);
+    break;
+  case 7:
+    noteOn(0x90, note7, 0x7F);
+    break;
+  case 8:
+    noteOn(0x90, note8, 0x7F);
+    break;
+  default:
+    noteOn(0x90, note1, 0x00);
+    break;
   }
 }       
 
 void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
 {
-  for (int i = 1; i <= 8; i++) {
+  for (int i = 1; i < 8; i++) {
     digitalWrite(laserPin, LOW);
     small_stepper.setSpeed(motorSpeed);
-    small_stepper.step(16);
+    small_stepper.step(stepSize);
     stepID = i;
     delay(motorDelay);
     digitalWrite(laserPin, HIGH);
     delay(laserDelay);
     light = analogRead(lightPin);
-    if (light > threshold) {
-      parsePosition();
-    } else {
-      noteOn(0x90, 0x1E, 0x00);
-    }
-//    Serial.print("ID: ");
-//    Serial.print(stepID);
-//    Serial.print(" Value: ");
-//    Serial.println(light);
+    //    if (light > threshold) {
+    //      parsePosition();
+    //    } else {
+    //      noteOn(0x90, 0x1E, 0x00);
+    //    }
+    Serial.print("ID: ");
+    Serial.print(stepID);
+    Serial.print(" Value: ");
+    Serial.println(light);
   }
   // delay(1000);
-  for (int i = 8; i >= 1; i--) {
+  for (int i = 8; i > 1; i--) {
     digitalWrite(laserPin, LOW);
     small_stepper.setSpeed(motorSpeed);
-    small_stepper.step(-16);
+    small_stepper.step(-stepSize);
     stepID = i;
     delay(motorDelay);
     digitalWrite(laserPin, HIGH);
     delay(laserDelay);
     light = analogRead(lightPin);
-    if (light > threshold) {
-      parsePosition();
-    } else {
-      noteOn(0x90, 0x1E, 0x00);
-    }
-//    Serial.print("ID: ");
-//    Serial.print(stepID);
-//    Serial.print(" Value: ");
-//    Serial.println(light);
+    //    if (light > threshold) {
+    //      parsePosition();
+    //    } else {
+    //      noteOn(0x90, 0x1E, 0x00);
+    //    }
+    Serial.print("ID: ");
+    Serial.print(stepID);
+    Serial.print(" Value: ");
+    Serial.println(light);
   }
   // delay(2000);
 

int note2 = 0x40;
int note1 = 0x47;

Stepper small_stepper(STEPS_PER_MOTOR_REVOLUTION, 8, 10, 9, 11);

int  Steps2Take;
int current;

/*-----( Import needed libraries )-----*/
#include <Stepper.h> 

#define lightPin 5
#define laserPin 7
#define motorDelay 4
#define laserDelay 0
#define threshold 70
#define motorSpeed 700
#define stepSize 2

int note9 = 0x61;
int note8 = 0x63;
