Skip to content

Instantly share code, notes, and snippets.

View colinbdclark's full-sized avatar

Colin Clark colinbdclark

  • Institute for Research and Development on Inclusion and Society
  • Toronto, Ontario
View GitHub Profile
@colinbdclark
colinbdclark / buffer-loading.js
Last active January 20, 2021 16:20
Using Flocking's BufferLoader
fluid.defaults("bncfi.bufferLoader", {
gradeNames: "flock.bufferLoader",
sounds: ['MaxV - Conga Hi.wav', 'MaxV - Conga Lo.wav', 'MaxV - Conga Mi.wav',
'MaxV - Tom Hi.wav', 'MaxV - Tom Lo.wav', 'MaxV - Tom Mi.wav', 'MaxV - Kick2.wav', 'MaxV - Kick1.wav']
bufferDefs: {
expander: {
funcName: "bncfi.bufferLoader.mapSoundFileURLs",
args: ["{that}.options.sounds)"]
@colinbdclark
colinbdclark / multiple-osc-targets.js
Created September 12, 2019 21:04
Relay OSC message to multiple targets
var incomingUDPPort = new osc.UDPPort({...});
var outgoingUDPPortToSuperCollider = new osc.UDPPort({...});
wss.on("connection", function (socket) {
console.log("A Web Socket connection has been established!");
var socketPort = new osc.WebSocketPort({
socket: socket
});
// Whenever we get an incoming OSC message, forward it on to SuperCollider and the Web Socket.
@colinbdclark
colinbdclark / osc-port.js
Last active September 19, 2019 17:54
TUIO Touch Source
// From https://github.com/colinbdclark/phet-osc-bridge
/*
* PhET-OSC Bridge OSC Port
* http://github.com/fluid-studios/phet-osc-bridge
*
* Copyright 2017, OCAD University
* Licensed under the New BSD license.
*/
@colinbdclark
colinbdclark / index.html
Last active August 10, 2019 14:48
Infused MPE MIDI Example
<html>
<head>
<script src="node_modules/flocking/dist/flocking-all.js"></script>
<script src="seaboard-block-instrument.js"></script>
<script src="mpe-voice.js"></script>
<script src="mpe-synth.js"></script>
<style>
body {
padding: 0;
@colinbdclark
colinbdclark / index.html
Created July 27, 2018 22:17
Bergson AutoAudioContext Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AudioContext Clock Example</title>
<style>
#blinky {
width: 2em;
height: 2em;
@colinbdclark
colinbdclark / index.html
Created December 14, 2017 03:27
Trouble with model relays in Aconite, simplified example
<html>
<head>
<script src="node_modules/infusion/dist/infusion-all.js"></script>
<script src="test.js"></script>
<style>
.model-updates {
font-family: monospace;
}
.old {
@colinbdclark
colinbdclark / dynamic-source-synths.js
Last active November 6, 2017 01:03
Dynamically creating synths based on a source array
fluid.defaults("adam.noiseSynth", {
gradeNames: "flock.synth",
freq: 300,
synthDef: {
ugen: "flock.ugen.sum",
sources: {
ugen: "flock.ugen.filter.biquad.bp",
freq: "{that}.options.freq",
@colinbdclark
colinbdclark / banded-noise.js
Last active October 27, 2017 20:03
Refactoring of Adam's banded noise synth
fluid.defaults("adam.bandednoise",
gradeNames: "flock.synth",
numBands: 10,
bandFreqMul: 100,
noizDefTemplate: {
ugen: "flock.ugen.filter.biquad.bp",
freq: 300,
q: 1,
@colinbdclark
colinbdclark / macos-multichannel-audio-chrome-bug.html
Created October 23, 2017 19:04
Test file for a bug in the Chrome's Web Audio API implementation on macOS that only recognizes 2 output channels, even for interfaces with more.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Multichannel USB Audio Interfaces Only Report Two Output Channels on macOS</title>
<style>
body {
font-family: sans-serif;
text-align: center;
}
@colinbdclark
colinbdclark / gist:483e5f1befd882b29869e39bc973cfd4
Created October 22, 2017 15:01
Multichannel chord (for testing)
flock.synth({
synthDef: [
{
ugen: "flock.ugen.out",
bus: 4,
expand: 1,
sources: [
{
ugen: "flock.ugen.sinOsc",
freq: 60,