diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-10 22:38:09 +0200 |
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-10 22:38:09 +0200 |
| commit | e711fce0ae256a18f9034d43888821c86219e15f (patch) | |
| tree | 715be9df44b25e870181617367b2a30a7f168d86 /lfo.ck | |
| parent | e6309bc6eceefa45b3fdbfcc6ed3dd3cd29a197c (diff) | |
| download | digitale-debutanten-e711fce0ae256a18f9034d43888821c86219e15f.tar.gz | |
implemented NanoEvent ports: you can request a "port" for a registered control which will emit the control's data as samples
* may be used to simplify situations where a control directly influences a frequency/amplitude/phase
* samples are generated uniformly between [-1, 1] and can be scaled using "Scale"
Diffstat (limited to 'lfo.ck')
| -rw-r--r-- | lfo.ck | 36 |
1 files changed, 16 insertions, 20 deletions
@@ -10,8 +10,21 @@ lfo[0] @=> UGen @cur_lfo; [new SawOsc, new PulseOsc] @=> UGen @osc[]; osc[0] @=> UGen @cur_osc; -Step lfo_freq => cur_lfo => Scale lfo_scale => cur_osc => Echo rev => Bus.out_left; -rev => Bus.out_right; +/* + * LFO configuration via MIDI + */ +if (me.args() > 1) + me.exit(); + +NanoEvent nanoev; + +/* first param: scene name */ +"primary" @=> nanoev.wantScene; +if (me.args() > 0) + me.arg(0) @=> nanoev.wantScene; + +nanoev.getPort("lfoFreqKnob") => Scale lfo_freq => cur_lfo => Scale lfo_scale; +lfo_scale => cur_osc => Echo rev => Bus.out_left; rev => Bus.out_right; //50::ms => echo.delay; //.3 => echo.mix; @@ -21,14 +34,12 @@ rev => Bus.out_right; 500::ms => rev.delay; 0.5 => rev.mix; -10 => lfo_freq.next; +20 => lfo_freq.out; 320 => float lfo_pitch; 80 => float lfo_depth; lfo_scale.out(lfo_pitch, lfo_pitch+lfo_depth); -//10 => lfo.harmonics; - fun void change_lfo(int new_lfo) { @@ -55,19 +66,6 @@ change_osc(int new_osc) lfo_scale => osc[new_osc] @=> cur_osc => rev; } -/* - * LFO configuration via MIDI - */ -if (me.args() > 1) - me.exit(); - -NanoEvent nanoev; - -/* first param: scene name */ -"primary" @=> nanoev.wantScene; -if (me.args() > 0) - me.arg(0) @=> nanoev.wantScene; - while (nanoev => now) { if ("lfoVolumeKnob" => nanoev.isControl) { nanoev.getFloat() => rev.gain; @@ -77,8 +75,6 @@ while (nanoev => now) { } else if ("lfoDepthSlider" => nanoev.isControl) { nanoev.getFloat(100) => lfo_depth; lfo_scale.out(lfo_pitch, lfo_pitch+lfo_depth); - } else if ("lfoFreqKnob" => nanoev.isControl) { - nanoev.getFloat(20) => lfo_freq.next; } else if ("lfoRateKnob" => nanoev.isControl) { /* sample rate for SampOsc */ nanoev.getFloat(2) => (lfo[2] $ SampOsc).rate; |
