git.s-ol.nu alivecoding / master pilot.alv
master

Tree @master (Download .tar.gz)

pilot.alv @masterraw · history · blame

([1]import* math time string util)
([2]import osc envelope midi pilot)

([3]defn make-lfo (type)
  ([8]fn ([5]f) ([7]lfo ([6]* f 0.5) type)))

([9]def sin-lfo ([10]make-lfo 'sin'))

([11]defn send (name value)
  ([13]osc/out '127.0.0.1' 9000
    ([12].. '/param/' name '/set')
    value))

([28]def trigger ([48]edge ([47]switch ([45]tick .3) true false)))

([29]pilot/play
  trigger #(trigger)
  ([30]ramp 8) #(ch)
  3 #(oct) 
  ([37]switch #(note)
    ([46]tick .5)
    'a' 'c' 'e' 'b' 'c')
  4 4)

([54]def f false t true)

([67]def kick ([50]edge ([59]switch ([60]tick .15) t f f f t f f f)))

([23]send 'radius' ([25]
  ([24]envelope/ar ([14]midi/cc 0) ([15]midi/cc 1))
  kick))

([33]pilot/play kick
  12 2 ([55]switch ([56]tick 2) 'c' 'a' 'f') 2)
([51]pilot/play ([52]edge ([61]switch ([62]tick .15) f f t f f f f t)) 13 3 'c' 1)

([31]defn cc-effect (name a b)
  ([41]pilot/effect name ([32]midi/cc a 0 16) ([40]midi/cc b 0 16)))

([42]cc-effect 'FEE' 16 17)
#([43]cc-effect 'REV' 18 19)
([44]cc-effect 'BIT' 20 21)

([63]pilot/effect "REV" ([66]+ 1 ([64]* ([65]lfo .18) 2)) 2)

([19]send 'offset' ([20]sin-lfo ([16]keep ([26]midi/cc 24 0 4))))