commit 5ce4c13c1fc9594b98a1c94f3d81ae4a77f82be6 Author: omar mashaal Date: Wed May 20 20:02:06 2020 +1000 voltage diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ba88de --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# SuperDirt Voltage + +A small set of SuperDirt synths and Tidal helpers to control modular synths. No MIDI required! + +### Pitch, with scale quantisation + +``` +-- change notes per octave on each cycle +d1 $ pitch "0 10 8 1" # scale "<12 31 8>" # x 0 +``` + +`pitch` allows a pattern of note values. `scale` sets the amount of notes per octave. The pitch and scale values will be converted to `1v/octave`. Both `pitch` and `scale` can be paternised for some microtonal madness... + +### Gate + +``` +-- patternise gate inputs +d2 $ gate "0 1 0 0 1 1 1" # x 1 +``` + +`gate` will take a 0/1 pattern and return +5v signals for the `1` values. Use `-1` if you need a -5v. + +### Voltage automation + +``` +-- create stepped automation +d3 $ volt "1 0.2 0.5 -0.2" # x 2 +``` + +`volt` will allow you to patternise voltages however you like. + +### ADSR + +``` +-- create adsr +d4 $ adsr 0.001 0.2 0.25 1 # x 3 +``` + +![envelope](https://www.dropbox.com/s/rmsxurs03brmsug/envelope.png?raw=1) + +``` +-- patternise adsr +d5 $ adsr "<0.05 0.9>" "<0 0.4>" 1 1 # x 4 +``` + +![patternised envelopes](https://www.dropbox.com/s/qd6kxn22mexpyhq/pattterned-envelopes.png?raw=1) + +`adsr` will generate a new envelope per cycle. + +### Clock + +``` +-- clock cv output +d6 $ clock # x 5 +``` + +`clock` will output a clock cv, which matches the bpm of your tidal project. You can `slow` / `fast` this as well. + +--- + +### How to use + +**These require a DC-coupled sound card.** + +Add the `voltage.scd` synths to your active SuperDirt synth definitions. + +Evaluate the `voltage.tidal` definitions after starting Tidal. These can also be added to your Tidal startup file. + +In the above examples, `x` maps to a channel on your audio card. If you have an 8 output audio card, the `x` will likely be 0-7. If you are using an aggregate device, please refer to your Audio settings. diff --git a/example.tidal b/example.tidal new file mode 100644 index 0000000..a370624 --- /dev/null +++ b/example.tidal @@ -0,0 +1,17 @@ +-- change notes per octave on each cycle +d1 $ pitch "0 10 8 1" # scale "<12 31 8>" # x 0 + +-- patternise gate inputs +d2 $ gate "0 1 0 0 1 1 1" # x 1 + +-- create stepped automation +d3 $ volt "1 0.2 0.5 -0.2" # x 2 + +-- create adsr +d4 $ adsr 0.001 0.2 0.25 1 # x 3 + +-- patternise adsr +d5 $ adsr "<0.05 0.9>" "<0 0.4>" 1 1 # x 4 + +-- clock cv output +d6 $ clock # x 5 \ No newline at end of file diff --git a/voltage.scd b/voltage.scd new file mode 100644 index 0000000..29a018f --- /dev/null +++ b/voltage.scd @@ -0,0 +1,22 @@ +( + SynthDef(\pitch, { | out, n, channel, stepsPerOctave = 12 | + n = n + (stepsPerOctave / 12); + n = (n + (n / stepsPerOctave) * (1 / (stepsPerOctave + 1)) / 10); + OffsetOut.ar(channel, DC.ar(n)) + }).add +); + +( + SynthDef(\voltage, { | out, channel, rate | + rate = rate * 5; + OffsetOut.ar(channel, DC.ar(rate)); + }).add +); + +( + SynthDef(\adsr, { | out, channel, attack = 0.1, decay = 0.5, sustain = 0.5, release = 0.5, begin, end | + var env = Env.adsr(attack, decay, sustain, release); + var phase = Line.ar(begin, end, sustain); + OffsetOut.ar(channel, IEnvGen.ar(env, phase)); + }).add +); diff --git a/voltage.tidal b/voltage.tidal new file mode 100644 index 0000000..868725c --- /dev/null +++ b/voltage.tidal @@ -0,0 +1,7 @@ +pitch pitch = n pitch # s "pitch" +scale scale = stepsPerOctave scale +volt volt = rate volt # s "voltage" +gate = volt +clock = rate "[1 0]*8" # s "voltage" +adsr w x y z = n "0" # attack w # decay x # sustain y # release z # s "adsr" +x x = channel x \ No newline at end of file