summaryrefslogtreecommitdiff
path: root/bundle.js
diff options
context:
space:
mode:
Diffstat (limited to 'bundle.js')
-rw-r--r--bundle.js332
1 files changed, 168 insertions, 164 deletions
diff --git a/bundle.js b/bundle.js
index cb667bb..558882f 100644
--- a/bundle.js
+++ b/bundle.js
@@ -24473,15 +24473,15 @@ var _tone2 = _interopRequireDefault(_tone);
var _util = __webpack_require__(1);
-var _signalWindows = __webpack_require__(13);
+var _signalWindows = __webpack_require__(14);
-var _fft = __webpack_require__(12);
+var _fft = __webpack_require__(13);
var _fft2 = _interopRequireDefault(_fft);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-var fft_size = 1024;
+var fft_size = 2048;
var fft_overlap = fft_size / 4;
var fft = new _fft2.default(fft_size);
@@ -24549,6 +24549,10 @@ function fromSpectrum(spec) {
return audioBuffer;
}
+function binToHz(spec, i) {
+ return i / spec.fft_size * spec.sr;
+}
+
function fadeInOut(pcm, fade_size) {
var pcm_length = pcm.length;
var fade = 0,
@@ -24744,7 +24748,7 @@ function reorderBins(spec, order) {
}
exports.default = {
- toSpectrum: toSpectrum, fromSpectrum: fromSpectrum,
+ toSpectrum: toSpectrum, fromSpectrum: fromSpectrum, binToHz: binToHz,
fadeInOut: fadeInOut,
cloneSpectrum: cloneSpectrum,
reverseSpectrum: reverseSpectrum, shuffleSpectrum: shuffleSpectrum, invertSpectrum: invertSpectrum, rotateSpectrum: rotateSpectrum,
@@ -24768,7 +24772,7 @@ Object.defineProperty(exports, "__esModule", {
var _util = __webpack_require__(1);
-__webpack_require__(16);
+__webpack_require__(12);
var _mouse = __webpack_require__(2);
@@ -25199,7 +25203,7 @@ var Sampler = function () {
for (var i = 0; i < player_count; i++) {
var fn = sample.fn;
if (window.location.href.match(/asdf.us/)) {
- fn = 'http://asdf.us/glass/' + fn.replace('wav', 'mp3');
+ fn = '//asdf.us/glass/' + fn.replace('wav', 'mp3');
}
var player = new _tone2.default.Player({
url: fn,
@@ -25338,8 +25342,8 @@ var sampler = void 0;
(0, _util.requestAudioContext)(function () {
// sampler = samplers.misc = new Sampler('samples/misc/glass.mp3', 2)
- // sampler = samplers.smash = new Sampler('samples/smash/g{}.mp3', 12)
- sampler = samplers.earth = new _sampler2.default('samples/earth/earth{}.mp3', 20);
+ sampler = samplers.smash = new _sampler2.default('samples/smash/g{}.mp3', 12);
+ // sampler = samplers.earth = new Sampler('samples/earth/earth{}.mp3', 20)
// sampler = samplers.glass = new Sampler('samples/glass/0{}Particle.mp3', 20)
// sampler = samplers.bubbles = new Sampler('samples/bubbles/bubbles{}.mp3', 10)
// sampler = samplers.kalimba = new Sampler('samples/kalimba/380731__cabled-mess__sansula-08-c-raw.wav', 10)
@@ -25737,6 +25741,157 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
"use strict";
+/**
+ * HiDPI Canvas Polyfill (1.0.10)
+ *
+ * Author: Jonathan D. Johnson (http://jondavidjohn.com)
+ * Homepage: https://github.com/jondavidjohn/hidpi-canvas-polyfill
+ * Issue Tracker: https://github.com/jondavidjohn/hidpi-canvas-polyfill/issues
+ * License: Apache-2.0
+*/
+(function (prototype) {
+
+ var pixelRatio = function () {
+ var canvas = window.document.createElement('canvas'),
+ context = canvas.getContext('2d'),
+ backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
+
+ return (window.devicePixelRatio || 1) / backingStore;
+ }(),
+ forEach = function forEach(obj, func) {
+ for (var p in obj) {
+ if (obj.hasOwnProperty(p)) {
+ func(obj[p], p);
+ }
+ }
+ },
+ ratioArgs = {
+ 'fillRect': 'all',
+ 'clearRect': 'all',
+ 'strokeRect': 'all',
+ 'moveTo': 'all',
+ 'lineTo': 'all',
+ 'arc': [0, 1, 2],
+ 'arcTo': 'all',
+ 'bezierCurveTo': 'all',
+ 'isPointinPath': 'all',
+ 'isPointinStroke': 'all',
+ 'quadraticCurveTo': 'all',
+ 'rect': 'all',
+ 'translate': 'all',
+ 'createRadialGradient': 'all',
+ 'createLinearGradient': 'all'
+ };
+
+ if (pixelRatio === 1) return;
+
+ forEach(ratioArgs, function (value, key) {
+ prototype[key] = function (_super) {
+ return function () {
+ var i,
+ len,
+ args = Array.prototype.slice.call(arguments);
+
+ if (value === 'all') {
+ args = args.map(function (a) {
+ return a * pixelRatio;
+ });
+ } else if (Array.isArray(value)) {
+ for (i = 0, len = value.length; i < len; i++) {
+ args[value[i]] *= pixelRatio;
+ }
+ }
+
+ return _super.apply(this, args);
+ };
+ }(prototype[key]);
+ });
+
+ // Stroke lineWidth adjustment
+ prototype.stroke = function (_super) {
+ return function () {
+ this.lineWidth *= pixelRatio;
+ _super.apply(this, arguments);
+ this.lineWidth /= pixelRatio;
+ };
+ }(prototype.stroke);
+
+ // Text
+ //
+ prototype.fillText = function (_super) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+
+ args[1] *= pixelRatio; // x
+ args[2] *= pixelRatio; // y
+
+ this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) {
+ return m * pixelRatio + u;
+ });
+
+ _super.apply(this, args);
+
+ this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) {
+ return m / pixelRatio + u;
+ });
+ };
+ }(prototype.fillText);
+
+ prototype.strokeText = function (_super) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+
+ args[1] *= pixelRatio; // x
+ args[2] *= pixelRatio; // y
+
+ this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) {
+ return m * pixelRatio + u;
+ });
+
+ _super.apply(this, args);
+
+ this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) {
+ return m / pixelRatio + u;
+ });
+ };
+ }(prototype.strokeText);
+})(window.CanvasRenderingContext2D.prototype);
+;(function (prototype) {
+ prototype.getContext = function (_super) {
+ return function (type) {
+ var backingStore, ratio, context;
+
+ if (type == '2d-lodpi') {
+ context = _super.call(this, '2d');
+ } else if (type === '2d') {
+ context = _super.call(this, '2d');
+
+ backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
+
+ ratio = (window.devicePixelRatio || 1) / backingStore;
+
+ if (ratio > 1) {
+ this.style.height = this.height + 'px';
+ this.style.width = this.width + 'px';
+ this.width *= ratio;
+ this.height *= ratio;
+ }
+ } else {
+ context = _super.call(this, type);
+ }
+
+ return context;
+ };
+ }(prototype.getContext);
+})(window.HTMLCanvasElement.prototype);
+
+/***/ }),
+/* 13 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
function FFT(size) {
this.size = size | 0;
if (this.size <= 1 || (this.size & (this.size - 1)) !== 0)
@@ -26245,17 +26400,17 @@ FFT.prototype._singleRealTransform4 = function _singleRealTransform4(outOff,
/***/ }),
-/* 13 */
+/* 14 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = {
- framer: __webpack_require__(14),
- windows: __webpack_require__(15)
+ framer: __webpack_require__(15),
+ windows: __webpack_require__(16)
};
/***/ }),
-/* 14 */
+/* 15 */
/***/ (function(module, exports) {
/*===========================================================================*\
@@ -26322,7 +26477,7 @@ module.exports = Framer;
/***/ }),
-/* 15 */
+/* 16 */
/***/ (function(module, exports) {
/*===========================================================================*\
@@ -26365,157 +26520,6 @@ module.exports = {
};
-/***/ }),
-/* 16 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * HiDPI Canvas Polyfill (1.0.10)
- *
- * Author: Jonathan D. Johnson (http://jondavidjohn.com)
- * Homepage: https://github.com/jondavidjohn/hidpi-canvas-polyfill
- * Issue Tracker: https://github.com/jondavidjohn/hidpi-canvas-polyfill/issues
- * License: Apache-2.0
-*/
-(function (prototype) {
-
- var pixelRatio = function () {
- var canvas = window.document.createElement('canvas'),
- context = canvas.getContext('2d'),
- backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
-
- return (window.devicePixelRatio || 1) / backingStore;
- }(),
- forEach = function forEach(obj, func) {
- for (var p in obj) {
- if (obj.hasOwnProperty(p)) {
- func(obj[p], p);
- }
- }
- },
- ratioArgs = {
- 'fillRect': 'all',
- 'clearRect': 'all',
- 'strokeRect': 'all',
- 'moveTo': 'all',
- 'lineTo': 'all',
- 'arc': [0, 1, 2],
- 'arcTo': 'all',
- 'bezierCurveTo': 'all',
- 'isPointinPath': 'all',
- 'isPointinStroke': 'all',
- 'quadraticCurveTo': 'all',
- 'rect': 'all',
- 'translate': 'all',
- 'createRadialGradient': 'all',
- 'createLinearGradient': 'all'
- };
-
- if (pixelRatio === 1) return;
-
- forEach(ratioArgs, function (value, key) {
- prototype[key] = function (_super) {
- return function () {
- var i,
- len,
- args = Array.prototype.slice.call(arguments);
-
- if (value === 'all') {
- args = args.map(function (a) {
- return a * pixelRatio;
- });
- } else if (Array.isArray(value)) {
- for (i = 0, len = value.length; i < len; i++) {
- args[value[i]] *= pixelRatio;
- }
- }
-
- return _super.apply(this, args);
- };
- }(prototype[key]);
- });
-
- // Stroke lineWidth adjustment
- prototype.stroke = function (_super) {
- return function () {
- this.lineWidth *= pixelRatio;
- _super.apply(this, arguments);
- this.lineWidth /= pixelRatio;
- };
- }(prototype.stroke);
-
- // Text
- //
- prototype.fillText = function (_super) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
-
- args[1] *= pixelRatio; // x
- args[2] *= pixelRatio; // y
-
- this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) {
- return m * pixelRatio + u;
- });
-
- _super.apply(this, args);
-
- this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) {
- return m / pixelRatio + u;
- });
- };
- }(prototype.fillText);
-
- prototype.strokeText = function (_super) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
-
- args[1] *= pixelRatio; // x
- args[2] *= pixelRatio; // y
-
- this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) {
- return m * pixelRatio + u;
- });
-
- _super.apply(this, args);
-
- this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) {
- return m / pixelRatio + u;
- });
- };
- }(prototype.strokeText);
-})(window.CanvasRenderingContext2D.prototype);
-;(function (prototype) {
- prototype.getContext = function (_super) {
- return function (type) {
- var backingStore, ratio, context;
-
- if (type == '2d-lodpi') {
- context = _super.call(this, '2d');
- } else if (type === '2d') {
- context = _super.call(this, '2d');
-
- backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
-
- ratio = (window.devicePixelRatio || 1) / backingStore;
-
- if (ratio > 1) {
- this.style.height = this.height + 'px';
- this.style.width = this.width + 'px';
- this.width *= ratio;
- this.height *= ratio;
- }
- } else {
- context = _super.call(this, type);
- }
-
- return context;
- };
- }(prototype.getContext);
-})(window.HTMLCanvasElement.prototype);
-
/***/ })
/******/ ]);
//# sourceMappingURL=bundle.js.map \ No newline at end of file