DMS8013: Sessions Overview

Below is a list of session titles and the dates they’ll happen. Excited?

1 – Physical Computing, 2nd February

2 – Communication 1 local devices, 9th February

3 – Communication 2 networks, 23rd February

4 – Algorithms and Generatively, 1st March

5 – Working in 3D, 12th April

6 – Hacks and collaborating, 19th April

7 - Terrible interactivity, 3rd May

8 – Data wrangling, 10th May

Current Students

Students currently studying Master in Creative Arts Practice

 

Meena Daneshyar

Maria Clemente – Albacete

Sean Cotterill

Xiyuan Tan

Yue Wang

Riar Rizaldi

Daniel Parry

 

Previous Students

CAP

2014-2015

MeteorEdmund Nesveda

Clive WrightChilly Rain

Wenya ChenTrong Cuong Dao

Yousif AbdulghaniTan

BartiZhang Wei

 

2013-2014

Yinzhen BaoTatiana Fujimori
Jaejun HwangSaksit Knunkitti
Wenchang LinClare Robertson
Tunc Karkutoglu

Mres Digital Media
Adrian ParkBen HoldenIsobel Taylor
James DavollNina LimardoXue Yan
Aaron SmilesAlessandro AltavillaAndrew Nixon
Andrzwej WojtasBen FreethBen Thompson
Helen CollardJane DudmanJoseph Pochciol
Pengfei ZhangSanjay Mortimer
Ewelina Aleksandrowicz (Tikul)

 

DMS8013: Linking PD to Processing

I am currently looking at the relationship between audio and visuals. I found examples for Ardunio and Processing which measures amplitude from a sound module via serial. This used the Arduino example AnalogReadSerial and the Processing example SimpleRead which comes as part of the serial library.

After having a meeting with Tom he suggested that I use PD for the audio processing as it is better suited to it than Arduino.

I started off trying to use a serial port in PD but soon discovered that OSC is more suitable for connecting PD to Processing.

OSC (Open Sound Control) is a way to send data using a chosen network. For this project I was communicating through programs on my own computer so the two programs shared the same IP address (127.0.0.1 or localhost).

There is a OSC library for Processing and PD also has support for OSC. In order to make OSC work in PD I needed to insert an object “import mrpeach” which enables network communications.

Here is a screen shot of my PD patch.

Now that Processing was receiving the amplitude data from PD, I told it to do something with it. I took a sketch which we have made in class (modelling the solar system) and changed the position of one of the planets according to the amplitude recorded in PD.

The code for this is below.

import oscP5.*; //import OSC library
import netP5.*; //import Network communication library

OscP5 oscP5; //create a new OSC object (called oscP5)
NetAddress myRemoteLocation; //create a new Network object (called myRemoteLocation)

float xPos = 100; //declare float xpos (the position of the planet which is going to be varied)

float rot =0;

void setup () {
size(1200,600, P3D);

oscP5 = new OscP5(this,12000); //start listening for OSC messages on the port 12000
myRemoteLocation = new NetAddress("127.0.0.1",12000); //communicate within this computer on port 12000
oscP5.plug(this,"updatePosition","/first"); //connect OSC to function "updatePosition" and run this everytime a new message is received
//look for messages formatted as "/first"
}

void draw() {
background(0);
pointLight(255,255,255, mouseX, mouseY,0);
ambientLight(102,102,102);

fill(255,0,0);
stroke(0);
translate (width/2, height/2,0); //put sphere in the middle of the screen

pushMatrix();
//rotate planet 1
rotateY(rot);
sphere(80);

noStroke();
translate(200,0,0);
sphere(10);
popMatrix();

rotateY(rot*2);
translate(xPos,0,0); //use variable xpos for position of planet along the X axis
sphere(5);
rot += 0.02;

}

void updatePosition (float x){ //updatePosition function using the received OSC data as an input x
if(x-35){ //ignore background noise
xPos = (-8*x)+80; //scale data up and offset it by 80 to avoid the planet being in the same space as the sun
} else {
xPos = 280; //if the signal is too quiet set it to the maximum value of 280
}
}
}

HSS8121: Documenting my work (HSS8120 project)

This is a video documenting my project for HSS8120 entitled “Death 2.01″. In this project I explored the relationship between emotion and data using sonification through Processing.

The main aim of this documentation is to show the concept of the project and the finished work itself. Unfortunately I did not record the piece in its desired location; this is something I aim to have done for future documentation.

DMS8013 Digital Media: on the way to the assesment

resized_success-kid-meme-generator-processing-arduino-success-i-win-at-life-1d99ef

After talking to professor Tom, I decided that I am going submit a series of work that have something to do with my final project. As my final project will imply communication with network: from one computer to another, from a smartphone to a laptop… from one device to another device in general. I have not figured them out yet.  Anyway, the final project is about communicating two independent objects that are in the distance. Hence, for this assignment, I should submit 3 possible interactions in the distance.

These series of work could be many different combinations to be honest: communication within local network, communication between Processing and Arduino, communication between two Arduinos…

I have not decided yet which are “those” combinations. I prefer to go step by step, exercise by exercise, otherwise I’ll get overwhelmed with many things that I don’t control very well. Therefore, I have started a piece of work  about a communication between 2 sketches of Processing through OSC (send/receive). My next step will be to try that communication between two computers. Then, play with the kind of messages they could be etc.

Once I have this, I will pass to the next piece of work.

I just hope I  have this feeling once I submit the assignment hahahaha

DMS8013: searching for the series of work to submit

Screen Shot 2016-04-25 at 22.45.35

Click here to view the embedded video.

I have done this in processing, which could be the starting point for one the exercise that I have to submit. My goal is to create more “bouncing balls” that may crash into each other and behave in a determined way when that happens, for e.g. they turn into one that is bigger. It would be kind of that exercise with particles we saw in class before the Easter break. I will also think about small details to add.

DMS8013: Playing around with the Solar System

It has been awhile since I played around the exercise we saw the other day in class, “The Solar System”, in which we learnt “ matrix translations “. I simply forgot to upload the outcome on the blog. When I started working with this exercise, I had at least two goals:

- creating a moon  orbiting the planet Earth.

- adding textures to the 3D spheres in order to make them look what they are representing.

I took me many hours to figure out how to achieve those goals. I didn’t achieve them in the way I was thinking all the time, so I ended up changing the code I was using from the beginning (the one we created in class).

solar_system_textures

Click here to view the embedded video.

See the code I used:

import shapes3d.*;
import shapes3d.animation.*;
import shapes3d.utils.*;

import processing.opengl.*;
Ellipsoid sun, earth, moon, stars;
Box orbiter;

boolean attached = true;

//this is angle, which is equal to 0
float sunRot = 0;
float ang = 0.0;
float angleDirection = 1;
PImage sunmap;
int y;
PImage starfield;

void setup (){
size(1200, 600, OPENGL);
smooth();
hint(ENABLE_DEPTH_SORT);
background(255);
starfield = loadImage(“starfield.jpg”);

// create the sun
sun = new Ellipsoid(this, 16, 16);
sun.setTexture(“sun.jpg”);
sun.setRadius(90);
sun.moveTo(new PVector(0, 0, 0));
sun.strokeWeight(1.0f);
sun.stroke(color(255, 255, 0));

sun.tag = “Sun”;
sun.drawMode(Shape3D.TEXTURE);

// create the earth

earth = new Ellipsoid(this, 15, 15);
earth.setTexture(“earth.jpg”);
earth.drawMode(Shape3D.TEXTURE);
earth.setRadius(30);
earth.moveTo(0, 0, 220);
earth.tag = “Earth”;

// create the moon

moon = new Ellipsoid (this, 20,20);
moon.setTexture(“moon.jpg”);
moon.drawMode(Shape3D.TEXTURE);
moon.setRadius(8);
moon.moveTo(0, -10, -50);
moon.tag = “Moon”;

// Create the star background
stars = new Ellipsoid(this, 10, 10);
stars.setTexture(“starfield.jpg”, 5, 5);
stars.drawMode(Shape3D.TEXTURE);
stars.setRadius(500);
stars.moveTo(0, 0, 0);

// Add the earth to the sun this makes
// its position relative to the sun’s
sun.addShape(earth);
// and the moon to the earth
earth.addShape(moon);
}
void draw () {

//without the ambient light we get very harsh shadows
ambientLight(452, 452, 452);

//SUN
//shift matrix to centre
translate(width/2.0, height/2.0);
pushStyle();

background(0);
pushMatrix();
// Change the rotations before drawing
sun.rotateBy(0, radians(0.6f), 0);
earth.rotateBy(0, radians(0.6f), 0);
stars.rotateBy(0, 0, radians(0.02f));

sun.draw();
stars.draw();
popMatrix();
popStyle();

}

 

 

DMS8013: learning Fourier transforms

1

I am interested in how I can get the computer to detect audio, starting with frequency. For this I felt I needed to gain more understanding of FFT (fast Fourier transforms) so that I could use it in a way that I want. Since I haven’t studied physics since I was 15 it was quite difficult but I think I have the hang of it now.

The Science Lesson

This graph shows a simple sine wave. If you listen to this waveform, you hear a continuous, smooth tone with no harmonics and a constant pitch and amplitude. This can be thought of as a “building block” for more complex sounds.

A Fourier analysis is a way of determining the exact building blocks needed to recreate a certain sound purely from sine waves, using the principle of superposition.

Superposition is what happens when two waves are added to one another. Below are some examples of this.

This is the result of adding a simple sine wave (like the first image in this post) to itself. The result is a very similar wave, but with twice the amplitude. This is because the amplitude of the sine wave at each point on the time axis gets added to itself, so the peak value becomes 1+1 = 2.

