Skip to content

Instantly share code, notes, and snippets.

View notthetup's full-sized avatar
🔊

Chinmay Pendharkar notthetup

🔊
View GitHub Profile
@notthetup
notthetup / tryload.js
Last active August 29, 2015 13:56
Try to load using XMLHTTPRequest
var tryload = function(url){
var ir_request = new XMLHttpRequest();
ir_request.open("GET", url, true);
ir_request.responseType = "blob";
ir_request.onload = function () {console.log("loaded")};
ir_request.send();
}
@notthetup
notthetup / audioplayback.js
Last active August 29, 2015 13:57
Basic Audio Playback without an DOM element.
var flapSound = new Audio("./flyaway.wav");
flapSound.play(); // has to be done in an UI event callback
@notthetup
notthetup / iCurve.py
Last active August 29, 2015 13:58
Interactive iPython Notebook Test
{
"metadata": {
"name": "",
"signature": "sha256:05444a3a666df9d8410c09f11f59337f93fee5d8a8eb28978ad18c56128d427d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@notthetup
notthetup / delaytest.js
Created April 7, 2014 07:34
Testing WebAudioAPI Delay precision
"use strict";
var AudioContext = webkitAudioContext || AudioContext;
var context = new AudioContext();
var length = 44100;
// 2 Buffers to hold samples
var bufferSourceNode = context.createBufferSource();
var counterNode = context.createBufferSource();
@notthetup
notthetup / GetAudioFromURL.js
Last active August 29, 2015 14:02
A function to get Audio From URL
/*
* Downloads a sound file using XHR and decodes it using WebAudio
*
* @method GetAudioFromURL
* @param {String} URL URL of the audio file to be downloaded.
* @param {Function} onLoadCallback Callback for when the decoded AudioBuffer is ready. Callback returns an {Error} (if any) and an {AudioBuffer}
* @param {Function} onProgressCallback Callback for progress event from the XHR download.
* @param {AudioContext} [AudioContext] Optional AudioContext to be used for decoding.
*
@notthetup
notthetup / moogvcf.js
Created June 19, 2014 08:59
moogvcf.js
function MoogVCF(){
var y1, y2, y3, y4, oldx, oldy1, oldy2, oldy3;
y1 = y2 = y3 = y4 = oldx = oldy1 = oldy2 = oldy3 = 0;
var p, k, t1, t2, r, x;
return function(cutoff, res, input){
cutoff = 2 * cutoff / sampleRate;
p = cutoff * (1.8 - (0.8 * cutoff));
@notthetup
notthetup / testHTTPget.js
Last active August 29, 2015 14:03
Testing HTTP GET in Node.js
var http = require('http');
var myTimeout = 500;
var options = {
host: '192.168.0.1',
};
var req = http.request(options, function(response) {
console.log("Response : ", response.statusCode);
response.on('data', function () {});
@notthetup
notthetup / experiments.js
Last active August 29, 2015 14:04
Async JS Experiments
console.log("begin act one");
[1,2,3,4,5].forEach(function(e){console.log(e)});
console.log("end act one");
console.log("begin act two");
console.log("act two scene 1");
[1,2,3,4,5].forEach(function(e){window.setTimeout(function(){console.log(e);})});
console.log("act two scene 2");
@notthetup
notthetup / squaresynth.md
Last active August 29, 2015 14:06
Square Synth Workshop Companion