Last active
January 1, 2016 09:09
-
-
Save tn800/8123464 to your computer and use it in GitHub Desktop.
test code for CoffeeCollider, time signal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
synth = SynthDef (freq, dur=0.25)-> | |
Out.ar(0, SinOsc.ar(freq) * Line.kr(1, 0, dur, doneAction:2)) | |
.add() | |
Task -> | |
Infinity.do syncblock (i)-> | |
#console.log i | |
d = new Date() | |
sec = d.getSeconds() | |
console.log sec | |
switch sec | |
when 0 then Synth(synth, freq:880, dur:3) | |
when 57 then Synth(synth, freq:"A4".midicps()) #same as 440 too long? | |
when 58 then Synth(synth, freq:440) | |
when 59 then Synth(synth, freq:440) | |
else console.log sec | |
1.wait() | |
.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment