Week 10 Project

Initally, I wanted to something with potentiometers as they reminded me very much of the knobs we see on MIDI keyboards. I decided to use Max MSP, a digital music coding inteface to see what I could do with analog outputs coming from my two potentiometers. I had two projects.

The first one was using analog outputs from 0 to 1023 to modulate the pitch of a synthesizer. To do this, I mapped the values 0 to 1023 to output as the frequency of a combined sine and saw wave. The result was that the pitch of the wave could be changed by the first potentiometer. Next, the second potentiometer was mapped to volume that way I could control the volume of my synth. Lastly, I used the button as an octave changer. I programmed it so that holding the button down multiplied my frequency of the wave by 2, turning it up an octave.

The other creation was a DJ mixer. I programmed the first capcitor’s output to 1. map to the volume of the first piece of music you inserted, 2. inverse itself and map that to the volume of the second piece of music. This creater a simple fader I could swtich between the two tracks. The second potentiometer remained a volume control. The button allowed you to start/stop both tracks at once so you could play them in sync, and crossfade between them.

One of the issues that came up was the connections breaking. Sometimes I would not notice and the potentiometer would just stop working. To work around this, I made sure everything was on the table, and none of the wires were in tension. Another issue was that I ony had one 5V power supply. While I could link up both potentiometers in parallel, I found this made the analog outputs shaky. To fix this I actually instead connect one of the two potentiometers to the 1.5V power, then changed to scaling of inputs from 0 to 1023 to 0 to 666, allowing for the same range of volume control.

 

In the future I could defnitely add more knobs to modulate more aspects of my sound. And as for the DJ mixer, because we do no precieve sound linearly, when the crossfader was between the two songs, the msuic became way too quiet, a non-linear form of mapping for volume could probably fix this. Another thing to improve is to defnitely create some sort of housing, permanently connecting the electornics to create a box-like apparatus as a DJ crossfader.

 

IMG_8326 IMG_8329

 

 

Week 10 Reading

The part of this article that stuck out to me the most was when the word “tool” was defined. I had never thought of a tool as something that was supposed to amplify human capabiity, yet when he explained his reasoning, using the example with the hammer, it all clicked for me. This meant that when he then goes on to explain the lack to tactile richness in modern day tools as a problem, it makes far more sense for me to see it as a problem.

He then points out that touchscreens should be only a transitionary technology. This really points out the possibilities that I have nver considered due to our complacency in screen usage. I think that being able to control something with our fingers, by dragging something along on a touchscreen is inherently somewhat unnnatrual in terms of what the human mind and body are used to; it is simply an unnatrual way to manipulate ‘objects.’ Yet I believe that in terms of how far away that takes us from perfect design with tactile responses, I would not overlook the human mind’s capacity to ‘fill in the blanks’ and ascertain all that we need to know from the object on the screen. So I personally do not think it is as much of an issue as the article says.

Week 9 Sensor

 

For this project, I decided to use a photoresistor to create a light that detects a light source nearby.

To implement this, I used two circuits; one connected to 5V power supply and another connected to the analog pins, whose power level could be controlled by the analogWrite on IDE. The circuit was not too complicated, connect a manual toggle switch to one side of the circuit, leading into a photoresistor connected to pin A2, leading into the first LED. This would mean the first LED would only light up if  the switch was toggled on. This meant that we could see an indicator if the device is working. Next, connected to pin 8 the other LED was connected. This meant that we can control this LED digitally with the arduino. In the circuit, we could use the input we got from A2 to determine if power should be sent to pin 8.

