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
/** | |
* Fades values in and out logarithmically. | |
* @param {number} sampleRate - Number of samples per duration unit | |
* @param {number} duration - Duration of an envelope | |
* @param {number} unity - Unity approximation | |
*/ | |
function Fader(sampleRate, duration, unity = 0.999) { | |
this._sampleDuration = duration / sampleRate; | |
let T = -duration / Math.log(1 - unity); |
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
#include <ctime> | |
#include <chrono> | |
#include <string> | |
#include <sstream> | |
#include <iomanip> | |
#include <iostream> | |
using Timestamp = std::time_t; | |
using DayComponents = std::tm; | |
using Duration = std::chrono::duration<double>; |
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
import React, { Component } from 'react' | |
import hoistNonReactStatic from 'hoist-non-react-statics' | |
import { createStore, bindActionCreators } from 'redux' | |
/** | |
* This is a HOC that attaches its own redux store to a component - | |
* the store lives and dies with the component. | |
* | |
* Usecase: | |
* When you don't feel comfortable with this.setState(), but |