DJ TO GO
2023, Master of Arts in Interaction Design, SUPSI, Mendrisio
The idea for the project was to create a portable device that could be used in home dj set, or for friends party, to have also a small but efficient visual effect response.
The visual is changed by beat of the music played, by keyboard, and by the touchpad.
2023, Master of Arts in Interaction Design, SUPSI, Mendrisio
The idea for the project was to create a portable device that could be used in home dj set, or for friends party, to have also a small but efficient visual effect response.
The visual is changed by beat of the music played, by keyboard, and by the touchpad.
2023, Master of Arts in Interaction Design, SUPSI, Mendrisio
The idea for the project was to create a portable device that could be used in home dj set, or for friends party, to have also a small but efficient visual effect response.
The visual is changed by beat of the music played, by keyboard, and by the touchpad.
import processing.serial.*;
final int MATRIX_WIDTH = 32;
final int MATRIX_HEIGHT = 32;
final int NUM_CHANNELS = 3;
Serial serial;
byte[]buffer;
PGraphics led;
Anim anim;
float sw, alpha;
float yStep = 0.1;
import processing.sound.*;
AudioIn input;
Amplitude analyzer;
SoundFile file;
// FREQUENCY
FFT fft;
int bands = 32;
float smoothingFactor = 0.2;
String backg;
void setup() {
size(32, 32);
led = createGraphics(MATRIX_WIDTH, MATRIX_HEIGHT);
input = new AudioIn(this, 0);
//this loads the file based on the file name
file = new SoundFile(this,"music.aiff");
file.play();
// FREQUENCY
// create a new Amplitude analyzer
analyzer = new Amplitude(this);
// Patch the input to an volume analyzer
analyzer.input(input);
fft = new FFT(this, bands);
fft.input(input);
//this changes the volume level (number between 0 and 1)
file.amp(1);
led.beginDraw();
led.background(0);
led.endDraw();
led.smooth();
printArray(Serial.list());
try {
serial = new Serial(this, "/dev/cu.usbmodem128295001");
}
catch(Exception e) {
println("Couldn't open the serial port...");
println(e);
}
buffer = new byte[MATRIX_WIDTH * MATRIX_HEIGHT * NUM_CHANNELS];
anim = new Arc();
}
void draw() {
led.beginDraw();
anim.loop();
led.endDraw();
if (serial != null) {
loadPixels();
int idx = 0;
for (int i=0; i<pixels.length; i++) {
color c = pixels[i];
buffer[idx++] = (byte)(c >> 16 & 0xFF); // r
buffer[idx++] = (byte)(c >> 8 & 0xFF); // g
buffer[idx++] = (byte)(c & 0xFF); // b
}
serial.write('*'); // The 'data' command
serial.write(buffer); // ...and the pixel values
}
}
void keyPressed() {
if (key == 'q') anim = new Arc();
else if (key == 'w') anim = new Circle();
else if (key == 'e') anim = new Rect();
else if (key == 'r') anim = new Triangle();
}
_CLASS ARC_
class Arc extends Anim {
float arcSize = 5;
float circle;
void loop() {
// MICROPHONE
float vol = analyzer.analyze();
fft.analyze();
if (keyPressed) {
if (key == '1'){
backg = "red";
}
else if (key == '2'){
backg = "green";
}
else if (key == '3'){
backg = "blue";
}
else if (key == '4'){
backg = "yellow";
}
else if (key == '5'){
backg = "magenta";
}
else if (key == '0'){
backg = "white";
}
}
if (backg == "red"){
background (255, 0, 0);
circle = PI;
}
else if (backg == "green"){
background (0, 255, 0);
circle = PI * 2;
}
else if (backg == "blue"){
background (0, 0, 255);
circle = PI * 0.2;
}
else if (backg == "yellow"){
background (255, 255, 0);
circle = PI*1.5;
}
else if (backg == "magenta"){
background (255, 0, 255);
circle = PI * 0.5;
}
else if (backg == "white"){
background (255);
circle = PI / 2;
}
else{
background (255);
circle = PI / 2;
}
noFill();
stroke(0.1);
mouseX = constrain(mouseX, 10, width);
mouseY = constrain(mouseY, 10, width);
yStep = mouseY;
arcSize = mouseX;
for (float y=-arcSize/4; y<height+arcSize/4; y+=yStep) {
sw = map(sin(radians(y+alpha*vol)), -1, 1, 2, yStep);
strokeWeight(sw/1.5);
for (float x1=arcSize/2; x1<width+arcSize/2; x1+=arcSize) {
arc(x1, y, arcSize/2, arcSize/2, 0, circle);
}
sw = map(sin(radians(y-alpha*2)), -1, 1, 2, yStep);
strokeWeight(sw/1.5);
for (float x2=0; x2<width+arcSize; x2+=arcSize) {
arc(x2, y, arcSize/2, arcSize/2, PI, TWO_PI);
}
}
alpha++;
}
}
_CLASS CIRCLE_
class Circle extends Anim{
float circle;
float ellipseSize = 5;
void loop(){
// MICROPHONE
float vol = analyzer.analyze();
fft.analyze();
noFill();
stroke(0.1);
if (keyPressed) {
if (key == '1'){
backg = "red";
}
else if (key == '2'){
backg = "green";
}
else if (key == '3'){
backg = "blue";
}
else if (key == '4'){
backg = "yellow";
}
else if (key == '5'){
backg = "magenta";
}
else if (key == '0'){
backg = "white";
}
}
if (backg == "red"){
background (255, 0, 0);
}
else if (backg == "green"){
background (0, 255, 0);
}
else if (backg == "blue"){
background (0, 0, 255);
}
else if (backg == "yellow"){
background (255, 255, 0);
}
else if (backg == "magenta"){
background (255, 0, 255);
}
else if (backg == "white"){
background (255);
}
else{
background (255);
}
mouseX = constrain(mouseX, 5, width*2);
mouseY = constrain(mouseY, 5, width*2);
yStep = mouseY;
ellipseSize = mouseX;
for (float y=-ellipseSize/3; y<height+ellipseSize/2; y+=yStep) {
sw = map(sin(radians(y+alpha*(vol*4))), -1, 1, 2, yStep);
strokeWeight(sw/3);
for (float x1=ellipseSize/2; x1<width+ellipseSize; x1+=ellipseSize) {
ellipse(x1, y, ellipseSize/2, ellipseSize/2);
}
sw = map(sin(radians(y-alpha*(vol/3))), -1, 1, 2, yStep);
strokeWeight(sw/3);
for (float x2=0; x2<width+ellipseSize; x2+=ellipseSize) {
ellipse(x2, y, ellipseSize*6, ellipseSize*6);
}
}
alpha++;
}
}
_CLASS RECT_
class Rect extends Anim{
float rectSize = 5;
//int bands = 64;
void loop(){
// MICROPHONE
float vol = analyzer.analyze();
fft.analyze();
noFill();
stroke(0.1);
if (keyPressed) {
if (key == '1'){
backg = "red";
}
else if (key == '2'){
backg = "green";
}
else if (key == '3'){
backg = "blue";
}
else if (key == '4'){
backg = "yellow";
}
else if (key == '5'){
backg = "magenta";
}
else if (key == '0'){
backg = "white";
}
}
if (backg == "red"){
background (255, 0, 0);
}
else if (backg == "green"){
background (0, 255, 0);
}
else if (backg == "blue"){
background (0, 0, 255);
}
else if (backg == "yellow"){
background (255, 255, 0);
}
else if (backg == "magenta"){
background (255, 0, 255);
}
else if (backg == "white"){
background (255);
}
else{
background (255);
}
mouseX = constrain(mouseX, 5, width*2);
mouseY = constrain(mouseY, 5, width*2);
yStep = mouseY;
rectSize = mouseX;
for (float y=-rectSize/2; y<height+rectSize/2; y+=yStep) {
sw = map(sin(radians(y+alpha)), -1, 1, 2, yStep);
strokeWeight(sw/3);
for (float x1=rectSize/2; x1<width+rectSize; x1+=rectSize) {
rect(x1, y, rectSize/2, rectSize/2);
}
sw = map(sin(radians(y-alpha*(vol*2))), -1, 1, 2, yStep);
strokeWeight(sw/3);
for (float x2=0; x2<width+rectSize; x2+=rectSize) {
rect(x2, y, rectSize*3, rectSize*3);
}
}
alpha++;
}
}
_CLASS TRIANGLE_
class Triangle extends Anim{
float triangle;
float triangleSize = 4;
//int bands = 64;
void loop(){
// MICROPHONE
float vol = analyzer.analyze();
fft.analyze();
noFill();
stroke(0.5);
if (keyPressed) {
if (key == '1'){
backg = "red";
}
else if (key == '2'){
backg = "green";
}
else if (key == '3'){
backg = "blue";
}
else if (key == '4'){
backg = "yellow";
}
else if (key == '5'){
backg = "magenta";
}
else if (key == '0'){
backg = "white";
}
}
if (backg == "red"){
background (255, 0, 0);
triangle = PI;
}
else if (backg == "green"){
background (0, 255, 0);
triangle = PI * 2;
}
else if (backg == "blue"){
background (0, 0, 255);
triangle = PI * 1.5;
}
else if (backg == "yellow"){
background (255, 255, 0);
triangle = PI;
}
else if (backg == "magenta"){
background (255, 0, 255);
triangle = PI * 0.5;
}
else if (backg == "white"){
background (255);
triangle = PI / 2;
}
else{
background (255);
triangle = PI / 2;
}
mouseX = constrain(mouseX, 10, width*2);
mouseY = constrain(mouseY, 10, width*2);
yStep = mouseY;
triangleSize = mouseX;
translate(-2,-2);
rotate(0.5);
for (float y=-triangleSize*2; y<height+triangleSize/2; y+=yStep) {
sw = map(sin(radians(y+alpha*2)), -1, 1, 2, yStep);
strokeWeight(sw/3);
for (float x1=triangleSize/2; x1<width+triangleSize; x1+=triangleSize) {
triangle(5, 5, triangleSize*8, 5, 0, triangle );
}
sw = map(sin(radians(y-alpha*(vol*2))), -1, 1, 2, yStep);
strokeWeight(sw/3);
for (float x2=10; x2<width+triangleSize; x2+=triangleSize) {
triangle(x2, y, triangleSize*2, triangleSize*3, triangle, triangle*2);
}
}
alpha++;
}
}
SAN BENEDETTO
Collaborazione NABA-San Benedetto.
The theme of this project was focused on celebrating the origins of tea through a design inspired by the unique patterns and colours found in the beautiful, exotic, locations around the world.
Collaborazione NABA-San Benedetto.
The theme of this project was focused on celebrating the origins of tea through a design inspired by the unique patterns and colours found in the beautiful, exotic, locations around the world.
Collaborazione NABA-San Benedetto.
The theme of this project was focused on celebrating the origins of tea through a design inspired by the unique patterns and colours found in the beautiful, exotic, locations around the world.