Created
January 21, 2021 00:49
-
-
Save ashtonmeuser/5e696524d986ba6c25af0df89bdbdccc to your computer and use it in GitHub Desktop.
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
// bookmarklet-title: Eno | |
// bookmarklet-about: Plays demoscene interpretation of Brian Eno's 1/2 from the album Ambient 1. Original code by Mathieu Henri (http://www.p01.org/music_for_tiny_airports). | |
const k = 8192; | |
let t = 0; | |
const AudioContext = window.AudioContext || window.webkitAudioContext; | |
const ac = new AudioContext(); | |
const sp = ac.createScriptProcessor(k, 0, 1); | |
sp.connect(ac.destination); | |
sp.onaudioprocess = pe => { | |
for(let i=0; i<k; t+=2e-5) pe.outputBuffer.getChannelData(0)[i++] = '%,IW7:A'.charCodeAt(i%7)*t%.1*(1-t/(Math.tan(i%7)+9)%1); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment