Skip to content

Instantly share code, notes, and snippets.

"use strict";
const events = require("events");
class WebMIDIEmitter extends events.EventEmitter {
constructor(access, deviceName) {
super();
this.access = access;
this.deviceName = deviceName;
"use strict";
function test(name, testfn) {
function ptest(promise, timeout) {
const timerId = setTimeout(() => {
console.error(`test failed: ${ name }`);
throw Error(`timeout (${ timeout }ms)`);
}, timeout);
promise.then(() => {
"use strict";
const test = require("eater/runner").test;
const assert = require("assert");
const scsynth = require("../../src");
const context = new scsynth.SCContext();
// test("aa", () => {
const synthdef = {
"use strict";
const fs = require("fs")
fs.readdirSync(__dirname).filter((x) => {
return x.includes("SCUnit") && !x.includes("Kernel") && !x.includes("Expressions");
}).sort().map(x => x.replace(".js", "")).forEach((x) => {
console.log(` ${ x }: require("./${ x }"),`)
});
"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) => {
"use strict";
const events = require("events");
class SyncDate extends events.EventEmitter {
constructor() {
super();
this.deltaTime = 0;
this.syncTimes = [];
}
"use strict";
const events = require("events");
class BeatEmitter extends events.EventEmitter {
constructor(transport, api) {
super();
this.transport = transport;
this.api = api || global;
this._running = false;
module.exports = {
"Up": [ 0, 1, 2, 3 ],
"Down": [ 3, 2, 1, 0 ],
"UpDown": [ 0, 1, 2, 3, 2, 1 ],
"DownUp": [ 3, 2, 1, 0, 1, 2 ],
"Down&Up": [ 3, 2, 1, 0, 0, 1, 2, 3 ],
"Up&Down": [ 0, 1, 2, 3, 3, 2, 1, 0 ],
"Converge": [ 0, 3, 1, 2 ],
"Diverge": [ 2, 1, 3, 0 ],
"Con&Diverge": [ 0, 3, 1, 2, 1, 3 ],
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>memory leak</title>
</head>
<body>
<button id="test">test</button>
<div id="debug"></div>
<script src="build/web-audio-engine-old.js"></script>
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0.0, 1.0, 1000)
y = np.sin(x * np.pi * 2)
plt.figure(figsize=(18, 3))
plt.subplot(141)