Created
January 1, 2021 05:49
-
-
Save jlmitch5/880a5a30c8cb4e7ecb9e46d7a971258e to your computer and use it in GitHub Desktop.
midcentury modular new years eve livestream crow script
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
--- midcentury modular nye livestream | |
-- in1: clock | |
-- out1: blades 1 v/oct | |
-- out2: blades 2 v/oct | |
-- out3: ripples v/oct | |
function init() | |
input[1]{ mode = 'change' | |
, direction = 'rising' | |
} | |
output[1].slew = 0 | |
output[2].slew = 0 | |
output[3].slew = 0 | |
end | |
note = 0 | |
note2 = 1 | |
note3 = 1 | |
notes = {-8, -5, -8, -3, -8, 0} | |
osc2mod = 0 | |
osc2mods = {0, 12, 7, 16} | |
every = 32 | |
everyStep = 0 | |
every2 = 16 | |
everyStep2 = 0 | |
every3 = 1 | |
everyStep3 = 0 | |
actualNote = 0 | |
actualNote2 = 0 | |
notes38 = {0, 2, 5, 7, 11, 12} | |
notes35 = {0, 5, 7, 9, 11, 12} | |
notes33 = {0, 2, 5, 9, 11, 12} | |
notes30 = {0, 2, 7, 9, 11, 12} | |
input[1].change = function() | |
if (everyStep == 0) then | |
note = note + 1 | |
actualNote = notes[(note + math.random(1, 1)) % #notes + 1] | |
output[1].volts = actualNote / 12 | |
end | |
if (everyStep3 == 0) then | |
output[1].volts = actualNote / 12 | |
if (actualNote == -8) then | |
output[3].volts = notes30[note3] / 12 | |
elseif (actualNote == -5) then | |
output[3].volts = notes35[note3] / 12 | |
elseif (actualNote == -3) then | |
output[3].volts = notes33[note3] / 12 | |
elseif (actualNote == 0) then | |
output[3].volts = notes38[note3] / 12 | |
end | |
note3 = (note3 % #notes38) + 1 | |
end | |
note = note % #notes | |
everyStep = (everyStep + 1) % every | |
everyStep2 = (everyStep2 + 1) % every2 | |
everyStep3 = (everyStep3 + 1) % every3 | |
osc2mod = osc2mod + 1 | |
actualNote2 = notes[note + 1] | |
output[2].volts = actualNote2 / 12 + osc2mods[osc2mod] / 12 | |
osc2mod = osc2mod % #osc2mods | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment