Created
September 3, 2017 17:20
-
-
Save drart/8afe075e944d232c710f26f608421e5e to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<head> | |
<title>Test BOPPAD GLITCHING</title> | |
</head> | |
<body> | |
<script src="../node_modules/flocking/dist/flocking-all.js"></script> | |
<script> | |
var bop = flock.synth({ | |
synthDef: { | |
id: "bop", | |
ugen: "flock.ugen.sinOsc", | |
freq: 440, | |
mul: { | |
ugen: "flock.ugen.asr", | |
start: 0.0, | |
attack: 0.1, | |
sustain: 0.1, | |
release: 0.5, | |
} | |
} | |
}); | |
bop.play(); | |
var boppad = flock.midi.connection({ | |
openImmediately: true, | |
ports: { | |
name : "BopPad" | |
}, | |
listeners: { | |
noteOn: function (msg) { | |
//console.log(msg); | |
bop.set("bop.mul.gate", 1); | |
setTimeout(function(){ | |
bop.set("mod.mul.gate", 0); | |
//console.log(msg); | |
}, 500 | |
); | |
}, | |
noteOff: function (msg) { | |
//console.log(msg); | |
}, | |
control: function (msg) { | |
//console.log(msg); | |
//bop.set("bop.mul.gate", 0); | |
}, | |
pitchbend: function(msg) { | |
console.log(msg); | |
}, | |
aftertouch: function(msg){ | |
console.log(msg); | |
} | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment