diff options
author | gretchen <gretchen@gnar.cool> | 2019-11-19 01:54:03 -0800 |
---|---|---|
committer | gretchen <gretchen@gnar.cool> | 2019-11-19 01:54:03 -0800 |
commit | 8795f0a601e790b3bd859426367c46b55ff845dc (patch) | |
tree | 7b062cb75d0708e6fc01175659f2d1a1d8890e2d /lib | |
parent | 389d32638b24186bbf6c0b76642edbd7cd2467b9 (diff) | |
download | rhodes-8795f0a601e790b3bd859426367c46b55ff845dc.tar.gz rhodes-8795f0a601e790b3bd859426367c46b55ff845dc.zip |
Expose parametersv0.3
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Engine_Rhodes.sc | 61 |
1 files changed, 58 insertions, 3 deletions
diff --git a/lib/Engine_Rhodes.sc b/lib/Engine_Rhodes.sc index ad55cd3..a644c96 100644 --- a/lib/Engine_Rhodes.sc +++ b/lib/Engine_Rhodes.sc @@ -4,6 +4,10 @@ Engine_Rhodes : CroneEngine { var <notes; + var <lfoSpeed; + var <lfoDepth; + var <modIndex; + var <mix; *new { arg context, doneCallback; ^super.new(context, doneCallback); @@ -22,7 +26,6 @@ Engine_Rhodes : CroneEngine { | var env1, env2, env3, env4; var osc1, osc2, osc3, osc4, snd; - lfoSpeed = lfoSpeed * 12; freq = freq * 2; env1 = EnvGen.ar(Env.adsr(0.001, 1.25, 0.0, 0.04, curve: \lin)); @@ -37,7 +40,7 @@ Engine_Rhodes : CroneEngine { snd = Mix((osc3 * (1 - mix)) + (osc1 * mix)); snd = snd * (SinOsc.ar(lfoSpeed) * lfoDepth + 1); - snd = snd * EnvGen.ar(Env.asr(0, 1, 0.2)); + snd = snd * EnvGen.ar(Env.asr(0, 1, 0.25), gate); snd = Pan2.ar(snd, pan, amp); DetectSilence.ar(snd, doneAction: Done.freeSelf); Out.ar(out, snd); @@ -45,6 +48,10 @@ Engine_Rhodes : CroneEngine { }); } alloc { + lfoSpeed = 2.0; + lfoDepth = 0.1; + modIndex = 0.1; + mix = 0.2; notes = nil!128; this.addCommand("note_on", "ii", { arg msg; @@ -55,7 +62,11 @@ Engine_Rhodes : CroneEngine { [ \out, context.out_b, \freq, note.midicps, - \vel, vel/127.0 + \vel, vel/127.0, + \lfoSpeed, lfoSpeed, + \modIndex, modIndex, + \lfoDepth, lfoDepth, + \mix, mix ], target: context.xg); } @@ -69,6 +80,50 @@ Engine_Rhodes : CroneEngine { notes[note] = nil; } }); + this.addCommand("set_lfo_speed", "f", { + arg msg; + lfoSpeed = msg[1]; + // there has to be a better way to do this + for (0, 128, { + arg i; + if (notes[i].notNil) { + notes[i].set(\lfoSpeed, msg[1]); + } + }) + }); + this.addCommand("set_lfo_depth", "f", { + arg msg; + lfoDepth = msg[1]; + // there has to be a better way to do this + for (0, 128, { + arg i; + if (notes[i].notNil) { + notes[i].set(\lfoDepth, msg[1]); + } + }) + }); + this.addCommand("set_mod_index", "f", { + arg msg; + modIndex = msg[1]; + // there has to be a better way to do this + for (0, 128, { + arg i; + if (notes[i].notNil) { + notes[i].set(\modIndex, msg[1]); + } + }) + }); + this.addCommand("set_mix", "f", { + arg msg; + mix = msg[1]; + // there has to be a better way to do this + for (0, 128, { + arg i; + if (notes[i].notNil) { + notes[i].set(\mix, msg[1]); + } + }) + }); } free { } |