IMG_8238

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
int analogPin = A2;
int lightSensor;
int brightness;
void setup() {
// put your setup code here, to run once:
pinMode(8, OUTPUT);
pinMode(A2, INPUT);
brightness = 128;
}
void loop() {
// put your main code here, to run repeatedly:
lightSensor = analogRead(analogPin);
if(lightSensor > 500){
analogWrite(8, 1000);
} else {
analogWrite(8, 0);
}
}
int analogPin = A2; int lightSensor; int brightness; void setup() { // put your setup code here, to run once: pinMode(8, OUTPUT); pinMode(A2, INPUT); brightness = 128; } void loop() { // put your main code here, to run repeatedly: lightSensor = analogRead(analogPin); if(lightSensor > 500){ analogWrite(8, 1000); } else { analogWrite(8, 0); } }
int analogPin = A2;
int lightSensor;
int brightness;
void setup() {
  // put your setup code here, to run once:
pinMode(8, OUTPUT);
pinMode(A2, INPUT);
brightness = 128;

}

void loop() {
  // put your main code here, to run repeatedly:
lightSensor = analogRead(analogPin);
if(lightSensor > 500){
analogWrite(8, 1000);
} else {
analogWrite(8, 0);
}
}

The challenges were that it took a long time to make sure the code and the circuit were both correct. One being correct while the other being wrong would mean the whole thing would not work. Hence, in my making process, I took time testing the two parts individually. Initally there was some confusion on my end pertaining to the difference between analog and digital writing, as using the wrong one meant my LEDs were not lighting up.

This project could definitely be made more complex. I think adding a variety of lights and changing the different thresholds to which each individual LED would light up is a good way to make this project more useful.

Week 9 Reading

One of the most interseting concepts found in “Physical Computing’s Greatest Hits” I found was the tilty tables. While the concept of tilting and how it can alter the objects on a surface is so very intuitive to us, the tilting table adds a degree of complexity compared to something live a wave wall. The tilting allows for another, interesting way for audiences to interact with art in a non-conventional way that is still very rooted in modern day physics.

One of the most out there ideas was also the meditation helpers; devices designed to take away stimulus. This also struck me as very counter-intuitive yet fascinating. Normally, we think about taking away stimulus when it comes to being in a state to meditate, yet this machine attempts to connect the user to the compuation through the interpretation of a series of sensors in a way I think fuses technology and biopsyhcology in a fascinating way.

 

From the other article, I found the message to be very important and true. Similar to how Norman said doors that need signs are poorly designed, I think an artwork being able to stand alone with less surrounding context is in some shape or form a testament to its thoughtful design. Because the truth is, if one designs their artwork well enough, operation should be intuitive to the user.

The way the article says to indicate what the user should do with the art is so obvious, but when we ourselves are creating art, from an opposing perspective, it is definitely true that these things are just not as obvious as they would if we were not the artist.

Another important note from the article is to listen for feedback. Unlike other mediums, this one is more able to changed over time with feedback. So when for users there is a disconnect in what needs to be done and what they are trying to do, the artist should really take that into account to improve their work.

Week 8 Reading

“The hidden danger is to neglect areas not so easily addressed in science and engineering.” This outlines the principles in which Norman laid out that designers must  consider more htna functionality. The things we use should look good too. One important thing to consider is that we as humans are naturally drawn to what is beautiful.  When we consider that we must design around the human mind as Norman says, it is important that we consider aesthetics to a great extent as well as functionality. Furthermore, the aesthetics of the product should in some way fit the function of the device.

In terms of what she did for software: I think that this story shows us that code has to work more than just once. In a system such as a spacecraft, it becomes important to realize that these systems should be designed to be consistent. Another thing she made apparent was the importance of contingencies. Because of how when her daughter broke an important device, she learned to plan around it, it made it apparent that we must plan around unpredictable events and make sure that softwares will work even then,

Week 8 Project

IMG_6391

 

This week I decided to create a switch that worked on the basis of water conducting electricity.

With that, I decided to create a switch turned on by the tears of unviersity students.

It was simple: cry enough into the bowl and the LED will light up.

To do this I attached copper strips inside the bowl so that when the water level inside the bowl was high enough the water would ‘connect’ the two copper tape strips into completing the circuit.

Challenges:

One of the challenges was figuring out even if at wall the current would be strong enough to pass through the water.

Another thing was a stupid ‘bug’ where I had used a photoresistor, not a normal resistor, and pondered for a long time why the circuit was not completing.

Future improvements:

One thing I’d like to improve on is to maybe have different circuits of copper tape in such as way that more LEDs light up the more tears there are in the bowl. with 3 lit LEDs representing a full bowl or something like that.

Midterm Project

For my midterm project, I decided to do a Space Invaders-inspired shooting game with space ships and aliens. The game was partly inspired by a mobile game called: Radiant. The game’s main feature was an array of weapons in which the player could freely switch between. Because each weapon type had its own advantages and disadvantages, you had to switch between all of them to successfully complete the game. I wanted to incorporate this element into my shooter game to make it more unique and be more interactive and replayable.

Game Design

The game begins on a menu screen, where the player sees the game title and has access to all the instructions they need to play the game. I found a really cool arcade-style font that really matched the theme of the game. Because the game instructions were relatively minimal there was no need to have mutliples screens of text.

Then when the game begins the player is spawned and enemies start spawning from the top of the screen at regular intervals, with the interval decreasing over time to increase the difficulty of the game. The enemies path directly towards the player, ending the game if even one of them touches the player. Because of the number of enemies already present, I did not make the enemies fire any shots.

The player had access to 6 different type of weapons, normal shots, machine gun, shot gun, laser and other settings that all had their own characteristic. The player could switch at anytime by pressing the number keys 1-6. Each type of shot deals different amounts of damage to enemies.

When the player is hit by an enemy the game cuts to a GAME OVER screen. The player can then press play again to restart the game.

Challenges

One problem I continuously faced was when the alien sprites because of the way they were coded, were often the wrong size and unable to be resized by the variables. I had to consult  p5 reference for a while to fix this.

Another problem I had faced for a long time was getting the shot type to switch to the proper type of shots. After tutorials and looking at other projects I switching with cases allowed me to control this as well as shot spread with the keyboard numbers.

Lastly, one thing I was surprised was so challenging was assigning a sound to play when the game ended (I ended up forgoing this). There was no way to easily play a sound once without looping when my game state switched.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
damage = 6
break
case 4:
color = [255, 255, 0]
width = 15
height = 10
speed = 12
damage = 1.5
break;
case 5:
color = [255, 50, 255]
width = 8
height = 24
speed = 15
damage = 3
break;
case 6:
color = [170, 50, 255]
width = 5
height = 35
speed = 25
damage = 3
break
}
damage = 6 break case 4: color = [255, 255, 0] width = 15 height = 10 speed = 12 damage = 1.5 break; case 5: color = [255, 50, 255] width = 8 height = 24 speed = 15 damage = 3 break; case 6: color = [170, 50, 255] width = 5 height = 35 speed = 25 damage = 3 break }
  damage = 6
  break
