Created
April 22, 2011 16:45
-
-
Save weepy/937026 to your computer and use it in GitHub Desktop.
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
////////////// 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 | |
} | |
Author
weepy
commented
Apr 22, 2011
via email
great stuff - I'll let u know when I've got something ready to play with.
I've seen those projects too - but I needed something a bit more performant
- so decided to hand roll !
- tell me - where is nodejitsu based ?
…On Fri, Apr 22, 2011 at 7:57 PM, indexzero < ***@***.***>wrote:
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
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/937026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment