Skip to content

Instantly share code, notes, and snippets.

@softpunch
Created July 2, 2017 03:11
Show Gist options
  • Save softpunch/03e95909898b69173dbab1e0729c4bad to your computer and use it in GitHub Desktop.
Save softpunch/03e95909898b69173dbab1e0729c4bad to your computer and use it in GitHub Desktop.
Web Audio boilerplate, variables, and functions
//
// convenient variables and functions to schedule and control Web Audio;
// also useful for controlling other systems using Web Audio's utilities
//
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var audioContext = new AudioContext();
var baseFreq = 440; // A4, Midi Note #69
var baseTempo = 120; // BPM
var audioOut = audioContext.destination;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment