Real punching bag and new playtest

Now we have a real punching bag! Between that and also having tied the wires together, now the project looks much more professional. Sadly, I don’t have pictures about the new look.

Some stuff that we had to change:

The new bag is harder than the old backpack, so we had to lower the threshold value in the Arduino code.

This led to the sounds being triggered more often, but also on a big punch more sounds were triggered at the same time. That made the sounds to look more random. To solve this, at first we tried increasing the delay() value, but that only made things more inconsistent. Surprisedly, for me at least, completely removing the delay() call solved things. I don’t know why, maybe the delay() was freezing also the sending of data, so it sent it after the delay, causing the sound in pure data to trigger lately? Or maybe it read an old value of the sensor that was buffered?

The playtest

Few people considered that the sounds relaxed. At least no one thought they were annoying. I think people don’t want relaxing music when hitting, they are more in the mood for something more energetic or about breaking. Fighting sounds and oyster cracking were the two most popular demands. Also, there is a tendency for asking more responsiveness, that the sounds should be triggered more often. I think we solved that when we lowered the threshold and removed the delay.

w2 assignment – bad signs

The problem with that advertisement is the use of the STOP sign from transit. If we apply transit logic, the first meaning that comes to mind is that we have to stop advancing into the construction place because there are bedbugs. Another interpretation would be that the bed bugs have to stop right where the sign is, but that doesn’t make any sense.

Also, the name ‘bed bug king’ sounds a bit paradoxical. The king of bed bugs sounds like a giant bed bug, or the leader of a bed bug colony. That’s not what we would want.

Improvements: First, remove the transit style for the STOP word. Also, ‘Stop THE bed bugs might make more sense’. A better approach would be to change the word STOP by a more specific one, like KILL or EXTERMINATE. In that case, another sign could be used, like the biohazard or radioactive one.

The problem I had here is that at first I read ‘LESS FURNITURE’. Besides that not making sense, it kind of gives the opposite impression. Who would want to go to a furniture store that says that they have less than… normal?

Improvements: Remove the ‘s from the sign. Alternatively, the letters could be colored in a way that it’s clear it says Lee’s. Maybe coloring the two ‘e’?

Here I simply don’t understand the meaning of the top rounded sign. Now that I think of it, it may be addressed towards car drivers, and saying that they should not park there. But it took me a long time. At first I thought it was directed towards people waiting for the bus, and that simply didn’t make any sense! One actually has to wait for the bus STANDING next to the sign. And what’s the meaning of the two-headed arrow? It spans the width of the bus, but what’s important is the length of the bus, not the width.

Solutions: If the sign is actually directed towards car drivers, add a car in the sign. Also, the arrows should change to denote bus length, not width. If the sign is really directed towards bus users, I have no idea because I simply can’t understand the message.

The problem with the sign is its advertisements. More precisely, the size of them. Every sign has the same size, so it is really hard to know what’s that place about. I guess the ‘main’ sign (the place’s name) is the one in the middle, ‘Bushwick Country Club’. If I lived in Bushwick it could be more easily deduced from context, but this is in Williambsurg. Besides, what is a Country Club in a small space like that in a completely urban area?

Solutions: The name of the place should easily be recognizable! Make it bigger, or make the other advertisements smaller.

The picture was taken at night and not so close of the sign, sorry for the bad quality. I found it in the middle of the boulevard with cars coming in both directions, and I didn’t want to stand in the middle of the street. Anyway, what caught my attention in the picture are the two small yellow signs below the bigger one. That’s because they don’t have any image or text, so I don’t know how to interpret them. What are they there for? I think it puzzles drivers more than giving any insight.

Solutions: Remove the yellow signs, or put some text and/or image into them.

Midterm: relaxing punching bag

Today we’re presenting our midterm, yey! The project was made with Oscar and Rafa

The idea of this post is to document the process, and explain some of the code.

First, a video showing what’s about:

We have a ‘punching bag’ (right now just a backpack), that when it’s hit it triggers relaxing music.

Concept documentation

The concept didn’t change much from the previous step, so reading that post may help.

Workflow

1. Punching bag moves
2. Accelerometer attached in bag detects acceleration
3. Arduino receives accelerometer values
4. Arduino sends serial data
5. Pure data receives serial data
6. Pure data triggers MIDI notes based on data
7. Ableton plays music based on the midi notes received

Arduino code

void setup()
{
  // initialize the serial communications:
  Serial.begin(9600);
  int i;
  for(i = 0; i < 100; i++){
    avgX += analogRead(A0);
    avgY += analogRead(A1);
  }
  avgX = avgX / i;
  avgY = avgY / i;
}

As explained in another post, we do a calibration for the accelerometer in the setup() phase. This way, avgX and avgY end up storing the still values for the speed components.

void loop()
{

  vx = map(analogRead(A0) - avgX, minv, maxv, 0, 255);
  vy = map(analogRead(A1) - avgY, minv, maxv, 0, 255); 

  if(abs(vx - oldx) > threshold || abs(vy - oldy) > threshold) {
    vx = vx != 127 ? vx : 128; //we avoid submitting 127
    vy = vy != 127 ? vy : 128; //we avoid submitting 127
    Serial.write(vx);
    Serial.write(vy);
    oldx = vx;
    oldy = vy;
    delay(200);
  }

}

