PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/flash/examples/js/lopside.js

http://echo-nest-remix.googlecode.com/
JavaScript | 19 lines | 14 code | 3 blank | 2 comment | 2 complexity | ba1ad44abeee463f5b9d27aef3ad0018 MD5 | raw file
 1// see lopside.py,
 2// Originally by Adam Lindsay, 2009-01-19.
 3
 4function remix (analysis) {
 5    var bars = analysis.bars;
 6    var result = [];
 7    var tatums = false;
 8
 9    for (var i = 0; i < bars.length; i++) {
10        var children = bars[i].children();
11        result.push.apply(result, children.slice(0, children.length - 1));
12        if (tatums) {
13            var lastTatums = children[children.length - 1].children();
14            result.push.apply(result, lastTatums.slice(0, Math.floor(lastTatums.length / 2)));
15        }
16    }
17
18    return result;
19}