Created
September 20, 2013 12:46
-
-
Save halfbyte/6636949 to your computer and use it in GitHub Desktop.
A patch for liv3c0der, used at JSConf.eu 2013 and before my talk at onGameStart 2013.
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
// NAME: middle | |
function draw(c, s) { | |
LC.cls(c) | |
} | |
// context, outlet, times, time per step, state, data | |
// should return array of functions that accept a single argument: the time | |
function pattern(c, o, t, l, s, d) { | |
var i; | |
var ll=t.length; | |
//s.init('loop',0); | |
notes = [0,3,7,10,12,15,19,22]; | |
AE.DelayLine.delayTime.value = l*3; | |
AE.Arp(notes, t[0], l, 16, function(time,n) { | |
AE.SpreadSynth.flt_a = 0.8; | |
AE.SpreadSynth.flt_mod = 800 + 2000 * ((Math.sin(s.loop / 2) + 1) / 2) | |
AE.SpreadSynth.play(AE.REV, time, l/2, 24 + notes[s.loop % notes.length] + n); | |
}); | |
AE.AcidSynth.play(AE.REV, t[0], l*2, 24); | |
for(i=0;i<ll;i++) { | |
//if (i % 4 == 0) AE.S['t_base'].playShot(o, t[i]); | |
//if (i % 8 == 4) AE.S['t_clap'].playShot(AE.REV, t[i]); | |
//if (i % 4 == 2) AE.S['t_hhcl'].playShot(o, t[i]); | |
if (i % 4 == 2) AE.NoiseHat.play(AE.DEL, t[i], 0.6, 5, 2000 + Math.random() * 3000, 10); | |
} | |
s.loop++; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment