Created
July 7, 2016 19:07
-
-
Save mohayonao/644420544f20785051831f49282062f5 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
| "use strict"; | |
| const fs = require("fs"); | |
| const decoder = require("synthdef-decoder"); | |
| const toPairs = require("lodash.topairs"); | |
| const files = fs.readdirSync(__dirname).filter(x => /\.scsyndef$/.test(x)); | |
| const ugen = {} | |
| files.forEach((fileName) => { | |
| const file = fs.readFileSync(fileName); | |
| const buffer = new Uint8Array(file); | |
| const data = decoder.decode(buffer.buffer); | |
| data.forEach((synthdef) => { | |
| synthdef.specs.forEach((spec) => { | |
| if (!ugen[spec[0]]) { | |
| ugen[spec[0]] = 0; | |
| } | |
| ugen[spec[0]]++; | |
| }); | |
| }); | |
| }); | |
| toPairs(ugen).sort((a, b) => b[1] - a[1]).forEach((items) => { | |
| console.log(`- [ ] ${ items[0] } ${ items[1] }`); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.