Skip to content

Instantly share code, notes, and snippets.

@mohayonao
Last active December 26, 2015 07:59
Show Gist options
  • Save mohayonao/7119472 to your computer and use it in GitHub Desktop.
Save mohayonao/7119472 to your computer and use it in GitHub Desktop.
1up
def = Synth.def (freq)->
amp = Line.kr(1, 0, dur:1.5, doneAction:2)
mod = SinOsc.ar(freq * 2)
Out.ar(0, SinOsc.ar(freq, phase:mod, mul:0.25) * amp)
Task.loop ->
scale = Scale.major # Scale.diminished / Scale.choose()
synth = def.play()
Task.each [2,4,9,7,8,9], (degree)->
freq = scale.degreeToFreq degree, 1046.50
synth.set freq:freq
@wait 150
.play()
@wait 1000
.play()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment