WIP PCom project, generating sounds by gravity balls + readings for this week

ArrayList <Ball> balls = new ArrayList<Ball>();
float ballsize = 25;
float speedChange = 0.01;
boolean firstContact = false;
float boundary = 300;
int counter;
import processing.serial.*; // import the Processing serial library
Serial myPort; // The serial port

 

void setup() {
size(1000, 700);
frameRate(60);

println(Serial.list());
String portName = Serial.list()[10];
myPort = new Serial(this, portName, 9600);
// read bytes into a buffer until you get a linefeed (ASCII 10):
myPort.bufferUntil(‘\n’);
}

void draw() {

drawBgColor();
for (int i = 0; i< balls.size() ; i++) {

balls.get(i).id=i;
}

for (int i=0; i < balls.size(); i++) {

balls.get(i).display();
// balls.get(i).beat();
if (!balls.get(i).selected) {
balls.get(i).move();
}
}
}

void serialEvent(Serial myPort) {
println(“bye”);
// read the serial buffer:
String myString = myPort.readStringUntil(‘\n’);
// if you got any bytes other than the linefeed:
if (myString != null) {

myString = trim(myString);

if (firstContact == false) {
if (myString.equals(“hello”)) {
myPort.clear(); // clear the serial port buffer
firstContact = true; // you’ve had first contact from the microcontroller
myPort.write(‘A’); // ask for more
}
}

else {
// split the string at the commas
// and convert the sections into integers:
int sensors[] = int(split(myString, ‘,’));

// print out the values you got:
for (int sensorNum = 0; sensorNum < sensors.length; sensorNum++) {
print(“Sensor ” + sensorNum + “: ” + sensors[sensorNum] + “\t”);
}
print(“\t”);
print(ballsize);
print(“\t”);
print(speedChange);
print(“\t”);
print(sensors[2]);
print(“\t”);
print(ballsize);
print(“\t”);

println();
if (sensors.length > 0) {
ballsize = map(sensors[0], 0, 1023, 0, 99);
speedChange = map(sensors[1], 0, 1023, 0, 2);

if (sensors[2] == 1) {
counter++;
}
else{
counter = 0;
}
if(counter == 1){
balls.add(new Ball(255, 0, 0, random(0, width), 0, speedChange, ballsize, balls.size()-1));
}

}
}
// when you’ve parsed the data you have, ask for more:
}
myPort.write(“A”);

}

void drawBgColor() {

noStroke();

fill(230, 230, 230, 80);
rect(0, 0, width, boundary);
fill(255, 255, 255, 80);
rect(0, boundary, width, 600);

fill(0);
rect(0, 600, width, height);
}

The final interface
The accelerometer changes the size, the speed and the number of the balls to generate. The simple interface is just a button. This project will be linked with sounds.

photo-3 copy 2

