-
-
Save weepy/937026 to your computer and use it in GitHub Desktop.
////////////// SETUP ///////////////// | |
sleep = (time, fun) { setTimeout fun, time } | |
global.dawn = require("../node/bridge").load("../cpp/dawncontroller/dawncontroller") | |
global.__ = require "pipe_utils" | |
Units = require "./units" | |
Unit = Units.Unit | |
instruments = require "./instruments" | |
dawn.message_handler = (args) { | |
uid = args.shift(); cmd = args.shift() | |
unit = Units.Unit.all[uid] | |
cb = unit.callbacks[cmd] | |
cb | |
? cb.apply(unit, args) | |
: console.log "no callback: #{cmd} for #{uid}" | |
} | |
////////////////////////// | |
sm = new Units.USampleManager() | |
sm.load "../audio/sine-440.wav" | |
sm.load "../audio/ride.wav" | |
mx = new Units.UMixer | |
out = new Units.USoundOut | |
Unit.connect mx, "audio_out", out, "audio_in" | |
si = new instruments.SamplerInstrument { polyphony: 6 } | |
si.init sm, mx | |
si.bind "loaded", { | |
setInterval { | |
si.play 800 | |
sleep! 100 | |
si.play 700 | |
sleep! 100 | |
si.play 400 | |
sleep! 100 | |
si.play 1000 | |
si.play 800 | |
sleep! 100 | |
si.play 1700 | |
sleep! 200 | |
si.play 200 | |
sleep! 100 | |
si.play 100 | |
}, 2000 | |
} | |
ooo ... interesting. I wrote a language spec for a sequencing heavy language ~2 years ago, but I couldn't find a target implementation that I liked. The original implementation is Java (ugh) and mostly not written by me.
I hadn't seen Chuck, but it looks interesting. It doesn't align with the design goals of celluloid though. The major design goal was to "make both simple and complex media composition operations more comprehensible to the author." I wanted to create a sequencing language that more novice programmers (i.e. real musicians and performers) could use without a total disconnect.
Would be really interested in playing around with your C++ audio engine. The Nodejitsu team has done some work in this area, although I didn't have a chance to play with it yet:
https://github.com/marak/jsonloops
https://github.com/tmpvar/node-irrklang
Nodejitsu is bi-coastal (NYC and SF). Our NYC offices are at General Assembly (http://generalassemb.ly), where I (and most of the team) is based.
Look forward to seeing what you've got going on with Dawn. Could be a really interesting language back-end for Celluloid :-D
What is dawn?