Newbe question

Dear all, as I am a bit rusted in my electronic skills I'm looking for help here..

Right now I would like to use the Metasurface http://www.youtube.com/watch?v=Jw8wF05GVDM of Audiomulch with a wireless x,y device (like a mouse) to control this surface. This device, which would preferably be placed within a ball, would be placed within a frame so people can move/reposition the ball and thereby change the music.

My first idea is to locate the ball by tracking it within a frame like this: http://www.thebox.myzen.co.uk/Hardware/The_Sound_Square.html

But I am considerably short on time and I am now wondering whether there is an easier method to achieve x,y tracking to control the Metasurface. Maybe by placing a Xbee inside the ball together with an accelerometer? All suggestions are welcome, Help?

Not to be a nuisance, but how can I translate his project towards arduino? I've been looking at it for 4 hours now but I am totally stuck in how I can translate this into an arduino driven piece of hardware (for windows) Do I replace the the Creative USB Interface by the arduino and then use the midi library?

Again, I am really sorry but I am quite new in this matter and I am forced to master this stuff on my own real quickly :(

Right now I would like to use the Metasurface http://www.youtube.com/watch?v=Jw8wF05GVDM of Audiomulch with a wireless x,y device (like a mouse) to control this surface. This device, which would preferably be placed within a ball, would be placed within a frame so people can move/reposition the ball and thereby change the music.

do you want to change the music or create music? in grumpy mikes tutorial he creates music dosent change it and how about a ball connected to a potentiometer ?

would be placed within a frame so people can move/reposition the ball and thereby change the music.

in that case you could have a real mouse at the bottom of the ball ;) that would have been easier

but how can I translate his project towards arduino?

It depends on what you want the arduino to send to the PC. In the project as presented there is the clock and reset input and the detected output. You simply pulse the reset, then look at the photo detector's outputs and pulse the clock again, repeat this 8 times and you see the state of all 8 beams. There are two circuits one for X and the other for Y. You can then take what you found by doing this and send it down the serial port to an application that you will have to write to display the results of the beam being blocked or not and to do something with the result.

Yeah, i practically wanted to use the square as a X,Y midi controller.

What I found when using the Sound Square was that you needed that graphical feedback of the computer display in order to position your hands where you wanted them. Therefore if you wanted to use it as a true stand alone system then you would need some additional form of feedback. I have just got an 8 by 8 led matrix of bi-colored LEDs and was thinking of making a stand alone arduino front end for the project. My idea was to have it output MIDI notes but it could as easily be MIDI control information. Is that the sort of thing you would be interested in?

Actually, I just talked to some people yesterday and what I need in the end is an array of IR emitters/receivers at one side of the square which will read the distance through an analog signal and output this in an x,y value.

And then I'll have to link this data to a midi library and let it behave as an x,y midi controller.

not sure how to read that value and translate to midi yet.

which will read the distance through an analog signal

So how is it going to do that then?

A distance reflective IR sensor is not very accurate over small distances.

Sounds like these people don't know what they are talking about.

It's an IR proximity sensor from sharp. It's accurate from 10-80 cm. I am planning to physically protect the ball from going under that 10 cm. The model is Sharp GP2Y0A21YK.

Not sure if its accurate or not, will have to test that but I am sure that I explained my concept very clear to them so I would be surprised if this would be the case.

By the way, thank you for the input your giving me. This helps and means a lot to me.

but I am sure that I explained my concept very clear to them so I would be surprised if this would be the case.

And I would be surprised if they were engineers and had any idea about how this is going to play out in practice.

I am with Richard - good luck.

could you maybe then tell me more about your approach Mike?

The people I've been talking actually work in an electronic workshop but I am sure that you people know what you're talking about and it is always a rich addition imo to have the opinion of other experts too. Especially if they appear to be completely complementary of each other ;)

But what would be the main issues when if I would use the system I explained before?

Especially if they appear to be completely complementary of each other

I think you mean contradictory ;)

The problems I see is restricting the IR sensor to just looking at you target, I can see people and people parts, arms and such generating the reading rather than the ball. Also it is a comparatively small target for the sensor so I think you would have trouble picking up your target. Also the angle that these sensors work over is not so large and objects at an angle to the beam report different distances to those directly in front of it. There is also the problem with ambient light interfering with the measurements. Finally these sensors are notoriously unstable so I foresee intermittent operation. But then what do I know. ;)

Pardon my English :P

