FAB ACADEMY 2024 
FABLAB U. CONTINENTAL, PERU

LASER MIDI HARP

What's is?

The MIDI Laser Harp is a MIDI controller consisting of 6 light beams lasers each equivalent to a musical note. 

How it works?

Once the user interrupts a certain beam of laser light, the device will generate a signal which will be interpreted by a MIDI compatible device, either a computer or a synthesizer and this in turn will play the sound of the note played. Since the device works with the MIDI standard, the user will be able to customize the sounds that will be generated when you play the notes to your liking. Thus, the laser harp will be able to sound like a piano, a battery, even like an accordion using a computer or synthesizer compatible. This mechanism opens up a great number of possibilities that the harp can offer in its interpretation thanks to the use of MIDI.

It is explained below by means of an operating diagram. General MIDI Laser Harp:

Inspiration:

Jean Michel Jarre, French electronic musician, performing an amazing light and laser show.

My goal is make a MIDI instrument using microcontroller, LDR, and MDF, easily and cheap. Can be used for academic purposes, teaching music with no contact even.

Components:

This is the list of component I will use.

01 x FabDuino controller

01 x USB Serial Interface

06 x 5mW Laser pointer

06 x LDR 1Kohm

AWG 22 color Cables , jumpers 

01 x 60x60 cm MDF (5.5 mm depth)

The Process:

First, I got some cheap laser pointers. Those have red light.

Then I disassembled carefully the laser pointers like the image below.

Next, I found the VCC and GND pins easily. I bridged the button switch to always turned on.

I used 5V power supply to test each laser. Even the power source from Fabduino could energize all lasers!

Next, I designed a structure to support those lasers using Autocad software.

MDF Plans

The structure was designed in Autocad software, a DXF file was generated. I used 3mm MDF structure but I realized it was so unstable. The I try with 5.5mm MDF and got better stability.

Next I used RDWORKS software to generate GCODE for the machine for laser cut. I set power 60% and speed 30%, for 5.5 mm depth. 

Then, the laser cut machine did the job!

The pieces were ready to assembly!

Circuit

The connections is shown below.


Fabduino

Controller used in this project: FabDuino, Atmega328P SMD.


Connections


Code / Firmware

Code for Fabduino

const int notes=6;          // set up number of notes
boolean notePlaying[notes];  //note states array: keeps track of whether a MIDI note is "on" or "off"

int scale[notes]={0,2,4,5,7,9};       //major scale
int beginNote=0X3C;                                  //starting note value (default middle C)
int threshold=400;                                //value which analogRead() must cross for a midi note to be triggered

boolean midiMode=true;                          //set this to "true" before uploading MIDI firmware (http://hunt.net.nz/users/darran/weblog/52882/Arduino_UNO_MIDI_USB_version_02.html) to 16u2

void setup(){
  if(midiMode){
    Serial.begin(115200);           //midi USB baud rate = 115200
  }else{
    Serial.begin(9600);           //for testing values
  }
}

void loop() {
  for(int i=0;i
    if((analogRead(i)
      int note=beginNote+scale[i];
      midiMessage(0x90, note, 65);//, 100);                          
      notePlaying[i]=true;                                              
    }

   if((analogRead(i)>threshold)&&(notePlaying[i]==true)){        //note off messages
      int note=beginNote+scale[i];
      midiMessage(0x80, note, 65);//, 0);
      notePlaying[i]=false;                                        
    }
  }
}

void midiMessage(int commandByte, int channelByte, int data1Byte)//, int data2Byte)
{
  if(midiMode){
    Serial.write(commandByte);
    Serial.write(channelByte);
    Serial.write(data1Byte);
   // Serial.write(data2Byte);
  }else{
    if(commandByte==0x90){
      Serial.print("Note On message: note ");
    }else if(commandByte==0x80){
      Serial.print("Note Off message: note ");
    }
    Serial.print(data1Byte);
    Serial.print(", velocity ");
//    Serial.println(data2Byte);
  }
}



Software for PC

For a real test I used the lastest version of FL studio. This demo version has a MIDI sequencer and free VST plugins for live MIDI playing.

Testing


Final assembly and testing.




Simulation:

My project was simulated on Proteus software. My design is shown next.

ATmega328P uses the 06 ADC ports to emulate the harp cords. There's a threshold to calibrate. When the value is more than 512 of ADC, it's play the note. The serial terminal shows the midi commands sent (in HEX). 

A COM PORT was added to the simulation.

Virtual Serial Port software was installed to add a virtual COM PORT

Select Pair Ports, in this case COM1 and COM2.

Then select COM PORT from Proteus and check its parameters.

Check the baud rate, set 115200 baud. Select COM1.

Then, install LoopMIDI, and add a port, set whatever name. 

Then, install Hairless MIDI to bridge serial interface to MIDI OUT.

First, select COM1 (Virtual port), then Select loopMIDI Port on MIDI OUT. Go to File - Preferences and set the baudrate to 115200. Click OK.


Then, install Virtual Midi Piano Keyboard and configure MIDI connections.

Enable MIDI IN, select loopMIDI Port, check copy MIDI in to output. Select Microsoft GS Wavetable Synth on MIDI OUT.

Finally, start the Proteus Emulation and change the ADC value.

When the value of ADC is less than 512, then a MIDI message was sent to serial TX and play the selected note. 

Slide / Infographic


Video / Presentation

Summary

This project is about a laser harp through MIDI signals. And it was inspired by the musician Jean Michel Jarre. It consists of a small structure that contains 6 laser diodes that emit their light to a receiver which activates and/or deactivates a signal by interrupting its light. This system has an electronic card and LDR sensors, which when interrupting its light generates a "MIDI message" which allows listening to a musical note. This board connects to the computer where we have sound sampling software, so we can play any sound via MIDI. This project is intended for hobbyists, musicians and enthusiasts, including children for learning music in a different and didactic way.

Material List

01 x FabDuino controller
01 x USB Serial Interface
06 x 5mW Laser pointer
06 x LDR 1Kohm
AWG 22 color Cables , 
jumpers 
01 x 60x60 cm MDF (5.5 mm depth)
01 x USB Cable B type

Assignments references

In this project, some assignments were linked such as: Electronics Design (Fabduino), Computer Aided Design (structure)

Files download

Project plans download here
Project slide here
Project video presentation here

License type

I believe that the most appropriate license is Creative Commons, the future plan is to have income resulting from the applications derived from the asset that is being generated. A non-commercial and non-derivative license is appropriate for those plans. My medium-term goal is to make my project known to the greatest number of people, and from the activities that are generated as a result of this disclosure, generate income. The Creative Commons license is "(CC-By-NC-ND)".

Project Background

There are some antecedents of the project, other similar developments and inspired by music. Here I quote a few: https://www.instructables.com/Quick-Arduino-MIDI-Laser-Harp/
Breadboard laser midi for test purposes

https://www.instructables.com/Upright-Laser-Harp/
More complex laser system

https://www.instructables.com/13-Note-MIDI-Laser-Harp-Controlled-by-Arduino/
Laser MIDI based on reflection