GMU:My Computer, Max, and I/Kaël Skyhawk Hauptmann: Difference between revisions

From Medien Wiki
No edit summary
No edit summary
Line 61: Line 61:
= Adding Third Drum Piece  =
= Adding Third Drum Piece  =
== Setting Up Arduino Hardware ==
== Setting Up Arduino Hardware ==
Although, my drum piece was working, I found out when attaching the second sensor that my hardware setup was wrong. I had the circuit connect only through the analog input and ground, so I needed to connect to the 5V to create a true circuit. I did that and then I added the second sensor data to Arduino code and cleaned up the code. The only issue that I'm still dealing with is the values given from the sonsors. For some reason, when I add a second sensor to Arduino, one of the sensors always outputs variable data above 0 when it has not been triggered.
Adding the third piece was the same as the second. I added in another analogPin, another val, and another Serial.print.
[[File:kael_arduino_2_sensor_1.jpeg|400px]]
 
[[File:kael_arduino_2_sensor_2.jpeg|400px]]
[[File:arduino_3_drum_1.png|400px]]
[[File:arduino_2_kit.png|400px]]
[[File:arduino_3_drum_2.png|400px]]
[[File:arduino_output_2.png|400px]]


== Adding Third Drum Piece to Max/MSP ==
== Adding Third Drum Piece to Max/MSP ==
The most difficult part of this was trying to separate the data from each of the sensors. Initially, I tried an unpack, but that was unsuccessful. Luckily, with the help from class, I rewrote the Arduino code, as shown above, and was able to separate the sensors. Once, that was done, it was not difficult to add the next drum piece.
Since I already figured out how to separate the values output from the piezo speakers, it was no problem at all adding the third drum in Max/MSP. I added another element to unpack and then copied the drum setup from below unpack, apart from the audio, which I changed to a cymbal.


[[File:max_2_drum.png|400px]]
[[File:max_3_drum.png|400px]]


Here is the coding for Arduino and Max/MSP:
Here is the coding for Arduino and Max/MSP:


[[Arduino 2 Drum Piece]]
[[Arduino 3 Drum Piece]]


[[Max 2 Drum Piece]]
[[Max 3 Drum Piece]]