Skip to content

Instantly share code, notes, and snippets.

View alexanderwallin's full-sized avatar

Alexander Wallin alexanderwallin

View GitHub Profile
import { map, max, mean, sortBy, values } from 'lodash'
import { TEST_FREQUENCIES } from 'src/constants.js'
const SPLtoHLMap = {
'125': 45,
'250': 27,
'500': 13.5,
'1000': 7.5,
'2000': 9,
'4000': 12,
@alexanderwallin
alexanderwallin / read-stream-functional.js
Last active February 21, 2017 13:12
Does this have side effects?
export const readUint16 = (typedArr, offset) => {
const buf = new ArrayBuffer(2)
const uint8 = new Uint8Array(buf)
const uint16 = new Uint16Array(buf)
uint8[0] = typedArr[offset]
uint8[1] = typedArr[offset + 1]
return uint16[0]
}
/* eslint new-cap: 0 */
import { Iterable } from 'immutable'
/**
* Subtracts a set of Maps from the current Map.
*/
export default function mapSubtract(targetMap, ...iterators) {
if (iters.length === 0) {
return targetMap
import Rx from 'rx'
const audioUrls = [
'/assets/cmajseginit.mp4',
'/assets/cmajseg1.m4s',
'/assets/cmajseg2.m4s',
'/assets/cmajseg3.m4s',
]
/**
@alexanderwallin
alexanderwallin / emcc-audio-pointer-noise.c
Last active January 6, 2017 15:27
Emscripten audio noise using pointers
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
float get_random_float(const float min, const float max) {
return min + (max - min) * ((float) rand() / (float) RAND_MAX);
}
void add_noise(const void *inBuffer, unsigned int inBufferLength, const void *outBuffer) {
int i = 0;
@alexanderwallin
alexanderwallin / unpack_stems.sh
Created June 27, 2016 18:38
Unpacks stems into folders with cover art and separate tracks using ffmpeg
#!/bin/bash
#
# Extracts tracks from stems files and puts them in folders
# named after the stem filenames.
#
for stem in *.mp4
do
name=${stem%\.*}
/**
* Lioness (ideas)
*
* A gettext suite for javascript, containing:
*
* - A gettext api
* - React components and providers
* - Babel plugin for extracting translations
* - Gulp plugin for the same reason