Likewise, adding the following graph:

which is an inverted sine wave, to a regular sine wave results in this:

This is because the two waves effectively cancel each other out.

The same method applies if one of the waves is phase shifted like this:

The amplitude of the wave at each point in time is added to that of the normal sine wave, and this creates a slightly different wave:

You can see that this does not have a peak amplitude of 2, because the two source waves are not at their peak values at the same point in time.

Using these principles, Fourier analysis will hopefully let me analyse the frequencies which make up more complex waves, which are likely to be what I will be picking up with a microphone.

Where now?

The examples I have seen on the internet show that when a Fourier analysis is done on a signal, the output is normally another graph which shows the frequencies and how “important” they are to the signal. I will now research this further, as I think it will be useful to me to be able to strip a complicated signal down to the most important frequencies, and then use these for input to my piece. My first step is to attempt to write a sketch that successfully uses FFT.

Creating an asteroid belt

2016-4-23 16-33-13

Althought it looks a bit boring but I’m writing this post in memory of the first “class” I ever created.

If you want to create a group of objects that have the same features in Processing, you’ll probably need to create a “class” to define the features of this particular object. For example, I am trying to create an asteroid belt in the solar system model we’ve built in class. An asteroid would be a random sized sphere orbiting around the sun, and an asteroid belt would be a group of these asteroids.

My first attempt to create a class ended in failure. I tried to refer to tutorials and some class Tom has written and figure out how the class works, but didn’t get the class working. Then I tried to create a function (void asteroid(){}) instead, but if you draw a function with random numbers, the function will refresh the random number every frame, causing totally ridiculous flashing asteroids. So I guess I still need to stick to writing a class. After nearly 3 hours of banging keyboard in the library, I finally managed to create my asteroid belt. I finally found that the problem was that I wrote the random() in the class, not in the setup.

 

The class:

class Asteroid{
float col;//colour of asteroid
float spin;//orbit speed
float wiggle;//a tiny Z axis offset effect
float distance;//distance from the sun
float diametre;//diametre of asteroid

Asteroid(float _col,float _spin,float _wiggle,float _distance,float _diametre){
col = _col;
spin = _spin;
wiggle = _wiggle;
distance = _distance;
diametre = _diametre;

}

void spinning(){
pushMatrix();
rotateY(angle*spin);
rotateZ(wiggle/500);
translate(distance,0,0);
fill(col,col,col);
sphere(diametre);
popMatrix();
}

}

Hack Day resources

Initial Set of resources:  session_8_hack

cia factbook

https://github.com/factbook/factbook.json

Data bus

https://fieldventures.org/databus/php/lock.json

Member’s allowances

http://www.parliament.uk/mps-lords-and-offices/members-allowances/house-of-commons/

Newcastle specific

https://www.newcastle.gov.uk/your-council-and-democracy/open-data-and-access-to-information/local-transparency

e.g. https://www.newcastle.gov.uk/your-council-and-democracy/open-data-and-access-information/open-data/data-sets/planning-applications-data

Last statements of offenders before execution in Texas (needs a scraper)

http://www.tdcj.state.tx.us/death_row/dr_executed_offenders.html

Serial comms: session_2_local_communication

HSS8123: Inspiration – The Social Ego

Small_Social_Ego_Text-300x300

I just saw this video on Facebook and I found it very funny.

Click here to view the embedded video.

At the beginning I thought it was not serious, that it was just done as a comedy sketch typical of “College Humor” or “BuzzFeedV“. I was wrong, it is serious, I guess it is still in process but you can actually buy it. I think this device can be an inspiration for my final project as it is implies interaction that is linked to Internet data. I don’t know in what way this device can inspire me, but it just coming to my mind an (stupid idea) that I could create a device which people could use to tell their partners how they feel without words (as in a long distance relationship most of the things are based in talking to your partner), through a color code or scale code… I know it is a pretty lame idea and stupid, it just came to my mind. who knows? maybe it is a starting point for a much better idea.

You can check the website, although it has doesn’t have that much information  On the contrary, you can read this article  to know more about “the social ego”

HSS8123: work in progress

I think I have mentioned it before, I am using David Chatting’s work (a speaker who came one day to Digital Media class to explain his project) as a guide to final project, since the theme (Long Distance Relationships) is quite close to his theme (families who deal with practice of remote working). In the description of his work is explained that the first thing they did was to interview the volunteers. This first step I have already done it, since I have interviewed people who are in a long distance relationship for a documentary project. Right now, I  am thinking the kind of cultural probes I could work with, that means, what kind of activities and task I could my sample of volunteer to do. The main purpose of this ethnography phase is collecting useful data for designing a device that may help these couples deal with distance.

Below you can find out some examples that are being source of inspiration for me at the moment

http://www.joannamontgomery.com/Pillow-Talk