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
formants = | |
a:[700, 1200, 2900] | |
i:[300, 2700, 2700] | |
u:[390, 1200, 2500] | |
e:[450, 1750, 2750] | |
o:[460, 880, 2800] | |
freq = 174.61412048339844 | |
freq = T("+", freq, T("sin", {freq:3, mul:0.8}).kr()).kr() |
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 = (grunt)-> | |
'use strict' | |
GRUNT_CHANGED_PATH = '.grunt-changed-file' | |
if grunt.file.exists GRUNT_CHANGED_PATH | |
changed = grunt.file.read GRUNT_CHANGED_PATH | |
grunt.file.delete GRUNT_CHANGED_PATH | |
changed_only = (file)-> file is changed | |
else | |
changed_only = -> true |
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
class Worker | |
constructor: (@context=@)-> | |
@jobs = [] | |
register: (job) -> | |
@jobs.push job | |
work: -> | |
job = do @jobs.shift | |
args = [=> @work.apply @, arguments].concat [].slice.call arguments |
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
class ImageLoader | |
map = {} | |
constructor: (@src)-> | |
if not map[@src] | |
@dfd = new $.Deferred | |
map[@src] = @ | |
return map[@src] | |
load: -> | |
img = new Image |
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
animate = (opts)-> | |
func = arguments[arguments.length-1] | |
ifps = 1000 / (opts.fps ? 60) | |
prev = 0 | |
_animate = (now)-> | |
dt = now - prev | |
if dt > ifps | |
result = func now, dt | |
prev = now | |
if result != false |
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
⠀⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿ |
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
"Hello world" | |
Server.default = s = Server.internal.boot() | |
############# | |
play((->SinOsc.ar(LFNoise0.kr(12, mul: 600, add: 100), 0.3))) | |
############# |
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
### | |
play({RLPF.ar(Dust.ar([12, 15]), LFNoise1.ar(1/[3, 4], 1500, 1600), 0.02)}) | |
### | |
T(_.zip( pan=[-1,+1], dust=[12,15], freq=[1/3, 1/4] ).map ([ pan, dust, freq ])-> | |
T.Pan2.ar(T.RLPF.ar(T.Dust.ar(dust), LFNoise1.ar(freq, 1500, 1600), 0.02), pan) | |
).play() |
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
class Task | |
constructor: (opts={})-> | |
@_task = [].slice.call arguments, 1 | |
@_init = opts.init ? ->{} | |
@_doMax = opts.do ? 1 | |
@_timer = 0 | |
start: -> | |
@_doCount = 0 | |
@_taskIndex = 0 |
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
dp_match = (p1, p2)-> | |
table = for j in [0...p2.length] by 1 | |
null for i in [0...p1.length] by 1 | |
i = j = 0 | |
score = table[0][0] = 1 | |
cands = [] | |
while i < p1.length - 1 or j < p2.length - 1 | |
[_i, _j] = [i+1, j+1] |