Brian Heim 2018-06-19
- Introduction
FourteenBitCC { | |
/* | |
//Use Case: | |
MIDIIn.connectAll; | |
~x = FourteenBitCC.new("x", 72, 104); | |
~x.func = {|val| ("x: "++val).postln}; | |
//MPE Example with Sensel Morph | |
MIDIIn.connectAll |
( | |
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 |
key
is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:
<Comp key={1} /><Comp key={1} />
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).
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] |