Four different attempts at the cymbal (and by extension bass drum and trombone)
So while I’m in waiting mode on the tilt sensors, new pressure sensors, and glove fabrication, I made a decision: I want to do a marching band. Just brass, bass drum, snare drum and cymbal. Funny, effective, and I have the base tech for all of them.
Towards that end, I began to experiment with some things I had in my toolkit with the intent of working out a good proximity systems.

Last week in class I began to play with the gyroscope towards the end of making a bass drum. I got it working but the feedback from Thom and my musician friend Ed was that it really should be based on proximity of the two hands, not just the speed of the hand. To top it off, my gyroscope now seems to be broken.
I also had the Sharp short range proximity sensor and the MaxSonics LV-EZ ultrasonic range finder. GREAT tutorial on both here:
Bildr proximity tutorial
Unfortunately these both had a problem – they are useless at short range! The LV-EZ just holds at a value of 11 within two centimeters, and the Sharp switches at the value of 500 and counts down again to hold at a value ranging from 0-150 based on the reflectivity of the surface that is held against it.
For a moment tried to do it with just a photoresistor, but it is just not accurate enough. Below is some example code I was using with Sharp sensor to do a cymbal with velocity varying on length of hit that doesn’t work due to the short range issue…
int sensor1;
int sensor2;
void setup(){
Serial.begin(9600);
}
void loop(){
int sensor=analogRead(A0);
Serial.println(sensor);
if(sensor>400&&sensor1<400&&sensor1>200&&sensor2<400&&sensor2>200){
int velocity=map(sensor2,400,200,60,127);
MIDI_TX(144,57,velocity);
delay(100);
MIDI_TX(128,57,velocity);
Serial.println(velocity);
}
delay(50);
sensor2=sensor1;
sensor1=sensor;
}
void MIDI_TX(unsigned char MESSAGE, unsigned char PITCH, unsigned char VELOCITY)
{
Serial.print(MESSAGE);
Serial.print(PITCH);
Serial.print(VELOCITY);
}
Chris Piuggi 10:14 pm on April 11, 2011 Permalink |
Looks like your moving pretty well along on this project. Here is a great sample i found for balancing out IR sensors and getting great distances out of them. Anyone could really use this, it give you great system for calculating distance based off of the voltage.
http://luckylarry.co.uk/arduino-projects/arduino-using-a-sharp-ir-sensor-for-distance-calculation/