case 4:
  color = [255, 255, 0]
  width = 15
  height = 10
  speed = 12
  damage = 1.5
  break;
case 5:
  color = [255, 50, 255]
  width = 8
  height = 24
  speed = 15
  damage = 3
  break;
case 6: 
  color = [170, 50, 255]
  width = 5
  height = 35
  speed = 25
  damage = 3
  break
}

 

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function keyPressed() {
if (key === '2') {
shotType = 2
cooldown = 150
} else if (key === '1') {
shotType = 1
cooldown = 400
} else if (key === '3') {
shotType = 3
cooldown = 800
} else if (key === '4') {
shotType = 4
cooldown = 600
} else if (key === '5') {
shotType = 5
cooldown = 500
} else if (key === '6') {
shotType = 6
cooldown = 600;
}
}
function keyPressed() { if (key === '2') { shotType = 2 cooldown = 150 } else if (key === '1') { shotType = 1 cooldown = 400 } else if (key === '3') { shotType = 3 cooldown = 800 } else if (key === '4') { shotType = 4 cooldown = 600 } else if (key === '5') { shotType = 5 cooldown = 500 } else if (key === '6') { shotType = 6 cooldown = 600; } }
function keyPressed() {
  if (key === '2') {
    shotType = 2
    cooldown = 150
  } else if (key === '1') {
    shotType = 1
    cooldown = 400
  } else if (key === '3') {
    shotType = 3
    cooldown = 800
  } else if (key === '4') {
    shotType = 4
    cooldown = 600
  } else if (key === '5') {
    shotType = 5
    cooldown = 500
  } else if (key === '6') {
    shotType = 6
    cooldown = 600;
  }
}

 