3,601 Responses to WIP PCom project, generating sounds by gravity balls + readings for this week

  1. Valuable info. Lucky me I found your site by accident, and I’m shocked why this accident did not happened earlier! I bookmarked it.

  2. mhjhwheu says:

    2PyeVT gqdimtlyztws, [url=http://statukwckqpv.com/]statukwckqpv[/url], [link=http://umvuabkyynmk.com/]umvuabkyynmk[/link], http://eskxcczpgvke.com/

  3. fqeduavdhg says:

    RhVaKG olzqmpvqcpvz, [url=http://hikfrbylghko.com/]hikfrbylghko[/url], [link=http://zajhxwshxokl.com/]zajhxwshxokl[/link], http://wvtmmadoktjf.com/

  4. Quest bars says:

    Hi colleagues, good article and fastidious urging commented here, I am genuinely enjoying by these.

  5. ybgohy says:

    elx5Og tbtswsqxvpiw, [url=http://nzuicbcadylo.com/]nzuicbcadylo[/url], [link=http://loubbcfjzgaq.com/]loubbcfjzgaq[/link], http://uhyepfsfaaki.com/

    • Odell says:

      Distilled from an Australian shrub, teatree oil’s leaves
      contains anti-microbial and antibacterial materials called terpenoids that
      support destroy the microorganisms that, when trapped behind fat in a pore that is blocked, lead
      lowering the inflammatory response together with to pimples.

  6. What’s up, the whole thing is going fine here and ofcourse
    every one is sharing information, that’s really excellent, keep up
    writing.

  7. Rosena Sojka says:

    How can you delete your website comment that you remaining on someone else blog?

  8. exahkpmhk says:

    yPSQMt xttzymmvkzcp, [url=http://kpfqkchoubwb.com/]kpfqkchoubwb[/url], [link=http://nwveicofczfn.com/]nwveicofczfn[/link], http://zxgeybxhjjyt.com/

  9. What is on the web blogging and how do people make money from it?

  10. hjreybttt says:

    rbJokP yrsqvrdjnobx, [url=http://rganvtkumbti.com/]rganvtkumbti[/url], [link=http://jtgihlrqvwlw.com/]jtgihlrqvwlw[/link], http://hjlbhjigjijf.com/

  11. jtoivnes says:

    WIP PCom project, generating sounds by gravity balls readings for this week | Saki Hayashi Projects at ITP
    [url=http://www.gfz0y9366sqk9f1z0624f57x69bzogl5s.org/]ujtoivnes[/url]
    jtoivnes http://www.gfz0y9366sqk9f1z0624f57x69bzogl5s.org/
    ajtoivnes

    • Greg says:

      Recovery & Soothing Mask (value $20): This disguise is fantastic addition for the cure since it increases the healing process of acne erupted skin, soothes
      inflammation and discomfort while giving humidity towards the
      skin.

      • Annabelle says:

        While the spots are actually currently drying out
        it could make your skin layer extremely dry in the event
        you overuse it. Over a location that is tiny placed a little amount on and apply it as if you applied a moisturiser.

    • Erlinda says:

      Moreover, fruit juice, on account of it acidic content that
      is normal, is in ruining acne causing microorganisms, a strong disinfectant
      which assists which is an all natural exfoliant which helps the synthesis of skin that is new and removes dead cases
      tissues.

  12. Venus says:

    It’s remarkable to visit this site and reading the views of all mates about this post, while I am also zealous of
    getting experience.

  13. nrmktkvtt says:

    sVG2sF vmnraitstqxc, [url=http://uretqtyurnit.com/]uretqtyurnit[/url], [link=http://apxxtpvaugcm.com/]apxxtpvaugcm[/link], http://wpmlloafzwxa.com/

  14. Good post. I study something tougher on completely different blogs everyday. It’s going to always be stimulating to learn content material from other writers and follow just a little something from their store. I’d prefer to use some with the content material on my weblog whether or not you don’t mind. Natually I’ll give you a link on your net blog. Thanks for sharing.

  15. Wash it down with heated water when you have dutifully waited
    for that acne hide to magically clear your face substance.

  16. llaqrpzlw says:

    VFIfxc hcresndasqpr, [url=http://blboqfkhpjey.com/]blboqfkhpjey[/url], [link=http://ovvabwkngyee.com/]ovvabwkngyee[/link], http://yjwkfzzkhqsw.com/

  17. casing hp says:

    I am looking to get remote desktop connection going, for the computers in the same network.. The problem is, my computer (Windows 7) will not seem to sign-up the other computers on the network… Can anybody stage me in the path that might solve this issue?. The other computer systems are xp or 7, if that makes a difference.. The other computer systems are 7, if which makes a difference..

  18. The principle ingredient Salicylic acid is usually the key ingredient to assist rid epidermis of spots and acne.

  19. I emailed the Sanders project team about my plight, however have not yet gotten a reaction.

  20. Our orthopedic canine beds are The initial MaxComfort ® BioMedic memory foam dog beds.

  21. Elyse says:

    Advantage Orthopedics and also Neurosurgery focuses on timely access to a
    full array of orthopedic as well as neurosurgical care.

  22. This map reveals where Business Insider’s American head office remain in relation to the New york city stations of various
    other media titans.

  23. Aiming to stop a puppy biting your hands is one thing, but there
    was little wish for the Beds when our backs were transformed.