But I see the problems with the interfering of hands but these are easily overcome (I could seal the top off with transparant plastic and make a globe form at the bottom so people can tilt the box to play with the ball.

However, I am still interested in what your approach would be to be able in quickly building the original concept of mine.

By the way, do you guys by any chance know what the viewing angle is of this thing? It's nowhere to be found on the data sheet :S

but these are easily overcome

I hardly thing that completely changing what you are doing by converting it into a giant marble tipping table is easily overcoming anything.

What you have chosen to attempt is not an easy project. It's one of those things that sounds easy if you don't know anything.

Perhaps the simplest way would be to use a translucent table and have a web cam looking up with image processing software tracking the position of the ball. There is no arduino in there but it sounds like the easiest option. Even that has the difficulties of distinguishing the ball from hands and the like on the table.

Hello, I have just created an Arduino account and I have a question. Is it possible to create a Arduino Object Following Robot,not color following but object following with this hardware, 1. Arduino Uno. 2.Sharp IR sensorInfrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F. 3.LinkSprite JPEG Color Camera TTL Interface. 4.chassis and drive components. My main goal is to create a robot that can follow a person,dog,etc... and I don't really want to have to wear a orange colored shirt or wave an orange ball in front of it, in order for it to follow me ,like in other posts iv'e seen.

And if it is not possible what would I need? END POST

I guess the Sound square would be the best approach then. I am thinking of making a 16 by 16 raster then to add some more resolution, is this possible?

Oh yeah I forgot, I am not sure whether it is useful to implement that feedback system Mike, I want those people to explore the soundscape. I guess if the midi signal stays on the same position until the ball gets detected by another sensor there won't be any real problems with the feedback.

Thank again you guys for helping me out, I really appreciate this. If the project succeeds I'll be sure to share it with the rest of you.

Guess I'll have to get up early tomorrow to do some intense soldering ;)

Btw Mike, could you perhaps share the code on how I can read and translate that data to MIDI?

Yes if you were extending it then I would make a few changes to the circuit. Basically I would put a multiplexer or data selector in the input sensors so that you are only looking at the sensor that is being targeted at that instant. That should allow you to make it physically larger or to cram more resolution into the system. The other thing you could do would be to replace the IR LEDs with visible light laser pointers, not only would that allow you to increase precision and sensor density but it would also look awesome if you incorporated one of those ultrasonic water fogging machines to make the beams show up.

Yeah, that would look great! But in this installation I am actually trying to display the shift of cultural values that a Turkish immigrant encounters within The Netherlands, so I would have to think about this as my first approach is trying to communicate this in a modest way.

It is supposed to be an intercultural communication platform so we both can learn something from each other, hopefully bringing each other closer. Not sure if I am making sense though ;)

I'll keep you guys updated on my progress!

So I’ve done some coding and I wanted to test it on a few normal LEDS but I notice that the switching of the leds is going awkwardly slow, I can’t seem to find the error…

here is the code:

//grid vars
int x=0;
int y=0;
int ledPin=0;
int cycle=0;
int sensorCycle = 0;
int sensorCycle2 = 3;
int portArray[] = {A0, A1, A2, A3, 0, 1, 2, 3, 4, 5, 6, 7, 8};
int inputPin = A4;
boolean ledOn = true;
int ledFreq = 26;

//midi vars
int noteLookup[] = { 24, 26, 28, 29, 31, 33, 35, 36 }; // the key of C

void setup(){
 Serial.begin(31250);       // MIDI speed
  for(int i=0; i<16; i++){
    pinMode(portArray[i], OUTPUT);
    digitalWrite(portArray[i], HIGH);
  }    
}

void loop(){
  if(cycle == 20){
    setSensorLed();
    sensorCycle ++;
    if(sensorCycle == 16){
      sensorCycle = 0;
      sensorCycle2 = 3;
    }
    if(sensorCycle == 4 || sensorCycle == 8 || sensorCycle == 12){
      sensorCycle2 ++;
    }
  }
  if(cycle == 5){
    checkSensor();
  }
  blinkLed();
  //generateNote(x, y);
  cycle ++;
}

//Grid sensor/led
void setSensorLed(){
  for(int i=0; i<16; i++){
    digitalWrite(portArray[i], HIGH);
  }
  digitalWrite(portArray[sensorCycle], LOW);
  digitalWrite(portArray[sensorCycle2], LOW);
  ledPin = sensorCycle+8;
}

void checkSensor(){
  if(analogRead(inputPin) == HIGH){
    if(sensorCycle < 8){
      x = sensorCycle;
    }else{
      y = sensorCycle;
    }
  }
}

void blinkLed(){
  if(ledOn == false){
    digitalWrite(portArray[ledPin], LOW);
    ledOn = true;
  }else{
    digitalWrite(portArray[ledPin], HIGH);
    ledOn = false;
  }
  delayMicroseconds(ledFreq);
}

//midi
void generateNotes(byte x, byte y){
 int maskX = 1;
 int maskY = 1;
  for(byte i; i<7; i++){
    if((maskX & x) !=0) { // blocked sensor found so look at y byte
        maskY = 1;
        for(byte j; j<7; j++) {
         if((maskY & y) != 0) sendNote(i,j);
        }
        maskY = maskY << 1; // move mask on and look at the next bit
    }
    maskX = maskX << 1; // move mask on and look at the next bit
  }
}

void sendNote(byte note, byte octave){
  int midiNote;
  int midiChannel = 0;
  if(octave > 3) {midiChannel = 0; octave -=4;} // split into two banks
  midiNote = noteLookup[note] + 12 * octave;
  sendMIDI(0x90, midiChannel, midiNote, 100); // send note on with fixed 100 velocity
}

void sendMIDI(char cmd, char midiChannel, char data1, char data2) {
  cmd = cmd | char(midiChannel);  // merge channel number
  Serial.print(cmd, BYTE);
  Serial.print(data1, BYTE);
  Serial.print(data2, BYTE);
}