Thursday, 29 September 2011

re-jig

had a little bit of a thinky wink and i'm gonna try assigning the drums to the seconds, rather than the 'tens of minutes'

just so you know what i'm talking about.

errrrrrrm oh yea so this means i need some very short (1 second) drum clips that can just repeat and alternate and whatnot.

Wednesday, 28 September 2011

email to my tutor

"hi Chris,

i've been playing around with some sound clips in flash, the basic setup is the same code as the photo-clock, but with sound clips attached to the changing images. the thing is i can only make each clip play once, or repeatedly. what i want is for the clip to play repeatedly until the value it's assigned to changes.

for instance i want a drum loop to play for 10 minutes, between 10- and 19- past the hour, then stop bang on 20-past. i'll see if i can come up with something in the meantime but if you happen to know how to make this happen then i'd appreciate the help.

see you on monday,
Beak"


... i came up with something :)

to stop a sound that is already playing, create a keyframe where you want it to stop, then on the properties panel (1.), find the sound dropdown and then select the name of the sound you want to stop (2.). next, in the 'sync' section select 'stop' (3.). done.


the only minor inconvenience this has created is that i've had to create another layer, so that i can have one sound start and another stop in the same frame.


s'all good though. onwards :)

Monday, 26 September 2011

drums

so this evening i asked my musically inclined pal Dean if he'd be interested in making some sound clips for me, so that i can assign them to various times of day. i don't have a specific idea yet but the general thing is to make a 24-hour song, which plays different parts of the music at different times. so for instance, a particular riff might play at 5 past the hour every hour, and the drum beat might change every 20 minutes.


so far we have one drum beat, which plays for 1 minute every 10 minutes (the first prototype is expected to be 24 minutes long, possibly an hour for easy loopage). I changed some of the code from the BeakClock to do this, thusly;


drums.gotoAndStop(Math.floor(minutething/10)+1);


Possible brands to align my work to: iTunes, Spotify, Youtube, soundcloud, last.fm, a particular band/dj, a music magazine.



exciting stuff, unnecessary screencap, happy Beak :)
TODAY WE MADE CLOCKS.



A rough explanation:


Made a timer that ticks every 1000 milliseconds (1 second).



var timer:Timer=new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, thingy);
timer.start();


function thingy(event:TimerEvent)
{



Made variables to obtain the hour, minute and second from the system clock.


var time = new Date();
var hourthing = time.getHours();
var minutething = time.getMinutes();
var secondthing = time.getSeconds();


So by this point, flash knows the hour, minute and second, and checks these values every second. Next up I made an analogue clock, by making a (rather beautiful) clock face and three hands, placing the hands on the face and naming their instances myhourhand, myminutehand and my secondhand, which rotate at different speeds to .. well, tell the time:

myhourhand.rotation = 30 * hourthing + minutething / 2;
myminutehand.rotation = 6 * minutething;
mysecondhand.rotation = 6 * secondthing;




Next was digital, which was just a case of creating text fields and applying the digital values to them. If the value was less than 10, I asked it to add "0" to the front, to keep the value 2 digits...

if (hourthing <10){
texthour.text = "0" + hourthing +":";
}
else{texthour.text = hourthing + ":"; 
}

that does hours, made similar for minutes and seconds...





there was also a bar clock (think a graph for the time) based on the window being 400 pixels high:


hourbar.height = (400 / 24) * hourthing;
minutebar.height = 400 / 60 * minutething;
secondbar.height = 400 / 60 * secondthing;





and finally a digital clock with a photo representing each number from 0 - 9, à la http://www.exquisiteclock.org/clock/index.php?live=1&tag=random. Some poor guy got roped into posing for the photographs, and the result was rough, but it worked. There was a tricky bit of actionscript needed to find the value of the digit for the 'tens' and 'ones' columns of the time values (EG; the "2" and "6" from the value "26"), which is here:


second1.gotoAndStop(Math.floor(secondthing/10)+1);
second2.gotoAndStop(secondthing - (Math.floor((secondthing/10))*10)+1);



So there it is, some clocks what I made. This is only a very basic visual representation of some of the things that can be done with the functions associated with time. Hopefully will have some mint stuff up over the next few weeks. Peace. :)