Skip to content

Instantly share code, notes, and snippets.

View also's full-sized avatar

Ryan Berdeen also

View GitHub Profile
<!-- from http://www.p01.org/releases/20_lines_twinkle/ -->
<canvas id="tunnel" width="640" height="480"></canvas>
<script type="text/javascript">
var WIDTH = 640;
var HEIGHT = 480;
var CENTER_X = WIDTH / 2;
var CENTER_Y = HEIGHT / 2;
Index: main/src/com/noteflight/standingwave2/output/AudioSampleHandler.as
===================================================================
--- main/src/com/noteflight/standingwave2/output/AudioSampleHandler.as (revision 25)
+++ main/src/com/noteflight/standingwave2/output/AudioSampleHandler.as (working copy)
@@ -115,6 +115,7 @@
var endFrame:Number;
var sample:Sample;
var length:Number;
+ var sampleLength:Number;
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Panel title="SoundTouch Demo" width="100%" paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10">
<mx:HBox paddingBottom="10">
<mx:Button id="browseButton" label="Open an MP3…" click="chooseFile();"/>
</mx:HBox>
<mx:VBox width="100%">
<mx:Label text="Tempo"/>
<mx:HSlider id="tempoSlider" minimum="0.01" maximum="1.99" value="1" snapInterval="0.01" liveDragging="false" change="updateFilter();" width="100%"/>
// Calling Sound.play() after calling SoundChannel.stop() will begin playing
// with an empty buffer.
package {
import flash.display.Sprite;
import flash.events.SampleDataEvent;
import flash.external.ExternalInterface;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.utils.setTimeout;
# ported from http://amix.dk/blog/viewEntry/19367
require 'digest/md5'
class ConsistentHash
def initialize(nodes=nil, replicas=100)
# Manages a hash ring.
# `nodes` is a list of objects that have a proper string representation.
# `replicas` indicates how many virtual points should be used per node,