Skip to content

Instantly share code, notes, and snippets.

@jlmitch5
Created June 20, 2020 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlmitch5/15d7e6c0c6d678737ca67a0decd71ac5 to your computer and use it in GitHub Desktop.
Save jlmitch5/15d7e6c0c6d678737ca67a0decd71ac5 to your computer and use it in GitHub Desktop.
crow script for fm cloud from just friends
--- coast_is_moving ~ fm cloud inspired by N KRAMER's ENDLESS
-- in 1: change jf minimum octave (0 - 5v offset knob)
-- in 2: change jf maximum octave (0 - 5v offset knob)
-- elements is a rubbery whistle tone
-- 1st voice is warps, which FM's elements
-- out 1: cv 1
-- out 2: gate 1
-- 2nd voice is elements
-- out 3: cv 2
-- out 4: gate 2
-- jf ii in synth mode, outputs notes
-- 301 ii cv 1 is passed to pan of JF to randomly pan notes
-- around (this one is totally optional, and the 301 lines
-- can be commented out)
-- delay and reverb for vibes
-- ideas for further enhancement:
-- have octave control be input 1 only...where 0v is
-- only oct -1 and 5v is only oct 2/3, moving to higher
-- with > v values between through probability.
-- this would free up input 2 to do something with
-- chanceSeed to have an amount of notes control
-- tuned to D+30c (elements/warps should be 0v = D+30c)
jfMod = 0.195
-- in the track, I performed this by setting
-- current_scale to subsets of the scale and then
-- playing the midi notes on my computer keyboard
-- with m4l ^^macros
-- i.e. C2 = current_scale = { 8 },
-- C#2 = current_scale = { 0, 3 }, etc.
current_scale = { 0, 3, 5, 8, 10, 12 }
note = 1
jfOct = 2
elemOct = 2
jfMinOct = -1
jfMaxOct = 1
-- chance of jf notes triggering:
-- 1 = more chance to 9 = less chance
-- 10 = no chance
chanceSeed = 5
function changeMinOct (v)
v = math.floor(v/5*4 + .5) - 1
jfMinOct = v
end
function changeMaxOct (v)
v = math.floor(v/5*4 + .5) - 1
jfMaxOct = v
end
function playJFNote ()
chance = math.random(chanceSeed,10)
if chance < 10 then
-- comment out if you don't have 301 on ii bus
-- pans the JF note
ii.er301.cv(1, math.random(-5,5))
note = math.min(note, #current_scale)
ii.jf.run(math.random(0, 1) * 3.78)
ii.jf.play_note(
jfMod +
current_scale[math.min(note, #current_scale)]/12 +
jfOct,
math.random(5, 7)
)
output[1].volts = current_scale[note]/12
output[3].volts = current_scale[note]/12 + elemOct
flip = math.random(1, 100)
if flip <= 45 then
jfOct = math.max(jfMinOct, math.min(2, jfMaxOct))
elseif flip <= 85 then
jfOct = math.max(jfMinOct, math.min(1, jfMaxOct))
elseif flip <= 93 then
jfOct = math.max(jfMinOct, math.min(0, jfMaxOct))
elseif flip <= 95 then
jfOct = math.max(jfMinOct, math.min(-1, jfMaxOct))
else
jfOct = math.max(jfMinOct, math.min(3, jfMaxOct))
end
note = math.random(1, #current_scale)
end
end
function init()
-- comment out if you don't have 301 on ii bus
ii.er301.cv_slew(1, 30)
ii.jf.mode(1)
ii.jf.run_mode(1)
metro[1].event = playJFNote
-- something fast divisible by the bpm of the track (63.4)
metro[1].time = .0946
metro[1]:start()
input[1]{ mode = 'stream', time = 0.1 }
input[1].stream = changeMinOct
input[2]{ mode = 'stream', time = 0.1 }
input[2].stream = changeMaxOct
output[2].volts = 10
output[3].slew = .043
output[4].volts = 10
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment