demo page http://thisis.herokuapp.com/reverse/
This file contains hidden or 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
/** | |
* Timbre.js - T("schedule")を使って簡単なドラムループを作る(1) | |
* このコードは以下のURLで貼り付けて試すことができます. | |
* http://mohayonao.github.com/timbre/eval.html | |
*/ | |
// まず, ドラムトラックのようなものを用意します. | |
// この足し算オブジェクトに各楽器(ハイハット, スネア, バスドラ)を加えて, | |
// 必要なときに bang() メソッドで発音させます. |
This file contains hidden or 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
/** | |
* 自分だけの timbre オブジェクトを作る | |
*/ | |
// とても簡単 | |
// コンストラクタを作って timbre.fn.register で登録します | |
function Silent() { | |
} | |
timbre.fn.register("silent", Silent); |
This file contains hidden or 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
use strict; | |
use warnings; | |
my $bpm = 160; | |
my $samplerate = 48000; | |
my $scale = [0, 2, 3, 5, 7, 8, 10]; # minor | |
{ | |
package Sine; |
This file contains hidden or 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
var FFT = (function() { | |
"use strict"; | |
var FFT = function() { | |
initialize.apply(this, arguments); | |
}, $this = FFT.prototype; | |
var FFT_PARAMS = { | |
get: function(n) { | |
return FFT_PARAMS[n] || (function() { |
This file contains hidden or 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
/** | |
* WebBeeper 2A03 | |
* Origin : http://www.g200kg.com/en/docs/webbeeper | |
* Author : g200kg氏 | |
* Comment: mohayonao | |
* Blog : http://mohayonao.hatenablog.com/entry/2012/07/12/093004 | |
*/ | |
var app; | |
var audioif; |
This file contains hidden or 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
バージョン番号が日付ベースになりました。 | |
`T("noise", 0.8)`, `T("pink", 0.4)` のように | |
ノイズジェネレータのコンストラクタで mul の設定ができるようになりました。 | |
※ T("pink") オブジェクトは他のノイズジェネレータより音が大きいので適宜調整してください。 | |
`T("perc")` が PercussiveEnvelope から ADSREnvelope になりました(動作は同じはず) |
This file contains hidden or 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
var should = require("should"); | |
var i = require("util").inspect; | |
var NEARLY_PRECISION = 1/1000000; | |
if (! Object.getOwnPropertyDescriptor(should.Assertion.prototype, "nearly") ) { | |
Object.defineProperty(should.Assertion.prototype, "nearly", { | |
get: function() { | |
this.nearlyflag = true | |
return this; |
This file contains hidden or 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
(function(window) { | |
if (window.Float32Array) return; | |
var unsigned = 0; | |
var signed = 1; | |
var floated = 2; | |
function TypedArray(klass, arg, offset, length) { | |
var a, b, bits, i, imax; | |
if (Array.isArray(arg)) { |
This file contains hidden or 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
var path = ""; | |
var callback = function(array) { | |
console.log(array.length); | |
}; | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", path); | |
xhr.responseType = "arraybuffer"; // IE9はこれが効かない. | |
xhr.onreadystatechange = function() { |