Skip to content

Instantly share code, notes, and snippets.

@mohayonao
Created November 28, 2013 07:02
Show Gist options
  • Save mohayonao/7688265 to your computer and use it in GitHub Desktop.
Save mohayonao/7688265 to your computer and use it in GitHub Desktop.
task
Task ->
console.log "begin: task"
s = Synth("test").on "end", ->
s.stop()
@wait 1
console.log "begin: number do"
10.do (i)->
console.log i
@wait 1
console.log "end : number do"
@wait 1
console.log "begin: array do"
["A4", "F4"].do (midi, i)->
console.log midi, i
s.set freq:midi.midicps()
@wait 1
console.log "end : array.do"
@wait 1
console.log "begin: boolean do"
false.do ->
@wait Infinity
console.log "end : boolean do"
@wait 1
console.log "begin: string do"
"go".do (str)->
console.log str #=> "go"
@wait 1
console.log "end : string do"
@wait 1
console.log "end : task"
.play()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment