chuck
chuck copied to clipboard
Allow => from a UGen into a field/parameter
A common use case in digital synthesis is to use an oscillator as an LFO for a parameter. The built in UGen oscillators provide some of such functionality via the sync(int)
method, allowing input to sync to frequency or to phase.
If however a user would like to use an LFO to modulate the gain of a UGen or to modulate any other parameter (e.g. BlowBotl vibratoFreq or Delay delay) they either need to spork a method at sample rate
Tremolo.ck https://github.com/heuermh/lick/blob/master/Tremolo.ck#L32 https://github.com/heuermh/lick/blob/master/Tremolo.ck#L93
extend Chugen
Trem.ck https://github.com/heuermh/lick/blob/master/Trem.ck#L23 https://github.com/heuermh/lick/blob/master/Trem.ck#L127
or use a higher level construct such as Module
Module.ck https://github.com/heuermh/lick/blob/master/Module.ck
moduleExample.ck https://github.com/heuermh/lick/blob/master/examples/moduleExample.ck
It would be much nicer from a user's point of view if they could do the following
SinOsc sin => dac;
440.0 => sin.freq;
SinOsc lfo;
1.0 => lfo.freq;
// modulate sin osc gain with LFO
lfo => sin.gain;
1::minute => now;
Migrated from https://github.com/spencersalazar/chuck/issues/35