Skip to content

Instantly share code, notes, and snippets.


David Nolen swannodette

View GitHub Profile
swannodette /
Created Aug 4, 2020 — forked from carltesta/
14-bit MIDI Handler for SuperCollider
FourteenBitCC {
//Use Case:
~x ="x", 72, 104);
~x.func = {|val| ("x: "++val).postln};
//MPE Example with Sensel Morph

SuperCollider Byte Code Reference

Brian Heim 2018-06-19

Table of Contents

  • Introduction
swannodette /
Last active Apr 11, 2020
Transitive Foreign Dependencies 2

Add a new :target option, :bundle. When this target is set :nodejs is true and :nodejs-rt is false. We want to take advantage of the fact that the :nodejs target emits Node.js require for libs found in node_modules. :nodejs-rt false clarifies that we are not actually going to target the Node.js runtime.

The :bundle target always generates an index.js file, it need only be created once.

The contents of index.js looks like the following:

swannodette /
Last active Jun 1, 2020
Transitive Foreign Dependencies
NOTE: This proposal is dead. A simpler solution was arrived at via the new `:bundle` target.

ClojureScript Support for Foreign Libraries via NPM

Problem Description

The current Webpack solution works reasonable well for application oriented development, but does not address the wider issue of developing ClojureScript libraries that depend on the wider JavaScript ecosystem where the artifacts do not reside in Java-centric distrubtion like Maven (i.e. NPM). Currently a ClojureScript library cannot express these kinds of foreign library dependencies at all. Thus users must constantly redefine basic dependencies from NPM such as React, boilerplate Webpack configuration, boilerplate import/export files, and thus cannot create and share reusable ClojureScript components that depend on this vast ecosystem.

swannodette /
Created Apr 2, 2019 — forked from kisielk/
Linnstrument + Supercollider
var notes, synths, on, off, mod, bend, touch;
~num_channels = 8;
~bend_range = 24;
notes = Array.newClear(~num_channels);
synths = Array.newClear(~num_channels);
View twister-example.scd
// Twister devices are expected to be named in this form:
// classvar <endpointDevice="Midi Fighter Twister %", <endpointName="Midi Fighter Twister";
// Where "Midi Fighter Twister 1" is TwisterDevice(\default) and "Midi Fighter Twister 2" is TwisterDevice(\secondary)
// A twister device. These are singletons - there is only ever one registered per device. It works ala Ndef, Pdef, etc, see Singleton help file.
~device = TwisterDevice(\default);
// If your MIDI Fighter is named something other than the above, you can register it via:
this.registerDevice(\myDevice, "endpoint device", "endpoint name");
// And then access it via TwisterDevice(\myDevice)
DummyMIDI {
var dummy = 0;
*new {
noteOn {}
noteOff {}
control {}
swannodette / core.cljs
Last active Jul 13, 2018
Figwheel :paths bug
View core.cljs
;; src/cljs/hello_world/core.cljs
(ns hello-world.core)
(println "Hello, world!")
View deps.edn

Code Splitting

NOTE: This gist uses the master branch of ClojureScript. Clone ClojureScript and from the checkout run ./script/bootstrap and ./script/uberjar. This will produce target/cljs.jar which you can use to follow this guide.

As client applications become larger it becomes desirable to load only the code actually required to run a particular logical screen. Previously ClojureScript :modules compiler option permitted such code splitting, but this feature only worked under :advanced compilation and users would still have to manage loading these splits. :modules also required manual