From e764a483fb38f60af3022e84585543e79049f716 Mon Sep 17 00:00:00 2001 From: Ben Marx Date: Thu, 14 Sep 2023 23:29:54 +0200 Subject: [PATCH] rhodey gatedd --- .../gated/sonic-pi-rhodey_gated.scsyndef | Bin 0 -> 6049 bytes .../supercollider/gated/rhodey_gated.scd | 85 ++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 etc/synthdefs/compiled/gated/sonic-pi-rhodey_gated.scsyndef create mode 100644 etc/synthdefs/designs/supercollider/gated/rhodey_gated.scd diff --git a/etc/synthdefs/compiled/gated/sonic-pi-rhodey_gated.scsyndef b/etc/synthdefs/compiled/gated/sonic-pi-rhodey_gated.scsyndef new file mode 100644 index 0000000000000000000000000000000000000000..aef5f073cb3d2aa03afaa70db0fd3ef5f14ee007 GIT binary patch literal 6049 zcmdT|*>W326zv(wl4Z%3cROC<6|V?p6=F6d(@-oiQKB`tL}UHo_l+n9_?)(++&Q{%o?j#%EkO@ zwYXY4tQ6dn+=0_@3uMb~Pyt!L&)6S-GPb$F*akgUej2W<|4Qw@)5ECkuk7FJsSE#X zRvEkc_|cCW_o+82pAFk2k zZ`13tFJV^VXvUf68b;{JcH$__YPGwb1_3rbv$=>ON(`Y#P@5n)>r{LzD6Z+MktT*corwF$L z$(mboojL-|W;}4N2NGM@9IXPmxxh7P6|Qd@TCfWbdUo_7QboPF9+Y+}&oKem_IcL2|oNZqzCz ziz<*6T6P^tdcW+{PIjvM*WEHYd(RMef@)@~7zEfHJ8=7h4|C1`xBt z8G6VR0v=_H4gfnh8v zhw)ArW(*9IQ4CnCk@GNXV3>|#nCXOJ-oS7^ieau3h6Mw|LKMSdCk!J7hUF**obHkH zFlu0UHj3f7P8cQ(3@=16yx0lDq=8{Iis9t|gE(^W`oT_;2iTJzx$>x$6A;smz=T$p zO!6pA>UMeTAY76&N2>k530=Mgq_&=((0iZWQGfE#lQ)m5%~IXP(i4|5Ia5+w@xA8J zWdK@t6?vt370ZwW*D>b5tKdECE$7!@YBQv2br6K#_B5Q_Fd*i3_#%-TMYhG-y-opm z9X*8Ol$F>kmUrrT81Q(W-ta*zJ8+F_0rBfiAF$5^e9H%9Cg2qxFdYOUHZMk${xmY- zX}sg}WlZC$4`@td%?IocMi(3yd~-uCqA&qB01z^5ht3AilpvdcnS5;tKd(dqw*?St z+U|1A%RBis;cNgpe9gZHleU)S3Fu$*fWNb_$J(n+h!JSO0c=lhe?}{cI$6m!|C%j4__n;o??qaF9qkVb?7Q00)7f`5Ez``cZD|&v=g_R zrOiSCkk&hMPe48s`g7=R52NRWlRHAwA2#g<@k^Mr!BM%1c4Q41(Qx`8@=sI3@iT)o z|I#Eq-t8v7K%F69dy2gT9ljX8fk}(6T^5(WsV*h zKs@{n{H+gSg)ajK5R$J@$S_U2^9uk;?xHXO^8k>fQP}Zar+i7SKxoDaykzWsp|3;R Vc5J8FkU(J}g)c`}RH11s{sTq)DNO(X literal 0 HcmV?d00001 diff --git a/etc/synthdefs/designs/supercollider/gated/rhodey_gated.scd b/etc/synthdefs/designs/supercollider/gated/rhodey_gated.scd new file mode 100644 index 0000000000..fb7a64bb0d --- /dev/null +++ b/etc/synthdefs/designs/supercollider/gated/rhodey_gated.scd @@ -0,0 +1,85 @@ +/* +Port of snappizz simplified FM Rhodes Synthesizer, taken from here: + + https://sccode.org/1-522 + +For the gated version the envelope was changed to ADSR. + +Original notes: + +FM Rhodes Synthesizer + +Native SuperCollider port of STK's Rhodey. This should be preferred over the StkInst version because: + +- It uses much less CPU. +- It is easier to modify. +- It doesn't require sc3-plugins or a correct setting of StkGlobals. +- It's beginner-friendly because it uses only basic UGens: SinOsc, EnvGen, Mix, Pan2, Out. + +*/ + +( +SynthDef('sonic-pi-rhodey_gated', { + | + note = 69, note_slide = 0, note_slide_shape = 1, note_slide_curve = 0, + amp = 1, amp_slide = 0, amp_slide_shape = 1, amp_slide_curve = 0, + pan = 0, pan_slide = 0, pan_slide_shape = 1, pan_slide_curve = 0, + attack = 0, decay = 0, sustain = 1, release = 1, + attack_level = 1, decay_level = -1, sustain_level = 1, + + lfo_width = 0.3, lfo_width_slide = 0, lfo_width_slide_shape = 1, lfo_width_slide_curve = 0, + lfo_rate = 0.4, lfo_rate_slide = 0, lfo_rate_slide_shape = 1, lfo_rate_slide_curve = 0, + + // all of these range from 0 to 1 + vel = 0.8, + mod_index = 0.2, mod_index_slide = 0, mod_index_slide_shape = 1, mod_index_slide_curve = 0, + mix = 0.2, mix_slide = 0, mix_slide_shape = 1, mix_slide_curve = 0, + + gate = 1, + + out_bus = 0| + + var env, env1, env2, env3, env4; + var osc1, osc2, osc3, osc4, snd; + + note = note.midicps * 2; + note = note.varlag(note_slide, note_slide_curve, note_slide_shape); + decay_level = Select.kr(decay_level < 0, [decay_level, sustain_level]); + amp = amp.varlag(amp_slide, amp_slide_curve, amp_slide_shape); + pan = pan.varlag(pan_slide, pan_slide_curve, pan_slide_shape); + + mod_index = mod_index.varlag(mod_index_slide, mod_index_slide_curve, mod_index_slide_shape); + mix = mix.varlag(mix_slide, mix_slide_curve, mix_slide_shape); + lfo_width = lfo_width.varlag(lfo_width_slide, lfo_width_slide_curve, lfo_width_slide_shape); + lfo_rate = lfo_rate.varlag(lfo_rate_slide, lfo_rate_slide_curve, lfo_rate_slide_shape); + + lfo_rate = lfo_rate * 12; + + env1 = EnvGen.ar(Env.adsr(0.001, 1.25, sustain, release, curve: \lin), gate, doneAction: 2); + env2 = EnvGen.ar(Env.adsr(0.001, 1.00, sustain, release, curve: \lin), gate, doneAction: 2); + env3 = EnvGen.ar(Env.adsr(0.001, 1.50, sustain, release, curve: \lin), gate, doneAction: 2); + env4 = EnvGen.ar(Env.adsr(0.001, 1.50, sustain, release, curve: \lin), gate, doneAction: 2); + + osc4 = SinOsc.ar(note * 0.5) * 2pi * 2 * 0.535887 * mod_index * env4 * vel; + osc3 = SinOsc.ar(note, osc4) * env3 * vel; + osc2 = SinOsc.ar(note * 15) * 2pi * 0.108819 * env2 * vel; + osc1 = SinOsc.ar(note, osc2) * env1 * vel; + snd = Mix((osc3 * (1 - mix)) + (osc1 * mix)); + snd = snd * (SinOsc.ar(lfo_rate) * lfo_width + 1); + + // using the doneAction: 2 on the other envs can create clicks (bc of the linear curve maybe?) + + env = Env.new( + [0, attack_level, decay_level, sustain_level, 0], + [attack,decay,sustain,release], + \lin, + 3 + ); + + snd = snd * EnvGen.kr(env, gate, doneAction: 2); + snd = Pan2.ar(snd, pan, amp); + + Out.ar(out_bus, snd); +// }).play; + }).writeDefFile("/home/bmarx/music/sonic_pi/synthdefs/compiled/"); +) \ No newline at end of file