/* Notes on Soundscape Clock w/ Visual Elements: (Seconds are represented by Ripples in the Water Cup) (Minutes are represented by Water Droplets) & Droplet Sound Hours are represented by Overflowing Cup & Overflowing Sound (Days are represented by Changes to the Water Tint Color) & Daily Sound Fortnights are represented by a Seasonal Insect Animation Months are represented by Overflowing Table & Overflow + Dripping Sounds Seasons are represented by Seasonal Water-Themed Sounds Years are represented by Changes to the Bowl Tint Color & the Yearly Sound */ //Define Global Variables PImage bg, bowl, water, ripple, droplet, flat, sun, moon; int MS, S, Mi, H, D, W, Mo, Y, dropSpawn; boolean dropAlive; void setup(){ size(225, 300); //Load Images bg = loadImage("bg.png"); bowl = loadImage("bowl_nb.png"); water = loadImage("Water_Level.png"); ripple = loadImage("ripple22.png"); droplet = loadImage("Droplet2.png"); flat = loadImage("Droplet_flat.png"); sun = loadImage("Day.png"); moon = loadImage("Night.png"); } void TimeStamp(){ //check system time & sets variables MS = millis(); S = second(); Mi = minute(); H = hour(); } void drawSeconds(){ int num = (S/10) + 1; int x = 165; int y = 20; int a = 250; float w = ripple.width; float h = ripple.height; for (int i = num; i != 0; i--){ tint(2, 41, 85, a); image(ripple, x, y, w, h); x = x - 20; y = y + 3; w = 11 + w; h = 11 + h; a = a - 40; } } void drawMinutes(){ noTint(); if (S == 59 && !dropAlive){ dropAlive = true; dropSpawn = MS; } if (!dropAlive){return;} int timeAlive = MS - dropSpawn; int lifespan = 1000; float percentAlive = ((float)timeAlive/lifespan); int sHeight = -30; int eHeight = 45; int dropY = (int)((sHeight * (1-percentAlive)) + (eHeight * percentAlive)); if (percentAlive >= 1){ dropAlive = false; } else if (percentAlive >= .8){ image(flat, 209, dropY); } else{ image(droplet, 210, dropY); } } void drawDays(){ float theta, x, y; theta = (H + (Mi/60)); int centerX, centerY, rX, rY; centerX = 200; centerY = 60; rX = 170; rY = 40; theta = ((PI/2) + (theta * (PI/24))); x = centerX + (rX * cos(theta)); y = centerY - (rY * sin(theta)); if ((H >= 18) || (H <= 5)){ image(moon, x, y); } else if ((H >= 6) || (H <= 17)){ image(sun, x, y); } } void draw() { TimeStamp(); noTint(); image(bg, 0, 0); image(bowl, 0, 0); image(water, 0, 0); drawDays(); drawSeconds(); drawMinutes(); }