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 React, { useState, useEffect, useRef, useContext } from 'react'; | |
import VisibilitySensor from 'react-visibility-sensor'; | |
import { el, resolve } from '@elemaudio/core'; | |
import srvb from '@elemaudio/srvb'; | |
import Chrome from '../components/Chrome'; | |
import Article from '../components/Article'; | |
import ResizingCanvas from '../components/ResizingCanvas'; | |
import { RenderContext, RenderContextProvider } from './RenderContext'; |
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
/* First, our Schroeder-Moorer filtered-feedback comb-filters | |
* | |
* @param {string} name – for identifying our feedback taps | |
* @param {number} size – for defining our feedback tap lengths | |
* @param {Node | number} feedback: [0, 1) – how long the reverb should ring out | |
* @param {Node | number} damping : [0, 1) – pole position of the lowpass filter | |
* @param {Node} xn – input signal to filter | |
* | |
* @see https://ccrma.stanford.edu/~jos/pasp/Feedback_Comb_Filters.html | |
*/ |
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
// A simple polyphonic Synth which records note events against internal | |
// sequence data. | |
// | |
// After recording a series of events, call the render function to build | |
// a series of synth voices based on the aggregated sequence data. | |
export default class Synth { | |
constructor(key, numVoices) { | |
this.voices = Array.from({length: numVoices}).map(function(x, i) { | |
return { | |
key: `${key}:v:${i}`, |
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
template <int Rows, int Cols, typename FloatType> | |
class ModulationMatrix | |
{ | |
public: | |
//============================================================================== | |
ModulationMatrix (std::array<std::array<FloatType*, Cols>, Rows> params) : m_rawMatrixParams(params) {} | |
~ModulationMatrix () {} | |
//============================================================================== | |
/** Returns the internal raw parameter matrix. */ |
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
/** Calculate and return the euclidean distance between two points. */ | |
function hypot(xi, yi, xf, yf) { | |
return Math.sqrt(Math.pow(xi - xf, 2) + Math.pow(yi - yf, 2)); | |
} | |
/** Generates an identity matrix of size (dim x dim). */ | |
function eye(dim) { | |
var mat = new Array(dim * dim); | |
for (var i = 0; i < dim; i++) { |
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
body { | |
background-color: #222; | |
} | |
#canvas { | |
border: 1px solid #eee; | |
} | |
} |
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
license: gpl-3.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
// New version | |
async.parallel([ | |
stores[BY_SEQ_STORE].put.bind(null, formatSeq(doc.metadata.seq, doc.data), | |
stores[DOC_STORE].put.bind(null, doc.metadata.id, doc.metadata) | |
], function(err) { | |
results.push(doc); | |
return saveUpdateSeq(callback2); | |
}); | |
// Old version |
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
bootstrap: | |
@curl -X POST -H 'Content-Type: application/json' -d @bootstrap.json \ | |
https://nick-thompson.cloudant.com/_replicate | |
update: | |
@./scripts/update.js | |
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
var context = new webkitAudioContext() | |
, node = context.createOscillator() | |
, Overdrive = require("wa-overdrive") | |
, overdrive = new Overdrive(context, { | |
preBand: 1.0, | |
color: 4000, | |
drive: 0.8, | |
postCut: 8000 | |
}); |
NewerOlder