-
-
Save samOrbs/fd1efa29f59fe03a492dbf49566bb4bc to your computer and use it in GitHub Desktop.
SuperCollider CV control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
o = Server.local.options; | |
o.device = "ES-8"; | |
o.device = nil; | |
o.numOutputBusChannels = 8; | |
o.numOutputBusChannels.postln; | |
( | |
a = TempoClock.new(4); | |
SynthDef("vco1", { | chanone=0, freq=0, gate=1, sus= 1,ar=0.01, dr=0.01| | |
var vco; | |
vco = DC.ar(freq);// DC.ar outputs Direct Current! So with the ES8 is basicly a CV generator. | |
vco= vco * Linen.kr(gate, ar, sus, dr, 2); | |
OffsetOut.ar(chanone, vco); | |
}).add; | |
SynthDef("adsr", { | chantwo=1, freq=0, gate=1, sus= 1,ar=0.1, dr=0.1| | |
var adsr; | |
adsr = DC.ar(freq); // this controlls a CV enabled amplifier, so DC is working in place of a analog ADSR. | |
adsr= adsr * Linen.kr(gate, ar, sus, dr, 2); | |
OffsetOut.ar(chantwo, adsr); | |
}).add; | |
SynthDef("xfm", { | chanthree=2, freq=0, gate=1, sus= 1,ar=0.2, dr=0.2| | |
var xfm; | |
xfm = SinOsc.ar(400); //i'm using a Sine wave to modulate vco1 for FM, you can also pass it complex chords and becomes a ring modulator. | |
xfm= xfm * Linen.kr(gate, ar, sus, dr, 2); | |
OffsetOut.ar(chanthree, xfm); | |
}).add; | |
SynthDef("lfm", { | chanfour=3, freq=0, gate=1, sus= 1,ar=0.7, dr=0.7| | |
var lfm; | |
lfm = SinOsc.ar(0.5,sus); // this sine wave controlls low frequency modulation that also sends the sine through zero. | |
OffsetOut.ar(chanfour, lfm); | |
}).add; | |
) | |
( | |
~vco1 = Pbind(*[ | |
instrument: "vco1", | |
freq:Pseq([0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1].mirror,inf), // everything happens between 0 and 1. A frequency or midi note mapping function would be excellent. | |
dur: PstepNadd(Pseq([1, 0, 0, 1], 2),Pseq([1, 1, 2, 1], inf).loop*2), | |
lag: Pseq([0,0,0,0.125],inf), | |
]).play(a); | |
~adsr = Pbind(*[ | |
instrument: "adsr", | |
freq:Pseq([0.1,0.2,0.3,0.4]+0.5,inf), // 0 is 0VDC and 1 is 10VDC... -1 is -10VDC ~ 'eurocrack' modules vary. | |
dur: PstepNadd(Pseq([1, 0, 0, 1], 2),Pseq([1, 1, 2, 1], inf)), | |
lag: Pseq([0,0,0,0.125],inf), | |
]).play(a); | |
~xfm = Pbind(*[ | |
instrument: "xfm", | |
freq:Pseq([0.1,0.2,0.3,0.4],inf), | |
dur: PstepNadd(Pseq([1, 0, 0, 1], 2),Pseq([1, 1, 2, 1], inf).loop*4), | |
lag: Pseq([0,0,0,0.3],inf), | |
]).play(a); | |
~lfm = Pbind(*[ | |
instrument: "lfm", | |
freq:Pseq([0.5,1],inf), | |
dur: PstepNadd(Pseq([1, 0, 0, 1], 2),Pseq([1, 1, 2, 1], inf).loop*4), | |
lag: Pseq([0,0,0,0.3],inf), | |
]).play(a); | |
) | |
~vco1.stop; | |
~adsr.stop; | |
~xfm.stop; | |
~lfm.play; | |
~vco1.reset; | |
~adsr.reset; | |
~xfm.reset; | |
~lfm.reset; | |
~xfm.play; | |
~xfm.mute; | |
~xfm.unmute; | |
~xfm.pause; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment