Go Down

Topic: Confused about MIDI (Read 554 times) previous topic - next topic

freak174

Hello dear fellow members

Im just about to construct my laser harp very soon. Ive just recently recieved my laser modules and will soon get my phototransistor this weekend.

Ive decided to use MIDI as my interface for generating sounds.  However I am very confused with this, because there are a couple of stuffs I do not get into my mind.
1. How can I get the values of the phototransistor when the laser is on and off?
2. What values does the midi actaully send, how does it know when laser beam one has been blocked? Is it like (very simple), if beam one is struck send a certain value (a note) trough the midi output to the computer.

These are the main two questions.

Between, for a green laser beam I am in need of a phototransistor capable to handle a wavelength of 532nm. So 600nm should work, correct?

Cheers!

DVDdoug

#1
Apr 12, 2012, 01:36 am Last Edit: Apr 12, 2012, 01:55 am by DVDdoug Reason: 1
Quote
1. How can I get the values of the phototransistor when the laser is on and off?
You should be able to download the data sheet for the particular phototransistor, and that will show you how to hook it up.   Typically, there would be a pull-up, or pull-down, resistor wired in series.    If it's a pull-up resistor, the resistor is connected to 5V and the phototransistor is connected to ground.    With a pull-down resistor, the phototransistor is connected to 5V and the resistor to ground.

Then, depending on the light-level, the output will be 5V (approx), ground (approx) or somewhere in-between.     In this application you want a digital signal (on / off = 5V / 0V).   You can run that digital signal into one of the Arduino digital inputs.

You'll have to experiment with different resistor values to make sure it's always turned-on by the laser, but never triggered by normal ambient light.

Quote
2. What values does the midi actaully send, how does it know when laser beam one has been blocked? Is it like (very simple), if beam one is struck send a certain value (a note) trough the midi output to the computer.
Well..  The laser/phodiode has nothing to do with MIDI... Is just an on/off switch.

You'll have to write the code (Arduino sketch?) to turn that signal into MIDI information.   Basically, you'll have the data from your phototransistors going into some Arduino input pins, and MIDI data coming out of an Arduino output pin.

Then, it depends on where you want to go from there... 

If you want to want to run the MIDI message data into the computer through a MIDI interface to generate sounds with virtual instrument software, that shouldn't be too hard (once you understand the MIDI protocol).   You will have to do some research on the MIDI protocol to learn what information is contained in a MIDI message,  and how to generate a MIDI message with the Arduino.   I assume you can find a MIDI library and sample code to help you with that. 

This MIDI software development can be done without the laser harp connected...   Once you figure-out how to generate MIDI data and make sound, you can modify your code so that it's triggered by the laser harp.

If you want to build a physical MIDI instrument to read the MIDI data and generate sounds, that's going to be more involved.

Quote
Between, for a green laser beam I am in need of a phototransistor capable to handle a wavelength of 532nm. So 600nm should work, correct?
It will probably work.  The laser is narrow-band... essentiallly one wavelength/color.  But phototransistors are broader-band and although it will have maximum sensitivity at one wavelength, it should work over a wide range.   Since a laser is high-intensity it will probably work fine.

Go Up