Skip to content

Instantly share code, notes, and snippets.

View hoch's full-sized avatar
🔄
Working

Hongchan Choi hoch

🔄
Working
View GitHub Profile
@hoch
hoch / gist:c7a9eb2a4c558df656f5288c5e604374
Created May 11, 2018 00:31
A collection of WebAudio demos
From: https://bugs.chromium.org/p/chromium/issues/detail?id=840866
1 https://www.dailydot.com/debug/chrome-autoplay-block-games/
2 https://dood.al/pinktrombone/
3 http://ianiselsewhere.com/fivestrings/
4 https://mattmakesgames.itch.io/celesteclassic
5 https://www.kpopp.io/games/ten-mississippi.html
6 https://ded.increpare.com/~locus/glances/
7 https://www.shadertoy.com/view/Xds3Rr
8 https://experiments.withgoogle.com/
@hoch
hoch / polyfill-dynamicscompressor-reduction.js
Created April 19, 2016 20:20
DynamicsCompressorNode.reduction polyfill
!function() {
var _isCompressorReductionAudioParam =
typeof (new OfflineAudioContext(1, 1, 44100)).createDynamicsCompressor().reduction
=== 'object';
AudioContext.prototype._createDynamicsCompressor =
AudioContext.prototype.createDynamicsCompressor;
OfflineAudioContext.prototype._createDynamicsCompressor =
OfflineAudioContext.prototype.createDynamicsCompressor;
@hoch
hoch / audiobuffersource-loop-points.js
Last active February 3, 2016 00:12
Chromium Web Audio Layout Test prototypes for Canopy
// @channels 3
// @sampleRate 128000
// @duration 1.5
function pitchToFrequency(pitch) {
return 440 * Math.pow(2, (Math.floor(pitch)-69)/12);
}
function pitchToPlaybackRate(pitch) {
@hoch
hoch / Microphone input
Created January 28, 2016 20:55
Chrome WebAudio Snippets
var context = new AudioContext();
navigator.webkitGetUserMedia({
audio: true
}, function (stream) {
var source = context.createMediaStreamSource(stream);
source.channelCount = context.destination.maxChannelCount;
source.connect(context.destination);
}, function (error) {
console.log(error);
});
@hoch
hoch / canopy-does-thx.js
Last active February 3, 2017 19:04
Gist Repository for Canopy app - http://hoch.github.io/canopy/
// What can I say? THX(TM) runs deep!
// @channels 2
// @duration 8
var targets = [
29.0, 87.5, 116.0, 175.0, 233.0,
350.0, 524.0, 880.0, 1048, 1760,
29.0, 87.5, 116.0, 175.0, 233.0,
350.0, 524.0, 880.0, 1048, 1760,
29.0, 87.5, 116.0, 175.0, 233.0,