mohayonao / CoffeeCollider

Sound Processing Language for Web Audio
http://mohayonao.github.io/CoffeeCollider/
MIT License
220 stars 15 forks source link

Function "stop" / "free" / "set" ? #75

Closed hems closed 10 years ago

hems commented 10 years ago

Is there a way of stopping a function after its playing ?

mohayonao commented 10 years ago
a = (-> SinOsc.ar(440)).play() # return Synth Object

setTimeout ->
  a.stop() # Synth Object can receive `stop`
, 500
hems commented 10 years ago

nice! for some reason my tests were failing... shame on me :P

hems commented 10 years ago

Is there a way to achieve "default value" for an argument, and then later "set" it.

like we would do in SC:

a = { arg freq = 400; SinOsc.ar( freq ); }.play

a.set( \freq, 55 )

mohayonao commented 10 years ago

CoffeeCollider doesn't has a symbol. So, use an object instead of a symbol.

like this

a.set(freq: 55)
hems commented 10 years ago

:8ball: