Ackso-Clock

For this project, I wanted to make a clock requires some time to decode and understand, but still communicates the time accurately. I decided to represent time with time itself, using sounds that loop in a sort of beat. The rectangles represent digits on a digital clock, and by counting how many times each one makes a noise/changed color, one can read the time. The background changes with the sound of a cymbal every loop as a reference for counting. However, the visuals are only meant to introduce the idea so that one could hypothetically memorize the 4 sounds and be able to hear what time it is. I would like to expand this project to be compatible with more complex musical loops so that it could be used as a melodic replacement for a clock in public spaces.

(I had to make videos instead of gifs to include audio)

Transition from 12:07 to 12:08

example2

Transition from 4:02 to 4:03

example

import ddf.minim.spi.*;
import ddf.minim.signals.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.ugens.*;
import ddf.minim.effects.*;


int loop = 3000;
int prevMillis1=0;
int prevMillis2=0;
int prevMillis3=0;
int prevMillis4=0;
int prevMillis5=0;
int back = 255;
int opposite = 0;
color hourTens=color(62, 33, 132);
color hourOnes=color(122, 0, 16);
color minuteTens=color(0, 23, 127);
color minuteOnes=color(0, 96, 11);

Minim minim;
AudioPlayer player1;
AudioPlayer player2;
AudioPlayer player3;
AudioPlayer player4;
AudioPlayer player5;


void setup(){
  size(500,200);
  minim = new Minim(this);
  player1 = minim.loadFile("crash.wav");
  player2 = minim.loadFile("clap.wav");
  player3 = minim.loadFile("snare.wav");
  player4 = minim.loadFile("kick.wav");
  player5 = minim.loadFile("tick.aiff");
  
  
}

void draw(){

  int now1= millis()%loop;
  if (now1<prevMillis1){
    player1.play();
    player1.rewind();
    if (back==255){
      back = 0;
      opposite = 255;
    } else {
      back = 255;
      opposite = 0;
    }
  }
  background(opposite);
  
  
  prevMillis1=now1;
  
  int now4 = 0;
  if (minute()/10!=0){
    now4 = millis()%(loop/(minute()/10));
    if (now4<prevMillis4){
      player4.play();
      player4.rewind();
    if (minuteTens==color(0, 23, 127)){
      minuteTens=color(255, 123, 0);
    } else {
      minuteTens=color(0, 23, 127);
    }
    }
  }
  prevMillis4=now4;
  
  int now5= 0;
  if (minute()%10!=0){
    now5 = millis()%(loop/(minute()%10));
    if (now5<prevMillis5){
      player5.play();
      player5.rewind();
      if (minuteOnes==color(0, 96, 11)){
        minuteOnes=color(122, 0, 55);
      } else {
        minuteOnes=color(0,96,11);
      }
    }
  }
  prevMillis5=now5;
  
  int hour = hour()%12;
  if (hour == 0) {
    hour = 12;
  }
  
 int now2=0;
  if (hour/10!=0){
    now2 = millis()%(loop/(hour/10));
    if (now2<prevMillis2){
      player2.play();
      player2.rewind();
      if (hourTens==color(62, 33, 132)){
        hourTens=color(255, 242, 0);
      } else {
        hourTens=color(62, 33, 132);
      }
      }
    } 
  
  prevMillis2=now2;
  
  int now3=0;
  if (hour%10!=0){
    now3 = millis()%(loop/(hour%10));
    if (now3<prevMillis3){
      player3.play();
      player3.rewind();
      if (hourOnes==color(122, 0, 16)){
        hourOnes=color(252, 32, 223);
      } else {
        hourOnes=color(122, 0, 16);
      }
      
    } 
  } 
  prevMillis3=now3;
  
  
  fill (hourTens);
  rect(170,70,35,80);
  fill (hourOnes);
  rect(215,70,35,80);
  fill (minuteTens);
  rect(260,70,35,80);
  fill (minuteOnes);
  rect(305,70,35,80);
  
  
}