Skip to content

Instantly share code, notes, and snippets.

@pce
Last active March 3, 2020 23:11
Show Gist options
  • Save pce/46aa9f0017befd5e5528a3d6d3c67cd8 to your computer and use it in GitHub Desktop.
Save pce/46aa9f0017befd5e5528a3d6d3c67cd8 to your computer and use it in GitHub Desktop.
Csound Practice
;; Select this code and press ctrl-e to evaluate
;; reset_clock()
set_tempo(120)
set_scale("min")
; start("ReverbMixer")
start("FBReverbMixer")
instr Add
asig = oscili(0.25, p4)
asig += oscili(0.25, p4 * 2)
asig *= expon(1, p3, 0.001)
istart = rand(array(200, 500, 5000, 10000))
iend = rand(array(200, 500, 5000, 10000))
asig = zdf_ladder(asig, expon(istart, p3, iend), 5) ; filter audio signal
; panning?
; out(asig*random:i(0.5, 0.9), asig*random:i(0.5, 0.9))
pan_verb_mix(asig, random:i(0.2, 0.6), random:i(0.5, 0.7))
endin
instr Arpeggio
; schedule("Add", 0, .2, 220)
; schedule("Add", .5, .1, 160)
schedule("Add", 0, .2, 110)
schedule("Add", .2, .2, 220)
schedule("Add", .3, .1, 330)
schedule("Add", .6, .2, 110)
endin
; schedule("Arpeggio", 0, 0)
;; callback instrument for csound-live-code
instr P1
hexplay("10",
"Arpeggio", p3,
in_scale(-1, 2),
fade_in(8, 128) * ampdbfs(-3))
euclidplay(1, 4,
"BD", p3,
in_scale(-1, 0),
fade_in(5, 128) * ampdbfs(-6))
; hexplay("2",
hexplay("20",
"Noi", p3,
in_scale(-1, 0),
fade_in(5, 128) * ampdbfs(-12))
endin
;; callback instrument for csound-live-code
instr P1
hexplay("90",
"Claves", p3,
in_scale(-1, 0),
fade_in(6, 128) * ampdbfs(-12))
euclidplay(1, 4,
"BD", p3,
in_scale(-1, 0),
fade_in(5, 128) * ampdbfs(-3))
hexplay("0808080c",
"SD", p3,
in_scale(-1, 0),
fade_in(5, 128) * ampdbfs(-12))
hexplay("2",
"Noi", p3,
in_scale(-1, 0),
fade_in(5, 128) * ampdbfs(-12))
hexplay("4",
"OHH", p3,
in_scale(-1, 0),
fade_in(5, 128) * ampdbfs(-12))
hexplay("16",
"CHH", p3,
in_scale(-1, 0),
fade_in(6, 128) * ampdbfs(-12))
euclidplay(13, 31,
"Sub5", p3,
in_scale(-1, 0),
fade_in(5, 128) * ampdbfs(-12))
euclidplay(1, 3,
"FM1", p3,
in_scale(-1, 0),
fade_in(6, 128) * ampdbfs(-12))
endin
;; Select this code and press ctrl-e to evaluate
;; reset_clock()
set_tempo(100)
set_scale("min")
start("FBReverbMixer")
xchnset("Reverb.fb", 0.85)
instr Fos
asig = vco2(1, p4)
asig += vco2(1, p4 * 1.002342034982308)
asig += vco2(0.25, p4 * 2.002342034982308, 10)
; modulation
asig *= oscili(1, rand(array(400, 400)))
istart = rand(array(60, 600, 6000))
iend = rand(array(60, 600, 6000))
asig = zdf_ladder(asig, expon(istart, p3, iend), 4)
; asig *= p5 * 0.25
asig = declick(asig) * p5 * .25
pan_verb_mix(asig, random:i(0.2, 0.6), random:i(0.5, 0.7))
endin
; schedule("Fos", 0, 0.1, in_scale(-1, 3), ampdbfs(-6))
; schedule("Fos", 0, 0)
instr P1
hexplay("c03004c000",
"Fos", p3,
from_root(.2, xoscm(1, array(0,5,7))),
fade_in(5, 128) * ampdbfs(-6))
euclidplay(1, 4,
"BD", p3,
in_scale(-1, 0),
fade_in(5, 128) * ampdbfs(-12))
endin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment