Showing posts with label processing. Show all posts
Showing posts with label processing. Show all posts

Monday, 31 January 2022

Internet Time (Processing)

In the glorious utopian (comparatively) early internet Swatch thought a universal time system would be a good idea. Wikipedia has an article on it : Swatch Internet Time .

Here is a "@beats" clock in Processing :

import java.util.*;  
int oldbeats=0;   	
Date trialTime;
TimeZone cet;
Calendar calendar ;

void setup() {
  size(120, 120);  
  cet=TimeZone.getTimeZone("Europe/Stockholm");
  calendar = new GregorianCalendar(cet);
}

void draw(){
 
  trialTime = new Date();
  calendar.setTime(trialTime);
  
  int beats =  floor( (calendar.get(Calendar.SECOND) + 
                      (calendar.get(Calendar.MINUTE) * 60) + 
                      (calendar.get(Calendar.HOUR_OF_DAY)  * 3600))
                      / 86.4005529635 );

  if (beats > oldbeats) { 
    oldbeats = beats;
    background(255);
    textSize(40);
    fill(0, 102, 153, 204);
    text("@"+beats, 3, 60); 
  }
  delay(1000); 
}

void mousePressed (){
  exit();
}

Friday, 14 August 2009

rapid serial visual presentation

"Rapid Serial Visual Presentation (RSVP) is a method of displaying information (generally text) using a limited space in which each piece of information is displayed briefly in sequential order."... from wikipedia
Here is a simple rsvp reader written using Processing. Processing neatly hides the syntactic ugliness of Java and provides an event based loop and lots of useful functions for doing stuff. It also provides wrappers around the jar files for linux,mac and windows.

rsvp processing source
rsvp app packages linux , mac (I haven't tested this. My LC575 is not powerful enough for osx :-( ) , windows