I have a code for laser harp with one string, like this :
#define MIDICMD_NOTEON 0x90 // MIDI command (Note On, Channel 0)
int sensorPin = 2; // select the input pin for the LDR
int ledPin = 13; // select the control pin for the LED
int val = 0; // variable to store the value coming from the sensor
int potPin = 0; // select the input pin for the potentiometer
int note = 0;void SendMIDI(char cmd, char data1, char data2)
{
Serial.print(cmd);
Serial.print(data1);
Serial.print(data2);
}void setup()
{
// Set MIDI baud rate:
Serial.begin(31250);
//Serial.begin(14400);
pinMode(ledPin, OUTPUT) ;
}void loop() {
note = analogRead(potPin); // read the value from the sensor
val = map(val, 0, 1023, 0, 100);int val = analogRead(sensorPin);
if (val <= 950){SendMIDI(MIDICMD_NOTEON, note, 127); // NOTE_ON
digitalWrite(ledPin, LOW); // turn the led off
delay(5);
while(val > 600) {val = analogRead(sensorPin);}
}
else {SendMIDI(MIDICMD_NOTEON, 60, 0); // NOTE OFF
digitalWrite(ledPin, HIGH); // turn the led on
delay(350);}
}
how to change the code for laser harp with 5 strings?