Future Improvements

There are so many ways to potentially improve this game. One way is to definitely have more enemy types that would resist or be weak towards different types of projectiles. This would further incentivise the player to switch weapons, allowing the game to be more engaging.

Another potential improvement is improving the movement patterns of the aliens to be more challenging. If they moved unpredictably towards the player that allowed them to “dodge” shots, the game would have a whole other level of challenge.

Lastly, A scorekeeping method or score in the top left corner would be very useful and would make the game feel like its progressing- this is probably the first change I would want to implement.

Week 5 Project

For my project I decided upon doing a top-down shooting game where the player would fight zombies (sprites are a work in progress). The main concept is that the player would be able to use a variety of weapons to attack an endless wave of zombies. This week, I worked on the array to have zombies endlessly spawn and the player’s movement.

The biggest challenge was getting the enemies to follow the player not with lerp, but to slowly puruse the player. This was the code that I had to use to get the ‘enemies’ to follow the player in a linear steps-per-frame model.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
for (let ball of balls) {
//direction ball is "facing"
let direction = createVector(playerX - ball.x, playerY - ball.y);
//playerSpeed control
direction.setMag(ballSpeed);
ball.add(direction);
for (let ball of balls) { //direction ball is "facing" let direction = createVector(playerX - ball.x, playerY - ball.y); //playerSpeed control direction.setMag(ballSpeed); ball.add(direction);
for (let ball of balls) {
   //direction ball is "facing"
   let direction = createVector(playerX - ball.x, playerY - ball.y);
   //playerSpeed control
   direction.setMag(ballSpeed); 
   ball.add(direction);

 

Week 5 Reading

What are some of the ways that computer vision differs from human vision?

The biggest distinction is that while when we see a photo, it is intuitive for us to distinguish a person from the background, it is comparatively harder for computers to make the distinction. This means, early computers had to use movement to distinguish which pixels on a display belonged to the object or person of interest and which were only part of a background. Furthermore, to detect movement computers had to calculate the change in color or brightness of pixels between frames whereas these things are quite simple for human vision.

What are some techniques we can use to help the computer see / track what we’re interested in?

frame differencing – comparing frames to determine movement.

background subtraction – has an original background scene, compares with captured scene to determine what is not part of the background and is the object of interest.

brightness thresholding – looking for changes in luminosity to determine the position/change in position of objects.

How do you think computer vision’s capacity for tracking and surveillance affects its use in interactive art?

It allows for the extra dimension of interaction. Many artworks, including the one with the poem’s falling letters. This means that you can take more than just key or button input sand by using computer vision to track human movements, you make the artwork more intuitive to operate (consider that people may not know you need to press a button but if you see your own image on the projector you already know how to control that shadow).

Week 4 Project

For this week’s project I decided to make something somewhat ironic in an attempt to create something funny (I think it is).

I made a quote generator that generates a quote and refreshes it for the user’s motivational needs. Needless to say, I was the one that inspired my own design, as I found myself at certain points in the day, struggling to gather the motivation to do anything remotely productive.

One part of this project that was challenging to me was finding out how to load my .csv file into the project, then gathering the correct string to be displayed back into the print().

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function keyPressed() {
if (keyCode === 13 ) {
let currentQuote = int(random(1,20))
print(currentQuote)
displayText = quotes.getString(currentQuote,0)
function keyPressed() { if (keyCode === 13 ) { let currentQuote = int(random(1,20)) print(currentQuote) displayText = quotes.getString(currentQuote,0)
function keyPressed() {
    if (keyCode === 13 ) {
      
      
    let currentQuote = int(random(1,20))
    print(currentQuote)
    displayText = quotes.getString(currentQuote,0)