analogRead() – avg gives the calibrated value.
Then, we scale that value between 0 and 255 to fit in a byte.
maxv and minv are the maximum and minimum values obtained by the accelerometer, after calibration. These values were obtained empirically. For the accelerometer used, they are 550 and -550 respectively.

We only write data into serial if the new values from the accelerometer are different enough from the old values sent (the if condition:
abs(vx – oldx) > threshold || abs(vy – oldy) > threshold). This is to avoid playing music sounds because of oscillation, and also to achieve that each punch should only trigger few times a new sound. If we don’t do this, the noteout command from PD overwrites the previous one. That clearly cannot happen at every loop

We never submit 127 because that is 0 speed, and in our PD patch we need the speeds to be always != 0.

Lastly, we update the old values with the ones just sent.

Pure data (PD)

The comport command listens to serial communication on the port specified on the open command above it.

Then, we unpack the two values (vx and vy), and we substract 127, because a value received is between 0 and 255 but speed can go both ways, so actually the middle value is the no speed (that’s why in arduino we never send 127).

With these values, then, we will generate the 8 possible chords played. The chord played is based on the relation between vx and vy: vx / vy. With this (and based on if they are positive or negative), we divided the plane in 8 regions. All the right part of the sketch is arithmetic to determine which chord to play.

The amount of speed is used to set the velocity of the note (MIME protocol). The amount of speed is determined by sqrt(vxˆ2 + vy^2). We divide this value by 2 to make it fit in a byte.

Lastly, the noteout command sends the note to the channel specified.

w1 Assignment – FedEx page

Choosing the piece to analyze was no easy task. At first, I looked at posters of movies/bands/books I liked, but I had a hard time identifying a grid and a typography, and usually there was too much dead space.

I like the FedEx webpage because it is easy to navigate. It doesn’t overwhelm the user with lots of information. The site is concise and not too big.

Structure

The site has a clear distribution of header, content and footer. The content has a very definite grid. Even when the overlay from the navigation in header is shown, the grid is respected.

I strikes me why the grid was not respected in the footer. The 5 categories could be put below the 4 columns, for example putting the 2 shortest ones under the same column, or merging two of them. It may have been made this way on purpose to distinguish the footer from the main content, or to avoid people thinking there is a relation between the footer categories and the main content ones.

Use of space

The negative space on the margins is for centering the page. On the main content, negative space is used as a buffer to have a clear start for the footer. It is again the footer that where I am most confused. There is too many unused space there. I cannot understand why they put the 5 footer sections on the left half of the footer, and they left the right section almost empty, save for the social icons, country/language selector and the 3 links for below on the right. It seems to me that a better distribution could be achieved. Again, maybe it was made on purpose to avoid having too many things close together.

Fonts

For everything but the FedEx logo, the font family is Arial. The site alternates between standard Arial and ‘Arial Narrow’, and sometimes the bold weight is used. The FedEx logo uses a proprietary font, based on Univers and Futura. All the text is left aligned.

Palette

The page has a very clear color palette, reminding us of FedEx colors: purple and grey. Two shades of grey are used, one lighter, mostly for background, and one darker, mostly for font color. And white is used also for background

Accelerometer calibration and Playtest

Accelerometer

We went the route to start with an accelerometer. B_ shared us a model ADXL3xx (thanks!).

As we were told, an accelerometer needs calibration. In the case of the ADXL3xx, even when it’s still its speed components report values bigger than 100. Also, if the accelerometer is rotated (in any of the 3 axis), its new still position will report different values than the previous still position.

To solve this, we made a calibration by code. In the setup method, we calibrate the accelerometer, that is, we store in variables the initial values for the speed components:

long int avgX = 0;
long int avgY = 0;
long int avgZ = 0;

void setup()
{
  // initialize the serial communications:
  Serial.begin(9600);

  /* beginning of calibration */
  int i;
  for(i = 0; i < 100; i++){
    avgX += analogRead(A0);
    avgY += analogRead(A1);
    avgZ += analogRead(A2);
  }
  avgX = avgX / i;
  avgY = avgY / i;
  avgZ = avgZ / i;
  /* end of calibration */
}

Then, we will use the values avgX, avgY and avgZ later on the loop method:

void loop()
{ 
  ...
  calX = analogRead(A0) - avgX;
  calY = analogRead(A1) - avgY;
  calZ = analogRead(A2) - avgZ;
  ...
}

The accelerometer must be as quiet as possible during the calibration fase, and the still position, like a reference position, must remain always the same in this case.

We assume that, effectively, the accelerometer will always have the same position in relation to the punching bag.

Improvements to do: An improvement for this will be to have the calibration in a routine, and then call this routine in the loop method if some trigger is called. A pushbutton wired to the arduino or some trigger from a notebook through serial communication can do the job.

Playtest

We wanted to find out

  1. The public interest in a product like ours
  2. Which kind of sounds did people find more relaxing

For this, we made a poll for people to complete

The first 3 questions were aimed at point 1

For point 2, Oscar made 7 tracks with sounds. People were asked to listen to them and then answer the last question.

Summary of the responses so far:

From this, we see that

  • People really like to listen to music to relax
  • Sounds from track where the most preferred for relaxing, although there is no big difference
  • The perceived effectivity of punching something for alleviating feelings of frustration is evenly distributed
  • There is a small inclination towards working out as a means to relax