Skip to content

Instantly share code, notes, and snippets.

View mikesol's full-sized avatar
🎯
Focusing

Mike Solomon mikesol

🎯
Focusing
View GitHub Profile
_BACKEND_SPEC = dict(
set_learning_phase=__set_learning_phase,
is_keras_tensor=__is_keras_tensor,
variable=__variable,
placeholder=__placeholder,
eye=__eye,
eval=__eval,
random_uniform_variable=__random_uniform_variable,
random_normal_variable=__random_normal_variable,
random_uniform=__random_uniform_variable,
@mikesol
mikesol / saga-teller.js
Last active November 9, 2017 02:22
Telling a saga
import _ from 'lodash';
const ____kludge = (function*() {}).constructor;
const isGeneratorFunction = ugh => ugh instanceof ____kludge;
const recurse = rules => fn => isGeneratorFunction(fn) ? sagaTeller(fn, rules) : fn;
const genWrapper = (value, rules) => ({
...value,
fn: recurse(rules)(value.fn),
args: value.args.map(recurse(rules)),
});
@mikesol
mikesol / better.js
Created December 18, 2016 16:41
La programmation réactive gère des évènements musicaux
currentSeq = tops[top] ? tops[top].scene || new EvSeq(new EventEmitter()) : currentSeq;
if (verb === states.STAGED || verb === states.SHIT) {
console.log("playing " + top);
if (verb === states.SHIT) {
// reset currentSeq
currentSeq.stop();
}
// TODO: figure out a way to unsubscribe observables...this will probably in a memory leak
Observable.fromEvent(tops[top].event || new EventEmitter(), 'sc')
.subscribe(function(msg) {
@mikesol
mikesol / kludge.scd
Last active December 18, 2016 16:39
le ballon rouge - 1er brouillon
MIDIClient.init;
MIDIClient.sources;
MIDIIn.connect; // init for one port midi interface
MIDIIn.removeFuncFrom(\control, ~controlKludge);
~current = 0;
~controlKludge = { arg src, chan, num, val;
if (val == 127, {
[chan,num,val].postln;