I want to make technoflage a camouflage jacket for the techno lover. Ideal for wearing in the slam tent at t in the park.
So been finished uni for a few weeks now and have done nothing artistic or design orientated. The closest I’ve came is a little bit painting. Not on canvas tho only the ceiling walls skirting and facing in my house. At this rate I will be back doing my honors before I become creative again.
Gesture Controls Get a Huge Boost with New ‘Leap’ Interaction System http://t.co/QyROwgeK by @strngwys — Gadget Lab (@gadgetlab)
Well all uni work is now submitted and only wait waiting on one grade before I say I have a Bdes. Honors start in October so need a couple of summer projects/competitions to work on. I’ll keep you posted on progress
This is again the prototype in full working order however this time the sketch which produces layered coloured circles on screen is used. This idea with further development is the one which could be used as a piece of generative art. I think i would also need to incorporate some form of aural output to accompany this to allow the user insight into what piece of music they are playing.
This is the final prototype in full working order. This is using the processing sketch which generates different coloured circles each time a button is pressed.
So as part of the overview of this project evaluation is required.
“You will discuss any existing work and theory that has influenced your work and how your work compares with that existing work.”
This video above is a similar idea input from a guitar producing a visual output. Not exactly the same as what i have done. This has clearly achieved that part which i abandoned which was to have all buttons working independently. This makes me think i maybe should have used a guitar hero guitar.
However i do think i achieved more by creating my own visual output via processing.
From playing around with code i had a new idea. I thought that this project could lend itself as a form for creating a piece of generative art. The user could press the keys which would normaly play a song, say twinkle twinkle. This would build up a picture on screen of the elipses layering them in random colours over each other. This could then be printed.
So i tweaked the code a little to allow this to happen.
import processing.serial.*;
Serial myPort; // Create object from Serial class
int val; // Data received from the serial port
void setup()
{
size (900, 900);
smooth ();
background (0);// background set to black
noStroke ();
println(Serial.list());
String portName = Serial.list()[1];
myPort = new Serial(this, portName, 9600);
}
void draw() {
float x = random(0, 901);// added this float to make x random
float y = random(0, 901); // added this float to make y random
if ( myPort.available() > 0) { // If data is available,
val = myPort.read(); // read it and store it in val
}
if(val == 1) // if reading 1 from arduino i.e. button pressed
{
ellipse(x, y, 100, 100); // reads float x and y which are random
fill(random(255),random(255),random(255), random(100)); // places random circles on screen
}
}
void keyPressed () { // reset to black screen
background (0);
}
So i developed this code a little furtherso the background is black and every time button is pressed a different colour appears on screen.
import processing.serial.*;
Serial myPort; // Create object from Serial class
int val; // Data received from the serial port
boolean buttonPress;
int counter = 0;
void setup()
{
size(900, 900);
// I know that the first port in the serial list on my mac
// is always my FTDI adaptor, so I open Serial.list()[0].
// On Windows machines, this generally opens COM1.
// Open whatever port is the one you’re using.
println(Serial.list());
String portName = Serial.list()[1];
myPort = new Serial(this, portName, 9600);
}
void draw()
{
if ( myPort.available() > 0) { // If data is available,
val = myPort.read(); // read it and store it in val
}
println(val);
background(0); // Set background to black
if (val == 0) { // If the serial value is 0,
fill(0); // set fill to black
buttonPress = true; // update state of software switch
}
else { // If the serial value is not 0,
if(buttonPress == true){ // software switch
counter++;
buttonPress = false; // update state of software switch
}
if(counter == 1){
fill(204); // set fill to light grey
}
else if(counter == 2){
fill(255,0,0); // set fill to red
}
else if(counter == 3){
fill(0,255,0); //set fill to green
}
else if(counter == 4){
fill(0,0,255); //set fill to blue
counter = 0;
}
}
float x = random(0, 901);// added this float to make x random
float y = random(0, 901); // added this float to make y random
ellipse(x, y, 100, 100);
}
So having failed and abandoned that code for now( i will return ata later date to make it work) i started testing and developing some other code which i found on open processing.
void setup()
{
size (500, 500); // size of output window
smooth ();
background (random(255), random(255), random(255)); //background colour random
noStroke ();
}
void draw()
{
if (mousePressed && (mouseButton == RIGHT)) //if right mouse button pressed
{
background (random(255), random(255), random(255)); //change background colour
}
}
void mouseClicked()
{
if (mouseButton == LEFT) //if left mouse button pressed
{
fill (random(255), random(255), random(255), 100); //place random coloured circle
ellipse(mouseX, mouseY, 100, 100); // where ever mouse cursor is
}
}
void mouseDragged() //if left mouse pressed and dragged
{
fill (random(256), random(256), random(256), 10); // produce multiple random coloured circles
ellipse(mouseX, mouseY, 100, 100); // where ever mouse goes
}
So hardware all working its back to the code and trying to get something which is cool and represents sound in a visual format. I had previously experimented with a processing sketch which is posted further down this page where colour explodes on screen and ideally this is what i wanted.
However the code for this is just a little two complex for me. I did develop it to produce different colours on a black background at random points. Unfortunately though i could not accomplish the integration of the serial read code in order for my arduino board and ultimately the guitar to control the output. The code is below.
class IKChain
{
IKPoint[] pts;
float vx, vy, theta, speed;
float life = 0;
int maxRan = 180;
IKChain(float xP, float yP, float thet, float spd, float unit, int unitCount)
{
theta = thet;
speed = spd;
vx = cos(theta)*speed;
vy = sin(theta)*speed;
pts = new IKPoint[unitCount];
for(int i = 0; i < pts.length; i++)
{
pts[i] = new IKPoint(xP,yP,unit);
if(i>0)
{
pts[i].addNeighbour(pts[i-1]);
pts[i-1].addNeighbour(pts[i]);
}
}
}
void drawMe()
{
beginShape();
for(int i = 0; i < pts.length; i+=2)
{
/*
if(white)
stroke(255, 10);
else
stroke(0, 10);
*/
// stroke(255);
curveVertex(pts[i].x, pts[i].y);
}
endShape();
}
void advance()
{
life+= .5;
float chaos = PI/random(5,maxRan);
chaos = Math.floor(random(2)) == 0 ? chaos : - chaos;
theta += chaos;
vx = cos(theta)*speed;
vy = sin(theta)*speed;
pts[pts.length-1].move(vx,vy);
}
}
class IKPoint
{
float x, y;
float d;
ArrayList neighbours;
IKPoint(float xP, float yP,float dst)
{
d = dst;
neighbours = new ArrayList();
this.x = xP;
this.y = yP;
}
void addNeighbour(IKPoint pt)
{
this.neighbours.add(pt);
}
void move(IKPoint parent)
{
makeMove(this, parent);
for(int i = 0; i<neighbours.size();i++)
{
IKPoint pt = (IKPoint)neighbours.get(i);
if(parent!=pt)
pt.move(this);
}
}
void move(float xP, float yP)
{
this.x += xP;
this.y += yP;
for(int i = 0; i<neighbours.size();i++)
{
IKPoint pt = (IKPoint)neighbours.get(i);
pt.move(this);
}
}
void makeMove(IKPoint child, IKPoint parent)
{
float dx = child.x-parent.x;
float dy = child.y-parent.y;
float theta = atan2(dy,dx);
child.x = parent.x+cos(theta)*d;
child.y = parent.y+sin(theta)*d;
}
}
IKChain[] ch;
int white = 0; // change from boolean white = false to int white = 0
float thet = 0;
int chainCount = 400;
int startRad = -5;
float spd = 10;
int len = 35;
int cnt = 40;
void setup()
{
size(900,900);
background(0);// changed background colour to black
fill(0);
ch = new IKChain[1000];
//smooth();
stroke(0,5);
noFill();
}
void draw()
{
// background(0);
pushMatrix();
translate(width/2,height/2);
rotate(thet);
translate(-width/2,-height/2);
for(int i = 1; i < ch.length; i++)
{
if(ch[i] != null)
{
ch[i].advance();
ch[i].drawMe();
}
}
//thet+= PI/1500;
popMatrix();
}
void mousePressed()
{
if(mouseButton == RIGHT)
{
noLoop();
// save((int)random(1000)+”.tiff”);
}
ch = new IKChain[chainCount];
if(white == 0) { // this loop was added to give the effect that every mouse click different colour
stroke(0,255,0,25);
}
else if(white == 1){
stroke(255,0,0,25);
}
else if(white == 2){
stroke(0,0,255,5);
}
else if(white == 3){
stroke(255,25);
}
else if(white == 4){
stroke(250,255,0,15);
}
else if(white == 5){
stroke(250,0,255,15);
}
else if(white == 6){
stroke(0,255,0,25);
white = 0;
}
white = white+1;
float x = random(0, 901);// added this float to make x random
float y = random(0, 901); // added this float to make y random
for(int i = 1; i < ch.length; i++)
{
float theta = TWO_PI/(ch.length+0.0) * i;
float xP = x + cos(theta)*startRad; // changed mouseX to x
float yP = y + sin(theta)*startRad;// changed mouseY to y
ch[i] = new IKChain(xP,yP,theta, spd, len, cnt);
}
}
So i thought all was well and i could conquer anything. Then the thing kept playing up so had to take apart again and investigate. It turns out my old friend double sided sticky tape was to sticky. The slightest little bit not covered with foil was sticking. So when buttons were being pressed the were sticking and keeping the circuit connected and acting like button in a constant HIGH state.
Fix was to try and cover with more foil. This worked on most buttons but had to disconnect one.
This video shows a wee bit more testing of circuit.
Firstly in the guitar housing to ensure the exterior buttons work.
Next whilst connected to processing making sure the code works.
Then everything housed away plugged in and working as intended. RESULT!!!!
The only thing now is to adapt the processing code to get something more fitting to my interpretation of visualised sound.