- list
- list
- list
- sublist
- sublist
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
var Deferred = (function() { | |
function Deferred() { | |
var _pendings = []; | |
var _isResolved = false; | |
var _resolveValue; | |
this.resolve = function(resolveValue) { | |
if (!_isResolved) { | |
_isResolved = true; | |
_resolveValue = resolveValue; | |
_pendings.forEach(function(callback) { |
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
overloadable = do -> | |
operator = (op, b)-> | |
a = @value() | |
b = b.value?() ? b | |
fn = switch op | |
when '+' then (a, b)-> a + b | |
when '-' then (a, b)-> a - b | |
when '*' then (a, b)-> a * b | |
when '/' then (a, b)-> a / b | |
if Array.isArray(a) |
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
SinOsc.ar(440) | |
// => SinOsc.ar(440) | |
SinOsc.ar([440, 880]) | |
// => [ SinOsc.ar(440), SinOsc.ar(880) ] | |
SinOsc.ar([440, 880], mul:(1..4), add:[0, 10]) | |
// => [ SinOsc.ar(440, mul:1, add:0), SinOsc.ar(880, mul:2, add:10), SinOsc.ar(440, mul:3, add:0), SinOsc.ar(880, mul:4, add:10) ] | |
SinOsc.ar(440, mul:0.5) |
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
var isDictionary = function(obj) { | |
return obj && obj.constructor === Object; | |
}; | |
var args_resolution = function(keys, vals, given) { | |
var dict, args = vals.slice(); | |
if (isDictionary(given[given.length - 1])) { | |
dict = given.pop(); | |
for (var key in dict) { | |
var index = keys.indexOf(key); |
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
var fn = (function() { | |
function Fn(func) { | |
this.func = func; | |
this.def = []; | |
} | |
Fn.prototype.defaults = function(def) { | |
this.def = def; | |
return this; | |
}; | |
Fn.prototype.build = function() { |
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
grunt.registerTask("swf", function() { | |
var done = this.async(); | |
var child = grunt.util.spawn({ | |
cmd : "mxmlc", | |
args: ["-o", "coffee-collider-fallback.swf", "./src/fallback.as"] | |
}, function(err, result) { | |
if (result.code !== 0) { | |
grunt.fail.fatal("Compile failed. See the above error message."); | |
} | |
done(); |
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
module.exports = function(grunt) { | |
"use strict"; | |
grunt.loadNpmTasks("grunt-contrib-jshint"); | |
grunt.loadNpmTasks("grunt-este-watch"); | |
var testFailed = []; | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON("package.json"), |
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
s = Synth.def (freq=440)-> | |
Out.ar(0, SinOsc.ar([freq, freq*1.05])) | |
.play() | |
Task.loop -> | |
freq = Math.random() * 880 + 220 | |
for i in [2, 3, 4, 3] | |
s.set freq:freq * i | |
@wait 250 | |
s.set freq:freq * i * 2 |
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
s = Synth.def (freq)-> | |
Out.ar(0, SinOsc.ar(freq)) | |
.play() | |
Task.loop -> | |
s.set freq:440 | |
@wait 1000 | |
t = Task.each [1,2,3], (i)-> | |
s.set freq:(660 * i) |