This file contains 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
double maxiFilter::formant(double input, double centerFreq, double q, double gain) { | |
cutoff = centerFreq; | |
//offset gain | |
gain += 1; | |
//gain *= 4; | |
//calculate poles and coeffs | |
w0 = TWOPI * cutoff / 44100; | |
alpha = sin(w0)/(20*q); | |
b0 = alpha*gain; |
This file contains 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
/* | |
WavManager | |
========== | |
simple class to open and stream a WAV file as a Float32Array | |
by jakub fiala | |
goldsmiths computing, 2015 |
This file contains 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
//Because meyda v2 doesn't really have an offline extraction API, we need to manually require some stuff | |
var jsfft = require("./node_modules/meyda/node_modules/jsfft/") | |
var complex_array = require("./node_modules/meyda/node_modules/jsfft/lib/complex_array.js") | |
var extractors = require("./node_modules/meyda/dist/node/featureExtractors.js") | |
var meyda_utils = require("meyda").utils | |
//this is a simple class for streaming WAV data as Float32Arrays | |
//available at https://gist.github.com/jakubfiala/cb9de100fdd4f043d46e | |
//we're not going to use its streaming functionality for simplicity | |
var WavManager = require("./wav-manager.js") | |
var fs = require('fs') |
This file contains 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
//========================================================== | |
// CUSTOM JAVASCRIPT CONSOLE | |
// built by jakub fiala | |
// | |
// this small script intercepts the standard console methods | |
// and provides a way of accessing their messages, | |
// as well as stack traces, which is really cool. | |
// it formats the stack traces for popular browsers | |
// | |
// contributions welcome! |
This file contains 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
" Some of these I've taken from spf13 | |
set nocompatible | |
filetype plugin indent on | |
set virtualedit=onemore | |
set history=1000 | |
set number | |
set cursorline | |
" set the runtime path to include Vundle and initialize |
This file contains 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
const path = require('path'); | |
const fractal = module.exports = require('@frctl/fractal').create(); | |
const mandelbrot = require('@frctl/mandelbrot'); | |
const TPLAdapter = require('./pattern-library/tpl-php-adapter.js'); | |
// PROJECT VARS | |
fractal.set('project.title', 'Web Components'); | |
fractal.set('project.version', 'v1.0'); | |
fractal.set('project.author', 'Jakub Fiala'); |
This file contains 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
After .iter(): | |
[ | |
0.02893070559670266, | |
0.02936703194102209, | |
0.030760184075799155, | |
0.033019285012034535, | |
0.03669432755302178, | |
0.041665175580908854, | |
0.048615361816985184, |
This file contains 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
# this defines a new field type | |
scalar HTML | |
# this defines a new object type | |
type Institution { | |
# the ! denotes a required field | |
name: String! | |
location: String | |
} |
This file contains 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
// creates a Sequence for the given AudioContext, which changes the `param` of the `node` according to a specified `seq` array with a given `smoothness` | |
// Example of a `seq` array: | |
// [ [0, 440], [1, 220], [1.5, 330], [2, 440] ] | |
// English: set the value to 440 immediately, then to 220 after 1 second, then to 330 after 1.5 seconds, then return to 440 after 2 seconds | |
// | |
// returns an object containing 3 methods: | |
// | |
// - `playOnce` will perform the sequence once | |
// - `loop` will loop the sequence indefinitely | |
// - `stop` will stop looping the sequence |
OlderNewer