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
| export const CLEAR_COMMAND = "\u001b[2J\u001b[0;0H"; |
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
| function toTimeFormat(time) { | |
| let ss = time % 60; | |
| let mm = Math.floor(time / 60) % 60; | |
| let hh = Math.floor(time / 3600); | |
| let _ = value => value < 10 ? `0${value}` : value; | |
| return _(hh ) + ":" + _(mm) + ":" + _(ss); | |
| } |
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
| function timestampToTimeItems(timestamp) { | |
| return { | |
| hours: (((timestamp / 3600000)|0) + 9) % 24, | |
| minutes: ((timestamp / 60000)|0) % 60, | |
| seconds: ((timestamp / 1000)|0) % 60, | |
| }; | |
| } |
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
| (function() { | |
| var AudioNode = global.AudioNode; | |
| var AudioNode$connect = AudioNode.prototype.connect; | |
| var AudioNode$disconnect = AudioNode.prototype.disconnect; | |
| function connect() { | |
| var args = [].slice.call(arguments); | |
| if (args.length && typeof args[0].__connectFrom === "function") { | |
| args[0].__connectFrom.apply(args[0], [ this ].concat(args.slice(1))); |
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
| import fs from "fs"; | |
| import path from "path"; | |
| import midiConverter from "midi-converter"; | |
| let name = "clair-de-lune"; | |
| let file = fs.readFileSync(path.join(__dirname, `${name}.mid`), "binary"); | |
| let json = midiConverter.midiToJson(file); | |
| let ticksPerBeat = json.header.ticksPerBeat; | |
| let tracks = []; |
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
| let COLORS = [ | |
| [ 200, 239, 234 ], | |
| [ 209, 241, 204 ], | |
| [ 254, 247, 213 ], | |
| [ 252, 241, 211 ], | |
| [ 249, 223, 213 ], | |
| [ 246, 212, 216 ], | |
| [ 243, 209, 229 ], | |
| [ 240, 208, 228 ], |
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
| { | |
| "noteNumber": 69, | |
| "velocity": 100, | |
| "playbackTime": 0, | |
| "duration": 1, | |
| } |
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
| export function fineToDetune(x) { | |
| return Math.log((x + 1000) / 1000) / Math.log(Math.pow(2, 1 / 12)) * 100; | |
| } |
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"; | |
| var AudioNode$connect = AudioNode.prototype.connect; | |
| var AudioNode$disconnect = AudioNode.prototype.disconnect; | |
| AudioNode.prototype.connect = connect; | |
| AudioNode.prototype.disconnect = disconnect; | |
| function connect(destination) { | |
| var args = [].slice.call(arguments, 1); |
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
| { | |
| "parser": "babel-eslint", | |
| "env": { | |
| "node": true | |
| }, | |
| "rules": { | |
| // possible errors | |
| "comma-dangle": [ 2, "always-multiline" ], | |
| "no-cond-assign": [ 2, "except-parens" ], | |
| "no-console": 2, |