Skip to content

Instantly share code, notes, and snippets.

View swannodette's full-sized avatar

David Nolen swannodette

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

SuperCollider Byte Code Reference

Brian Heim 2018-06-19

Table of Contents

  • Introduction
@swannodette
swannodette / linnstrument.sc
Created April 2, 2019 18:26 — forked from kisielk/linnstrument.sc
Linnstrument + Supercollider
(
var notes, synths, on, off, mod, bend, touch;
~num_channels = 8;
~bend_range = 24;
MIDIIn.connectAll;
notes = Array.newClear(~num_channels);
synths = Array.newClear(~num_channels);

// 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 {
^super.newCopyArgs();
}
noteOn {}
noteOff {}
control {}
;; 1 - The var associated to a def, (def my-var ...) - L1142
(DefExpr. :def env form var-name
;; TODO: check if this map should be a VarExpr - Sebastian
(assoc (analyze (-> env (dissoc :locals)
(assoc :context :expr)
(assoc :def-var true))
sym)
:op :var)
doc (:jsdoc sym-meta) init-expr
@swannodette
swannodette / reactpersist.md
Created May 28, 2015 19:17 — forked from chenglou/gist:34b155691a6f58091953
Persistent React Component Problem

key is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:

  • Clone state
<Comp key={1} /><Comp key={1} />
  • Preserve component state across different parents:
@swannodette
swannodette / podfiles.md
Last active August 29, 2015 14:21 — forked from mfikes/podfiles.md

This links:

platform :ios, '8.0'
pod 'Ambly', :git => 'https://github.com/mfikes/ambly', :branch => 'jsc-c-api'
pod 'Ejecta', :git => 'https://github.com/swannodette/Ejecta', :branch => 'podspec'

Below uses my fork of your Ejecta, and also links. I mucked with getting rid of the JavaScriptCore framework and renaming the static lib so it can be included. (This works, but it is not clear if needed over just using your fork).

@swannodette
swannodette / progress.md
Last active August 29, 2015 14:21 — forked from mfikes/progress.md

In Ambly, created a new branch jsc-c-api.

In that branch, switched everything over to use JSGlobalContextRef, JSValueRef, but actually commented out most of the implementation in each of the methods, except for one tiny bit in ABYServer, where REPL-generated JavaScript is executed. I converted that over to a C-based approach:

    // Evaluate the JavaScript
    JSValueRef jsError = NULL;
    JSStringRef javaScriptStringRef = JSStringCreateWithCFString((__bridge CFStringRef)javaScript);
    JSValueRef result = JSEvaluateScript(_jsContext, javaScriptStringRef, NULL, NULL, 0, &jsError);
    JSStringRelease(javaScriptStringRef);
;; Gamma (shader-generation): https://github.com/kovasb/gamma
;; Gamma Driver (WebGL resource management, aka "Om for WebGL"): https://github.com/kovasb/gamma-driver
;; Gamma examples: https://github.com/kovasb/gamma-examples
(ns gampg.learn-gamma.lesson-01
(:require [clojure.string :as s]
[gamma.api :as g]
[gamma.program :as p]
[gamma.tools :as gt]
[gamma-driver.drivers.basic :as driver]