Laser Harp

From ESE205 Wiki
Jump to navigation Jump to search

Links

Laser_Harp_Weekly_Log

Git hub

Laser Harp.pdf

Overview

Although instruments have come a long way from their origins, they still have room to grow. Inspired by the transition from acoustic to electronic instruments, the laser harp strives to introduce a new way of experiencing music. With the laser harp, one would be able to enjoy musical scales by touching rays of light. Since the harp will have different keys and scales, it is important that the system's programming is properly carried out so the user can easily operate the instrument. Moreover, the sensors must be properly installed and synced with the disturbance of the lasers' trajectories for the project to be successful.

Team Members

  • Taylor Howard
  • Jennifer Fleites
  • Yoojin Kim
  • TA: Chance Bayles
  • Instructor: Jim Feher

Objectives

  • Learn how to use Raspberry pi and python.
  • Build a circuit connecting the laser diodes, photo-resistors, and LEDs to the Raspberry Pi.
  • Build a frame for the harp through woodworking.
  • Determine which notes or sounds are feasible based on execution of code.
  • Create code to work the Raspberry Pi (this includes code for determining when a note is played,turning on LEDs and playing sounds as notes are played, increasing volume as note is held, playing back a composition that the player wishes to record, and uploading that composition to a AWS server).

Challenges

Software

  • Writing and understanding code that is executed in the different cases that occur when a laser is tripped

Hardware

  • Reliably alligning lasers to photoresistors
  • Cord management

Budget

Planned

Supplied

  • Switch
  • Wires
  • Mulab
  • 4.7 kOhm resistor
  • 220 Ohm resistor

Purchased

Used

Supplied

  • Switch
  • Wires
  • Mulab
  • 4.7 kOhm resistor
  • 220 Ohm resistor

Purchased

Tax: $3.65

TOTAL Purchased: $18.45

Gantt Chart

LHGantt2.png

Proposal Presentation


Design and Solutions

Programming

Determining when a laser beam breaks

The amount of light that the photo-resistor senses is converted to an analog value using an analog digital converter. The analog value is then converted to a voltage value and then to a temperature value. Using this temperature value, it can be determined whether or not the laser beam has been triggered by seeing if the value lies within a certain range. If a beam has been triggered, the sound associated with that beam is played. However, a problem that arises is that due to the running time of the line of code responsible for playing the sound file, the note may not be constant. [Associated Code]

Playing different notes concurrently

Applying an increase in volume as a note is held

In altering the volume, the amount of time that the player holds a note is recorded and for every loop of the wave file that is played, the volume is incremented by a decibel. [ Associated Code]

Concatenating played notes and playing it back

After a note is played, it is added to the composition by concatenating its wave file with the wave file of the composition. The wave file of the composition starts as a blank wave file. To concatenate wave files, import AudioSegment from the pydub library in Python. Then write [compFile = compFile + newFile] where compFile would be the composition wave file and newFile would be the wave file of the new sound that is played. In order to properly execute this part, the correct sound files must be picked so that if one were to concatenate the same file with itself it would create the same sound for a longer period of time with no pauses throughout. To play back the composition, just play the final concatenated file.

[ How to link] [ Associated Code]

Uploading the composition to a AWS server

Building

Results

Next Steps

References

https://www.instructables.com/id/Arduino-Laser-Harp-1/

https://www.instructables.com/id/Quick-Arduino-MIDI-Laser-Harp/

https://hackaday.io/project/28159-laser-harp-cnc-pi-zero

https://projects.raspberrypi.org/en/projects/gpio-music-box

Proposal Presentation