MIDO and svgwrite, we designed a program to go through a desired midi file and generate an SVG file with hole placement corresponding to the notes of the song.
Initially, the logical way to encode notes into the sheet is to have one hole slot per note. Every time a note gets played in the song, a corresponding hole is put in the cutsheet. This is helpful, but suppose we want to play a song on a full octave, 13 notes, and we want to play a minute, feasibly 100 notes. That makes the length of the song sheet over 10 times the width and with ¼ inch marbles 25 inches long (not including any margins we would want on the sheet). That is already longer than a full sheet that would fit onto a laser cutter bed. So we have too much length on the song sheet to a small amount of width. To resolve this problem we cut holes in a honeycomb pattern as shown below. With this design we have two holes per note which works better with the thickness of our pipes. This doubles the width of the sheet while cutting the length in half. The two images below show the differing proportions of the two options over the same tune, with the left generated in a normal structure and the right generated in a honeycomb pattern.
This program needs to integrate flawlessly with a mechanical system with parameters stored elsewhere, so we needed to account for:
If you want to explore more of our documented MIDI code and see how we account for all of these variables, checkout the github repo here.
The control for the stepper and DC motors was trivial. We used a transistor along with analog output from the arduino to control the DC motor. For the stepper we imported a stepper library found here to send input to the motor drivers to modulate speed. The code we used can be found here.