Created
December 18, 2016 16:41
-
-
Save mikesol/955dcdbdbc69b4d6aabe020727dbd91a to your computer and use it in GitHub Desktop.
La programmation réactive gère des évènements musicaux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | |
console.log("msg="+msg); | |
sc.server.send.msg(msg); | |
}); | |
currentSeq.play(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment