SlideShare une entreprise Scribd logo
1  sur  72
Télécharger pour lire hors ligne
WEB AUDIO BAND

@shiota

2013
OH HAI!
slideshare.net/eshiota
github.com/eshiota
@shiota
+
RETROJS
I started playing with Web Audio API after watching a presentation by @almirfilho about it. My
challenge: play the Super Mario Bros theme using JavaScript only.
Web Audio API
oscillators
// Vendor prefixed
var context = new webkitAudioContext();
connect()

context.createOscillator()

context.destination
var oscillator = context.createOscillator();
oscillator.connect(context.destination);
frequência
duração

A note, crudely speaking, is a frequency played for a certain duration.
oscillator.frequency.value = 780;
oscillator.start(0);
oscillator.stop(context.currentTime + 0.5);
Live coding
RETROJS

Demo (RetroJS) - http://eshiota.github.io/retro-audio-js/
Demo (RetroJS - Mario Theme)
{
"title" : "Super Mario Bros Theme",
"tempo" : 200,
"time_signature" : "4/4",
"score" : [
{
"instrument" : "oscillator-square",
"volume" : 0.5,
"sheet" : [
["E5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8" , ["E5.8", "F#4.8"], "-.8" , ["C5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8", ["G5.8", "B4.8", "G4.8"], "-.8", "-.4"
["C5.8", "E4.8"], "-.4" , ["G4.8", "C4.8"],
["G4.4T3", "C4.4T3"], ["E5.4T3", "G4.4T3"],
["C5.8", "E4.8"], "-.4" , ["G4.8", "C4.8"],
["G4.4T3", "C4.4T3"], ["E5.4T3", "G4.4T3"],

, "G4.8", "-.8", "-.4",

"-.4" , ["E4.8", "G3.8"], "-.4" , ["A4.8", "C4.8"], "-.8", ["B.8", "D4.8"] , "-.8", ["Bb4.8", "Db4.8"], ["A4.8", "C4.8"], "-.8",
["G5.4T3", "B4.4T3"], ["A5.8", "C5.8"], "-.8", ["F5.8", "A4.8"], ["G5.8", "B4.8"], "-.8", ["E5.8", "G4.8"], "-.8", ["C5.8", "E4.8"], ["D5.8", "F4.8"], ["B4.8", "D4.8"], "-.4",
"-.4" , ["E4.8", "G3.8"], "-.4" , ["A4.8", "C4.8"], "-.8", ["B.8", "D4.8"] , "-.8", ["Bb4.8", "Db4.8"], ["A4.8", "C4.8"], "-.8",
["G5.4T3", "B4.4T3"], ["A5.8", "C5.8"], "-.8", ["F5.8", "A4.8"], ["G5.8", "B4.8"], "-.8", ["E5.8", "G4.8"], "-.8", ["C5.8", "E4.8"], ["D5.8", "F4.8"], ["B4.8", "D4.8"], "-.2",

["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8",
["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8",
["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8",
"-.4", ["Eb5.8", "Ab4.8"], "-.4", ["D5.8", "F4.8"], "-.4", ["C5.8", "E4.8"], "-.8", "-.4",

"C5.8"], "-.8", ["G#4.8", "D4.8"], ["A4.8", "E4.8"], ["C5.8", "G4.8"], "-.8", ["A4.8", "C4.8"], ["C5.8", "E4.8"], ["D5.8", "F4.8"], "-.4",
"C5.8"], "-.8", ["C6.8", "G5.8"], "-.8", ["C6.8", "G5.8"], ["C6.8", "G5.8"], "-.8", "-.4", "-.4",
"C5.8"], "-.8", ["G#4.8", "D4.8"], ["A4.8", "E4.8"], ["C5.8", "G4.8"], "-.8", ["A4.8", "C4.8"], ["C5.8", "E4.8"], ["D5.8", "F4.8"],
"-.2", "-.4",

["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8",
["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8",
["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8",
"-.4", ["Eb5.8", "Ab4.8"], "-.4", ["D5.8", "F4.8"], "-.4", ["C5.8", "E4.8"], "-.8", "-.4",

"C5.8"], "-.8", ["G#4.8", "D4.8"], ["A4.8", "E4.8"], ["C5.8", "G4.8"], "-.8", ["A4.8", "C4.8"], ["C5.8", "E4.8"], ["D5.8", "F4.8"], "-.4",
"C5.8"], "-.8", ["C6.8", "G5.8"], "-.8", ["C6.8", "G5.8"], ["C6.8", "G5.8"], "-.8", "-.4", "-.4",
"C5.8"], "-.8", ["G#4.8", "D4.8"], ["A4.8", "E4.8"], ["C5.8", "G4.8"], "-.8", ["A4.8", "C4.8"], ["C5.8", "E4.8"], ["D5.8", "F4.8"],
"-.2",

["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], "-.8", ["G4.8", "E5.8"], ["C5.8", "E4.8"], "-.8", ["A4.8", "E4.8"], ["G4.8", "C4.8"], "-.8", "-.4",
["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], ["G4.8", "E5.8"], "-.2", "-.2",
["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], "-.8", ["G4.8", "E5.8"], ["C5.8", "E4.8"], "-.8", ["A4.8", "E4.8"], ["G4.8", "C4.8"], "-.8", "-.4",
["E5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8" , ["E5.8", "F#4.8"], "-.8" , ["C5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8", ["G5.8", "B4.8", "G4.8"], "-.8", "-.4"
["C5.8", "E4.8"], "-.4" , ["G4.8", "C4.8"],
["G4.4T3", "C4.4T3"], ["E5.4T3", "G4.4T3"],
["C5.8", "E4.8"], "-.4" , ["G4.8", "C4.8"],
["G4.4T3", "C4.4T3"], ["E5.4T3", "G4.4T3"],

, "G4.8", "-.8", "-.4",

"-.4" , ["E4.8", "G3.8"], "-.4" , ["A4.8", "C4.8"], "-.8", ["B.8", "D4.8"] , "-.8", ["Bb4.8", "Db4.8"], ["A4.8", "C4.8"], "-.8",
["G5.4T3", "B4.4T3"], ["A5.8", "C5.8"], "-.8", ["F5.8", "A4.8"], ["G5.8", "B4.8"], "-.8", ["E5.8", "G4.8"], "-.8", ["C5.8", "E4.8"], ["D5.8", "F4.8"], ["B4.8", "D4.8"], "-.4",
"-.4" , ["E4.8", "G3.8"], "-.4" , ["A4.8", "C4.8"], "-.8", ["B.8", "D4.8"] , "-.8", ["Bb4.8", "Db4.8"], ["A4.8", "C4.8"], "-.8",
["G5.4T3", "B4.4T3"], ["A5.8", "C5.8"], "-.8", ["F5.8", "A4.8"], ["G5.8", "B4.8"], "-.8", ["E5.8", "G4.8"], "-.8", ["C5.8", "E4.8"], ["D5.8", "F4.8"], ["B4.8", "D4.8"], "-.4",

["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4",
["B4.4T3", "G4.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["E5.4T3", "G5.4T3"], ["D5.4T3", "F5.4T3"], ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["A4.8", "F4.8"], ["G4.8", "E4.8"], "-.8", "-.4",
["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4",
["G4.8", "B4.8"], ["D5.8", "F5.8"], "-.8", ["D5.8", "F5.8"], ["D5.4T3", "F5.4T3"], ["C5.4T3", "E5.4T3"], ["B4.4T3", "D5.4T3"], ["G4.8", "C5.8"], "E4.8", "-.8", "E4.8", "C4.8", "-.8", "-.4",
["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4",
["B4.4T3", "G4.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["E5.4T3", "G5.4T3"], ["D5.4T3", "F5.4T3"], ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["A4.8", "F4.8"], ["G4.8", "E4.8"], "-.8", "-.4",
["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4",
["G4.8", "B4.8"], ["D5.8", "F5.8"], "-.8", ["D5.8", "F5.8"], ["D5.4T3", "F5.4T3"], ["C5.4T3", "E5.4T3"], ["B4.4T3", "D5.4T3"], ["G4.8", "C5.8"], "E4.8", "-.8", "E4.8", "C4.8", "-.8", "-.4",
["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], "-.8", ["G4.8", "E5.8"], ["C5.8", "E4.8"], "-.8", ["A4.8", "E4.8"], ["G4.8", "C4.8"], "-.8", "-.4",
["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], ["G4.8", "E5.8"], "-.2", "-.2",
["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], "-.8", ["G4.8", "E5.8"], ["C5.8", "E4.8"], "-.8", ["A4.8", "E4.8"], ["G4.8", "C4.8"], "-.8", "-.4",
["E5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8" , ["E5.8", "F#4.8"], "-.8" , ["C5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8", ["G5.8", "B4.8", "G4.8"], "-.8", "-.4"

, "G4.8", "-.8", "-.4",

["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4",
["B4.4T3", "G4.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["E5.4T3", "G5.4T3"], ["D5.4T3", "F5.4T3"], ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["A4.8", "F4.8"], ["G4.8", "E4.8"], "-.8", "-.4",
["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4",
["G4.8", "B4.8"], ["D5.8", "F5.8"], "-.8", ["D5.8", "F5.8"], ["D5.4T3", "F5.4T3"], ["C5.4T3", "E5.4T3"], ["B4.4T3", "D5.4T3"], ["G4.8", "C5.8"], "E4.8", "-.8", "E4.8", "C4.8", "-.8", "-.4",
["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4",
["B4.4T3", "G4.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["E5.4T3", "G5.4T3"], ["D5.4T3", "F5.4T3"], ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["A4.8", "F4.8"], ["G4.8", "E4.8"], "-.8", "-.4",
["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4",
["G4.8", "B4.8"], ["D5.8", "F5.8"], "-.8", ["D5.8", "F5.8"], ["D5.4T3", "F5.4T3"], ["C5.4T3", "E5.4T3"], ["B4.4T3", "D5.4T3"], ["G4.8", "C5.8"], "E4.8", "-.8", "E4.8", "C4.8", "-.8", "-.4"
]
},
{
"volume" : 0.5,
"instrument" : "oscillator-square",
"sheet" : [
"D3.8", "D3.8", "-.8", "D3.8", "-.8", "D3.8", "D3.8", "-.8", "G3.8", "-.8", "-.4", "G3.8", "-.8", "-.4",
"G3.8", "-.4", "E3.8", "-.4",
"E3.4T3", "C4.4T3", "E4.4T3",
"G3.8", "-.4", "E3.8", "-.4",
"E3.4T3", "C4.4T3", "E4.4T3",

"C3.8",
"F4.8",
"C3.8",
"F4.8",

"-.4",
"-.8",
"-.4",
"-.8",

"F3.8",
"D4.8",
"F3.8",
"D4.8",

"-.8", "G3.8",
"E4.8", "-.8",
"-.8", "G3.8",
"E4.8", "-.8",

"-.8", "Gb3.8", "F3.8", "-.8",
"C4.8", "-.8", "A3.8", "B3.8", "G3.8", "-.4",
"-.8", "Gb3.8", "F3.8", "-.8",
"C4.8", "-.8", "A3.8", "B3.8", "G3.8", "-.4",

This is the JSON representation of the Mario Bros Theme.
"C3.8",
"C3.8",
"C3.8",
"C3.8",

"-.4",
"-.4",
"-.4",
"-.8",

"G3.8", "-.4", "C4.8", "-.8", "F3.8", "-.4", "C4.8", "C4.8", "-.8", "F4.8", "-.8",
"E3.8", "-.4", "G3.8", "C4.8", "-.2", "-.4", "G3.8", "-.8",
"G3.8", "-.4", "C4.8", "-.8", "F3.8", "-.4", "C4.8", "C4.8", "-.8", "F4.8", "-.8",
"Ab3.8", "-.4", "Bb3.8", "-.4", "C4.8", "-.4", "G3.8", "G3.8", "-.8", "C3.8", "-.8",
Web Audio API
buffers
var context = new webkitAudioContext()
, request = new XMLHttpRequest()
;
request.open("get", "/drums/snare.wav");
request.responseType = "arraybuffer";
request.onload = function () {
context.decodeAudioData(request.response, function (buffer) {
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
source.start(0);
});
};
request.send();
1.
2.
3.
4.
5.

AJAX request
Decode response on request load
Create buffer source
Connect source to destination
Play
1. AJAX request
var context = new webkitAudioContext()
, request = new XMLHttpRequest()
;
request.open("get", "/drums/snare.wav");
request.responseType = "arraybuffer";
request.onload = function () {
context.decodeAudioData(request.response, function (buffer) {
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
source.start(0);
});
};
request.send();
2. Decode response on request load
var context = new webkitAudioContext()
, request = new XMLHttpRequest()
;
request.open("get", "/drums/snare.wav");
request.responseType = "arraybuffer";
request.onload = function () {
context.decodeAudioData(request.response, function (buffer) {
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
source.start(0);
});
};
request.send();
3. Create buffer source
var context = new webkitAudioContext()
, request = new XMLHttpRequest()
;
request.open("get", "/drums/snare.wav");
request.responseType = "arraybuffer";
request.onload = function () {
context.decodeAudioData(request.response, function (buffer) {
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
source.start(0);
});
};
request.send();
4. Connect source to destination
var context = new webkitAudioContext()
, request = new XMLHttpRequest()
;
request.open("get", "/drums/snare.wav");
request.responseType = "arraybuffer";
request.onload = function () {
context.decodeAudioData(request.response, function (buffer) {
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
source.start(0);
});
};
request.send();
5. Play
var context = new webkitAudioContext()
, request = new XMLHttpRequest()
;
request.open("get", "/drums/snare.wav");
request.responseType = "arraybuffer";
request.onload = function () {
context.decodeAudioData(request.response, function (buffer) {
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
source.start(0);
});
};
request.send();
Live coding
WEB AUDIO BAND
Overview
instrument

gain node

instrument

gain node

instrument

gain node

master gain
node

output
WEB AUDIO BAND
Drum Sequencer
Track 1
Track 2
Track 3
Track 4
Track 1
Track 2
Track 3
Track 4
play track 1
Track 1
Track 2
Track 3
Track 4
Track 1
Track 2
Track 3
Track 4
play track 2
Track 1
Track 2
Track 3
Track 4
Drums.soundsMap = {
"snare" : "/sounds/drums/snare.wav",
"kick" : "/sounds/drums/kick.wav",
"tom_hi" : "/sounds/drums/tom_hi.wav",
"tom_low" : "/sounds/drums/tom_low.wav",
"hihat_closed" : "/sounds/drums/hihat_closed.wav",
"hihat_open" : "/sounds/drums/hihat_open.wav",
"trash" : "/sounds/drums/trash.wav"
};
SoundsMapLoader.loadSounds = function (audioContext) {
var dfds = []
, masterDfd = $.Deferred()
;
for (var key in this.soundsMap) {
dfds.push(this.loadSound(audioContext, key, this.soundsMap[key]));
}
$.when.apply($, dfds).then(function () {
masterDfd.resolve();
});
return masterDfd;
};
SoundsMapLoader.loadSound = function (audioContext, key, url) {
var request = new XMLHttpRequest()
, dfd = $.Deferred()
;
request.open("get", url);
request.responseType = "arraybuffer";
request.onload = (function () {
audioContext.decodeAudioData(request.response, (function (buffer) {
this.sounds[key] = buffer;
dfd.resolve();
}).bind(this));
}).bind(this);
request.send();
return dfd;
};
//
//
//
//
//
//
//

Each beat (1/4 note) has 4 divisions (1/16 notes). A full cycle has
32 1/16 notes, which will be called as positions.
Something like this:
- - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - 0
4
8
12
16
20
24
28
31

Looper.fn.cycle = function () {
if (!this.playing) { return true; }
this.trigger("position-change", [this.position]);
this.position = this.position === this.lastPosition ? 0 : this.position + 1;
setTimeout(this.cycle.bind(this), this.positionDuration);
};
60bpm = 1bps
1bps = 4 posições p/ segundo
1000ms / 4 => positionDuration = 250ms
Demo (Web Audio Band - Drum Sequencer)
WEB AUDIO BAND
Synth Sequencer
Oscillators (sawtooth waves)
+
Overdrive
oscillator

overdrive
plugin

gain node
Demo (Web Audio Band - Synth Sequencer)
WEB AUDIO BAND
Bass Sequencer
SoundFont

WAV

MP
3
[Tue Nov
$ ls -w
A0.mp3
A1.mp3
A2.mp3
A3.mp3
A4.mp3
A5.mp3
A6.mp3

19 01:42 ~/Sites/petprojects/webaudio_band/public/sounds/bass] (master) [aws:personal]
A7.mp3
Ab1.mp3
Ab2.mp3
Ab3.mp3
Ab4.mp3
Ab5.mp3
Ab6.mp3

Ab7.mp3
B0.mp3
B1.mp3
B2.mp3
B3.mp3
B4.mp3
B5.mp3

B6.mp3
B7.mp3
Bb0.mp3
Bb1.mp3
Bb2.mp3
Bb3.mp3
Bb4.mp3

Bb5.mp3
Bb6.mp3
Bb7.mp3
C1.mp3
C2.mp3
C3.mp3
C4.mp3

C5.mp3
C6.mp3
C7.mp3
C8.mp3
D1.mp3
D2.mp3
D3.mp3

D4.mp3
D5.mp3
D6.mp3
D7.mp3
Db1.mp3
Db2.mp3
Db3.mp3

Db4.mp3
Db5.mp3
Db6.mp3
Db7.mp3
E1.mp3
E2.mp3
E3.mp3

E4.mp3
E5.mp3
E6.mp3
E7.mp3
Eb1.mp3
Eb2.mp3
Eb3.mp3

Eb4.mp3
Eb5.mp3
Eb6.mp3
Eb7.mp3
F1.mp3
F2.mp3
F3.mp3

F4.mp3
F5.mp3
F6.mp3
F7.mp3
G1.mp3
G2.mp3
G3.mp3

G4.mp3
G5.mp3
G6.mp3
G7.mp3
Gb1.mp3
Gb2.mp3
Gb3.mp3

Gb4.mp3
Gb5.mp3
Gb6.mp3
Gb7.mp3
Demo (Web Audio Band - Bass Sequencer)
WEB AUDIO BAND
Websockets
/admin?key=

/
/

Host
Interface

Instrument
Interface

Instrument
Interface
new instrument
slot
instruments
available

Host
Interface

Instrument
Interface

Instrument
Interface
instrument
connect

instrument
select
instruments
available

Host
Interface

Instrument
Interface

Instrument
Interface
instrument
played

Host
Interface

play(sound);

instrument
play

Instrument
Interface
Demo (Web Audio Band - Remote Instruments)
Por quê?

Why did I develop this projet?
Eu amo música.

I love music.
Programar é divertido.

Programming is fun.
Aprimorei conceitos de arquitetura.

I improved my architecture concepts.
Aprendi e conheci mais sobre:

I learned and got to know more about:
JavaScript
Sass
Web Audio API
Bower
Grunt
NodeJS
ExpressJS
Socket.IO
MIDI/SoundFont
E pra provar que esses caras estão errados:

And did it to prove that these guys are wrong:
The Web is not dead. Long live the Web.
And I finish this talk with a picture of my cats Jamie and Lexie. <3
THANKS!
slideshare.net/eshiota
github.com/eshiota
@shiota

Contenu connexe

Tendances

Motivacao para melhor_desempenho
Motivacao para melhor_desempenhoMotivacao para melhor_desempenho
Motivacao para melhor_desempenhoPriscila Miranda
 
Nghien cuu cong_nghe_sx_dich_dam,_bot_ca
Nghien cuu cong_nghe_sx_dich_dam,_bot_caNghien cuu cong_nghe_sx_dich_dam,_bot_ca
Nghien cuu cong_nghe_sx_dich_dam,_bot_casaomai491
 
Etransformation de l'éducation avant le bac
Etransformation de l'éducation avant le bacEtransformation de l'éducation avant le bac
Etransformation de l'éducation avant le bacBenoit Paul Max
 
Hajj or Umra by Shykh Bin Baz
Hajj or Umra by Shykh Bin BazHajj or Umra by Shykh Bin Baz
Hajj or Umra by Shykh Bin BazFahad Javed
 
2.ideal familybyabdurrazzaq
2.ideal familybyabdurrazzaq2.ideal familybyabdurrazzaq
2.ideal familybyabdurrazzaqrasikulindia
 
Ideal family by abdur razzaq
Ideal family by abdur razzaqIdeal family by abdur razzaq
Ideal family by abdur razzaqSelf
 
Doing Business in the U.S. - Franchising Requirements and Litigation/E-Discov...
Doing Business in the U.S. - Franchising Requirements and Litigation/E-Discov...Doing Business in the U.S. - Franchising Requirements and Litigation/E-Discov...
Doing Business in the U.S. - Franchising Requirements and Litigation/E-Discov...Di Santo LLP
 
Engaging Consumers - IFAA Conference
Engaging Consumers - IFAA ConferenceEngaging Consumers - IFAA Conference
Engaging Consumers - IFAA ConferencePhillip Smith
 
ពុទ្ធកិច្ច ៤៥ ព្រះវស្សា
ពុទ្ធកិច្ច ៤៥ ព្រះវស្សាពុទ្ធកិច្ច ៤៥ ព្រះវស្សា
ពុទ្ធកិច្ច ៤៥ ព្រះវស្សាVantha Kago
 
Saudi Students Guide to Atlanta
Saudi Students Guide to Atlanta Saudi Students Guide to Atlanta
Saudi Students Guide to Atlanta kmf91
 

Tendances (17)

Curso de guitarrra
Curso de guitarrraCurso de guitarrra
Curso de guitarrra
 
Motivacao para melhor_desempenho
Motivacao para melhor_desempenhoMotivacao para melhor_desempenho
Motivacao para melhor_desempenho
 
Luna al
Luna alLuna al
Luna al
 
Nghien cuu cong_nghe_sx_dich_dam,_bot_ca
Nghien cuu cong_nghe_sx_dich_dam,_bot_caNghien cuu cong_nghe_sx_dich_dam,_bot_ca
Nghien cuu cong_nghe_sx_dich_dam,_bot_ca
 
Etransformation de l'éducation avant le bac
Etransformation de l'éducation avant le bacEtransformation de l'éducation avant le bac
Etransformation de l'éducation avant le bac
 
Hajj or Umra by Shykh Bin Baz
Hajj or Umra by Shykh Bin BazHajj or Umra by Shykh Bin Baz
Hajj or Umra by Shykh Bin Baz
 
2.ideal familybyabdurrazzaq
2.ideal familybyabdurrazzaq2.ideal familybyabdurrazzaq
2.ideal familybyabdurrazzaq
 
Ideal family by abdur razzaq
Ideal family by abdur razzaqIdeal family by abdur razzaq
Ideal family by abdur razzaq
 
Doing Business in the U.S. - Franchising Requirements and Litigation/E-Discov...
Doing Business in the U.S. - Franchising Requirements and Litigation/E-Discov...Doing Business in the U.S. - Franchising Requirements and Litigation/E-Discov...
Doing Business in the U.S. - Franchising Requirements and Litigation/E-Discov...
 
Engaging Consumers - IFAA Conference
Engaging Consumers - IFAA ConferenceEngaging Consumers - IFAA Conference
Engaging Consumers - IFAA Conference
 
THESIS, FINAL
THESIS, FINALTHESIS, FINAL
THESIS, FINAL
 
ពុទ្ធកិច្ច ៤៥ ព្រះវស្សា
ពុទ្ធកិច្ច ៤៥ ព្រះវស្សាពុទ្ធកិច្ច ៤៥ ព្រះវស្សា
ពុទ្ធកិច្ច ៤៥ ព្រះវស្សា
 
Matrices, Matrix
Matrices, MatrixMatrices, Matrix
Matrices, Matrix
 
Saudi Students Guide to Atlanta
Saudi Students Guide to Atlanta Saudi Students Guide to Atlanta
Saudi Students Guide to Atlanta
 
Quran
QuranQuran
Quran
 
Thirukkural.
Thirukkural.Thirukkural.
Thirukkural.
 
Thirukkural
ThirukkuralThirukkural
Thirukkural
 

Similaire à Web Audio Band - Playing with a band in your browser

Rapid Team Performance Assessment
Rapid Team Performance AssessmentRapid Team Performance Assessment
Rapid Team Performance AssessmentRofty
 
Taller de Web Apps - Friabit 2014
Taller de Web Apps - Friabit 2014Taller de Web Apps - Friabit 2014
Taller de Web Apps - Friabit 2014TICAnoia
 
59598225 thesis-slim
59598225 thesis-slim59598225 thesis-slim
59598225 thesis-slimThanh Nguyen
 
Hacia un elearning multisoporte y multicanal: uso de nuevos soportes en los c...
Hacia un elearning multisoporte y multicanal: uso de nuevos soportes en los c...Hacia un elearning multisoporte y multicanal: uso de nuevos soportes en los c...
Hacia un elearning multisoporte y multicanal: uso de nuevos soportes en los c...CRISEL BY AEFOL
 
2014 onesparkpresentation
2014 onesparkpresentation2014 onesparkpresentation
2014 onesparkpresentationelusivesmile
 
Petrel - ATEX Ex d & Ex de Hazardous Area Lighting, Enclosures & Starters Zon...
Petrel - ATEX Ex d & Ex de Hazardous Area Lighting, Enclosures & Starters Zon...Petrel - ATEX Ex d & Ex de Hazardous Area Lighting, Enclosures & Starters Zon...
Petrel - ATEX Ex d & Ex de Hazardous Area Lighting, Enclosures & Starters Zon...Thorne & Derrick International
 
Petrel Hazardous Area Zone 1 & Zone 2 Lighting & Enclosures (ATEX Certified)
Petrel Hazardous Area Zone 1 & Zone 2 Lighting & Enclosures (ATEX Certified)Petrel Hazardous Area Zone 1 & Zone 2 Lighting & Enclosures (ATEX Certified)
Petrel Hazardous Area Zone 1 & Zone 2 Lighting & Enclosures (ATEX Certified)Thorne & Derrick International
 
A Little Bit Of Insight 2011
A Little Bit Of Insight 2011A Little Bit Of Insight 2011
A Little Bit Of Insight 2011Marrianne Garbutt
 
Fusion 06 2003
Fusion 06 2003Fusion 06 2003
Fusion 06 2003rukford1
 
Gandhi essayrubric20112012
Gandhi essayrubric20112012Gandhi essayrubric20112012
Gandhi essayrubric20112012Hank Maine
 
Museum Collections Management and Online Exhibit Software
Museum Collections Management and Online Exhibit SoftwareMuseum Collections Management and Online Exhibit Software
Museum Collections Management and Online Exhibit SoftwareK L
 
Monitoring system sample thesis
Monitoring system sample thesisMonitoring system sample thesis
Monitoring system sample thesisMauMeow11
 
20101003 budget+draft+2011
20101003 budget+draft+201120101003 budget+draft+2011
20101003 budget+draft+2011aristos arestos
 

Similaire à Web Audio Band - Playing with a band in your browser (20)

Rapid Team Performance Assessment
Rapid Team Performance AssessmentRapid Team Performance Assessment
Rapid Team Performance Assessment
 
Ahmad_Raza
Ahmad_RazaAhmad_Raza
Ahmad_Raza
 
Taller de Web Apps - Friabit 2014
Taller de Web Apps - Friabit 2014Taller de Web Apps - Friabit 2014
Taller de Web Apps - Friabit 2014
 
59598225 thesis-slim
59598225 thesis-slim59598225 thesis-slim
59598225 thesis-slim
 
Hacia un elearning multisoporte y multicanal: uso de nuevos soportes en los c...
Hacia un elearning multisoporte y multicanal: uso de nuevos soportes en los c...Hacia un elearning multisoporte y multicanal: uso de nuevos soportes en los c...
Hacia un elearning multisoporte y multicanal: uso de nuevos soportes en los c...
 
2014 onesparkpresentation
2014 onesparkpresentation2014 onesparkpresentation
2014 onesparkpresentation
 
All links
All linksAll links
All links
 
Pam pdf
Pam pdfPam pdf
Pam pdf
 
Pam pdf
Pam pdfPam pdf
Pam pdf
 
Petrel - ATEX Ex d & Ex de Hazardous Area Lighting, Enclosures & Starters Zon...
Petrel - ATEX Ex d & Ex de Hazardous Area Lighting, Enclosures & Starters Zon...Petrel - ATEX Ex d & Ex de Hazardous Area Lighting, Enclosures & Starters Zon...
Petrel - ATEX Ex d & Ex de Hazardous Area Lighting, Enclosures & Starters Zon...
 
Petrel Hazardous Area Zone 1 & Zone 2 Lighting & Enclosures (ATEX Certified)
Petrel Hazardous Area Zone 1 & Zone 2 Lighting & Enclosures (ATEX Certified)Petrel Hazardous Area Zone 1 & Zone 2 Lighting & Enclosures (ATEX Certified)
Petrel Hazardous Area Zone 1 & Zone 2 Lighting & Enclosures (ATEX Certified)
 
Open Solaris 2009.06
Open Solaris 2009.06Open Solaris 2009.06
Open Solaris 2009.06
 
A Little Bit Of Insight 2011
A Little Bit Of Insight 2011A Little Bit Of Insight 2011
A Little Bit Of Insight 2011
 
Fusion 06 2003
Fusion 06 2003Fusion 06 2003
Fusion 06 2003
 
6 hsdpa
6 hsdpa6 hsdpa
6 hsdpa
 
Gandhi essayrubric20112012
Gandhi essayrubric20112012Gandhi essayrubric20112012
Gandhi essayrubric20112012
 
Museum Collections Management and Online Exhibit Software
Museum Collections Management and Online Exhibit SoftwareMuseum Collections Management and Online Exhibit Software
Museum Collections Management and Online Exhibit Software
 
Monitoring system sample thesis
Monitoring system sample thesisMonitoring system sample thesis
Monitoring system sample thesis
 
Life is on
Life is onLife is on
Life is on
 
20101003 budget+draft+2011
20101003 budget+draft+201120101003 budget+draft+2011
20101003 budget+draft+2011
 

Plus de Eduardo Shiota Yasuda

The anatomy of an A/B Test - JSConf Colombia Workshop
The anatomy of an A/B Test - JSConf Colombia WorkshopThe anatomy of an A/B Test - JSConf Colombia Workshop
The anatomy of an A/B Test - JSConf Colombia WorkshopEduardo Shiota Yasuda
 
Internationalisation: 2200+ different ways to view a website
Internationalisation: 2200+ different ways to view a websiteInternationalisation: 2200+ different ways to view a website
Internationalisation: 2200+ different ways to view a websiteEduardo Shiota Yasuda
 
RetroJS - Escrevendo músicas da era 8-bits com JavaScript e Web Audio API
RetroJS - Escrevendo músicas da era 8-bits com JavaScript e Web Audio APIRetroJS - Escrevendo músicas da era 8-bits com JavaScript e Web Audio API
RetroJS - Escrevendo músicas da era 8-bits com JavaScript e Web Audio APIEduardo Shiota Yasuda
 
Criando uma arquitetura de front-end do zero
Criando uma arquitetura de front-end do zeroCriando uma arquitetura de front-end do zero
Criando uma arquitetura de front-end do zeroEduardo Shiota Yasuda
 
Baby.com.br: Analisando, adaptando e melhorando a arquitetura da informação e...
Baby.com.br: Analisando, adaptando e melhorando a arquitetura da informação e...Baby.com.br: Analisando, adaptando e melhorando a arquitetura da informação e...
Baby.com.br: Analisando, adaptando e melhorando a arquitetura da informação e...Eduardo Shiota Yasuda
 
Desafios do Desenvolvimento de Front-end em um e-commerce
Desafios do Desenvolvimento de Front-end em um e-commerceDesafios do Desenvolvimento de Front-end em um e-commerce
Desafios do Desenvolvimento de Front-end em um e-commerceEduardo Shiota Yasuda
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaEduardo Shiota Yasuda
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebEduardo Shiota Yasuda
 
Sushi e Interfaces - PechaKucha São Paulo Vol. 8 + Inspire Japan
Sushi e Interfaces - PechaKucha São Paulo Vol. 8 + Inspire JapanSushi e Interfaces - PechaKucha São Paulo Vol. 8 + Inspire Japan
Sushi e Interfaces - PechaKucha São Paulo Vol. 8 + Inspire JapanEduardo Shiota Yasuda
 
O Design e a Interface no mundo da Programação
O Design e a Interface no mundo da ProgramaçãoO Design e a Interface no mundo da Programação
O Design e a Interface no mundo da ProgramaçãoEduardo Shiota Yasuda
 

Plus de Eduardo Shiota Yasuda (14)

Front-end Culture @ Booking.com
Front-end Culture @ Booking.comFront-end Culture @ Booking.com
Front-end Culture @ Booking.com
 
The anatomy of an A/B Test - JSConf Colombia Workshop
The anatomy of an A/B Test - JSConf Colombia WorkshopThe anatomy of an A/B Test - JSConf Colombia Workshop
The anatomy of an A/B Test - JSConf Colombia Workshop
 
Dominating the Web Typography
Dominating the Web TypographyDominating the Web Typography
Dominating the Web Typography
 
Internationalisation: 2200+ different ways to view a website
Internationalisation: 2200+ different ways to view a websiteInternationalisation: 2200+ different ways to view a website
Internationalisation: 2200+ different ways to view a website
 
RetroJS - Escrevendo músicas da era 8-bits com JavaScript e Web Audio API
RetroJS - Escrevendo músicas da era 8-bits com JavaScript e Web Audio APIRetroJS - Escrevendo músicas da era 8-bits com JavaScript e Web Audio API
RetroJS - Escrevendo músicas da era 8-bits com JavaScript e Web Audio API
 
Criando uma arquitetura de front-end do zero
Criando uma arquitetura de front-end do zeroCriando uma arquitetura de front-end do zero
Criando uma arquitetura de front-end do zero
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
 
Baby.com.br: Analisando, adaptando e melhorando a arquitetura da informação e...
Baby.com.br: Analisando, adaptando e melhorando a arquitetura da informação e...Baby.com.br: Analisando, adaptando e melhorando a arquitetura da informação e...
Baby.com.br: Analisando, adaptando e melhorando a arquitetura da informação e...
 
Desafios do Desenvolvimento de Front-end em um e-commerce
Desafios do Desenvolvimento de Front-end em um e-commerceDesafios do Desenvolvimento de Front-end em um e-commerce
Desafios do Desenvolvimento de Front-end em um e-commerce
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga Escala
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da Web
 
User Experience para Developers
User Experience para DevelopersUser Experience para Developers
User Experience para Developers
 
Sushi e Interfaces - PechaKucha São Paulo Vol. 8 + Inspire Japan
Sushi e Interfaces - PechaKucha São Paulo Vol. 8 + Inspire JapanSushi e Interfaces - PechaKucha São Paulo Vol. 8 + Inspire Japan
Sushi e Interfaces - PechaKucha São Paulo Vol. 8 + Inspire Japan
 
O Design e a Interface no mundo da Programação
O Design e a Interface no mundo da ProgramaçãoO Design e a Interface no mundo da Programação
O Design e a Interface no mundo da Programação
 

Dernier

Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Bookingnoor ahmed
 
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser... Shivani Pandey
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...noor ahmed
 
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...Apsara Of India
 
Call Girl Service Belur - 7001035870 with real photos and phone numbers
Call Girl Service Belur - 7001035870 with real photos and phone numbersCall Girl Service Belur - 7001035870 with real photos and phone numbers
Call Girl Service Belur - 7001035870 with real photos and phone numbersanamikaraghav4
 
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...rahim quresi
 
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...aamir
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls In Goa 9316020077 Goa Call Girl By Indian Call Girls Goa
Call Girls In Goa  9316020077 Goa  Call Girl By Indian Call Girls GoaCall Girls In Goa  9316020077 Goa  Call Girl By Indian Call Girls Goa
Call Girls In Goa 9316020077 Goa Call Girl By Indian Call Girls Goasexy call girls service in goa
 
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...anamikaraghav4
 
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...rahim quresi
 
👙 Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Serviceanamikaraghav4
 
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna... Shivani Pandey
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448ont65320
 

Dernier (20)

Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
 
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
 
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
 
CHEAP Call Girls in Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in  Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in  Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
 
Call Girl Service Belur - 7001035870 with real photos and phone numbers
Call Girl Service Belur - 7001035870 with real photos and phone numbersCall Girl Service Belur - 7001035870 with real photos and phone numbers
Call Girl Service Belur - 7001035870 with real photos and phone numbers
 
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
 
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
 
Goa Call "Girls Service 9316020077 Call "Girls in Goa
Goa Call "Girls  Service   9316020077 Call "Girls in GoaGoa Call "Girls  Service   9316020077 Call "Girls in Goa
Goa Call "Girls Service 9316020077 Call "Girls in Goa
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
 
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
Russian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In GoaRussian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In Goa
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
 
Call Girls In Goa 9316020077 Goa Call Girl By Indian Call Girls Goa
Call Girls In Goa  9316020077 Goa  Call Girl By Indian Call Girls GoaCall Girls In Goa  9316020077 Goa  Call Girl By Indian Call Girls Goa
Call Girls In Goa 9316020077 Goa Call Girl By Indian Call Girls Goa
 
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
College Call Girls New Alipore - For 7001035870 Cheap & Best with original Ph...
 
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
 
👙 Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
 
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
 
Call Girls South Avenue Delhi WhatsApp Number 9711199171
Call Girls South Avenue Delhi WhatsApp Number 9711199171Call Girls South Avenue Delhi WhatsApp Number 9711199171
Call Girls South Avenue Delhi WhatsApp Number 9711199171
 

Web Audio Band - Playing with a band in your browser

  • 3.
  • 4. +
  • 5. RETROJS I started playing with Web Audio API after watching a presentation by @almirfilho about it. My challenge: play the Super Mario Bros theme using JavaScript only.
  • 7. // Vendor prefixed var context = new webkitAudioContext();
  • 9. var oscillator = context.createOscillator(); oscillator.connect(context.destination);
  • 10. frequência duração A note, crudely speaking, is a frequency played for a certain duration.
  • 13. RETROJS Demo (RetroJS) - http://eshiota.github.io/retro-audio-js/
  • 14. Demo (RetroJS - Mario Theme)
  • 15. { "title" : "Super Mario Bros Theme", "tempo" : 200, "time_signature" : "4/4", "score" : [ { "instrument" : "oscillator-square", "volume" : 0.5, "sheet" : [ ["E5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8" , ["E5.8", "F#4.8"], "-.8" , ["C5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8", ["G5.8", "B4.8", "G4.8"], "-.8", "-.4" ["C5.8", "E4.8"], "-.4" , ["G4.8", "C4.8"], ["G4.4T3", "C4.4T3"], ["E5.4T3", "G4.4T3"], ["C5.8", "E4.8"], "-.4" , ["G4.8", "C4.8"], ["G4.4T3", "C4.4T3"], ["E5.4T3", "G4.4T3"], , "G4.8", "-.8", "-.4", "-.4" , ["E4.8", "G3.8"], "-.4" , ["A4.8", "C4.8"], "-.8", ["B.8", "D4.8"] , "-.8", ["Bb4.8", "Db4.8"], ["A4.8", "C4.8"], "-.8", ["G5.4T3", "B4.4T3"], ["A5.8", "C5.8"], "-.8", ["F5.8", "A4.8"], ["G5.8", "B4.8"], "-.8", ["E5.8", "G4.8"], "-.8", ["C5.8", "E4.8"], ["D5.8", "F4.8"], ["B4.8", "D4.8"], "-.4", "-.4" , ["E4.8", "G3.8"], "-.4" , ["A4.8", "C4.8"], "-.8", ["B.8", "D4.8"] , "-.8", ["Bb4.8", "Db4.8"], ["A4.8", "C4.8"], "-.8", ["G5.4T3", "B4.4T3"], ["A5.8", "C5.8"], "-.8", ["F5.8", "A4.8"], ["G5.8", "B4.8"], "-.8", ["E5.8", "G4.8"], "-.8", ["C5.8", "E4.8"], ["D5.8", "F4.8"], ["B4.8", "D4.8"], "-.2", ["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8", ["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8", ["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8", "-.4", ["Eb5.8", "Ab4.8"], "-.4", ["D5.8", "F4.8"], "-.4", ["C5.8", "E4.8"], "-.8", "-.4", "C5.8"], "-.8", ["G#4.8", "D4.8"], ["A4.8", "E4.8"], ["C5.8", "G4.8"], "-.8", ["A4.8", "C4.8"], ["C5.8", "E4.8"], ["D5.8", "F4.8"], "-.4", "C5.8"], "-.8", ["C6.8", "G5.8"], "-.8", ["C6.8", "G5.8"], ["C6.8", "G5.8"], "-.8", "-.4", "-.4", "C5.8"], "-.8", ["G#4.8", "D4.8"], ["A4.8", "E4.8"], ["C5.8", "G4.8"], "-.8", ["A4.8", "C4.8"], ["C5.8", "E4.8"], ["D5.8", "F4.8"], "-.2", "-.4", ["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8", ["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8", ["G5.8", "E5.8"], ["Gb5.8", "Eb5.8"], ["F5.8", "D5.8"], ["D#5.8", "B4.8"], "-.8", ["E5.8", "-.4", ["Eb5.8", "Ab4.8"], "-.4", ["D5.8", "F4.8"], "-.4", ["C5.8", "E4.8"], "-.8", "-.4", "C5.8"], "-.8", ["G#4.8", "D4.8"], ["A4.8", "E4.8"], ["C5.8", "G4.8"], "-.8", ["A4.8", "C4.8"], ["C5.8", "E4.8"], ["D5.8", "F4.8"], "-.4", "C5.8"], "-.8", ["C6.8", "G5.8"], "-.8", ["C6.8", "G5.8"], ["C6.8", "G5.8"], "-.8", "-.4", "-.4", "C5.8"], "-.8", ["G#4.8", "D4.8"], ["A4.8", "E4.8"], ["C5.8", "G4.8"], "-.8", ["A4.8", "C4.8"], ["C5.8", "E4.8"], ["D5.8", "F4.8"], "-.2", ["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], "-.8", ["G4.8", "E5.8"], ["C5.8", "E4.8"], "-.8", ["A4.8", "E4.8"], ["G4.8", "C4.8"], "-.8", "-.4", ["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], ["G4.8", "E5.8"], "-.2", "-.2", ["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], "-.8", ["G4.8", "E5.8"], ["C5.8", "E4.8"], "-.8", ["A4.8", "E4.8"], ["G4.8", "C4.8"], "-.8", "-.4", ["E5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8" , ["E5.8", "F#4.8"], "-.8" , ["C5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8", ["G5.8", "B4.8", "G4.8"], "-.8", "-.4" ["C5.8", "E4.8"], "-.4" , ["G4.8", "C4.8"], ["G4.4T3", "C4.4T3"], ["E5.4T3", "G4.4T3"], ["C5.8", "E4.8"], "-.4" , ["G4.8", "C4.8"], ["G4.4T3", "C4.4T3"], ["E5.4T3", "G4.4T3"], , "G4.8", "-.8", "-.4", "-.4" , ["E4.8", "G3.8"], "-.4" , ["A4.8", "C4.8"], "-.8", ["B.8", "D4.8"] , "-.8", ["Bb4.8", "Db4.8"], ["A4.8", "C4.8"], "-.8", ["G5.4T3", "B4.4T3"], ["A5.8", "C5.8"], "-.8", ["F5.8", "A4.8"], ["G5.8", "B4.8"], "-.8", ["E5.8", "G4.8"], "-.8", ["C5.8", "E4.8"], ["D5.8", "F4.8"], ["B4.8", "D4.8"], "-.4", "-.4" , ["E4.8", "G3.8"], "-.4" , ["A4.8", "C4.8"], "-.8", ["B.8", "D4.8"] , "-.8", ["Bb4.8", "Db4.8"], ["A4.8", "C4.8"], "-.8", ["G5.4T3", "B4.4T3"], ["A5.8", "C5.8"], "-.8", ["F5.8", "A4.8"], ["G5.8", "B4.8"], "-.8", ["E5.8", "G4.8"], "-.8", ["C5.8", "E4.8"], ["D5.8", "F4.8"], ["B4.8", "D4.8"], "-.4", ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4", ["B4.4T3", "G4.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["E5.4T3", "G5.4T3"], ["D5.4T3", "F5.4T3"], ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["A4.8", "F4.8"], ["G4.8", "E4.8"], "-.8", "-.4", ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4", ["G4.8", "B4.8"], ["D5.8", "F5.8"], "-.8", ["D5.8", "F5.8"], ["D5.4T3", "F5.4T3"], ["C5.4T3", "E5.4T3"], ["B4.4T3", "D5.4T3"], ["G4.8", "C5.8"], "E4.8", "-.8", "E4.8", "C4.8", "-.8", "-.4", ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4", ["B4.4T3", "G4.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["E5.4T3", "G5.4T3"], ["D5.4T3", "F5.4T3"], ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["A4.8", "F4.8"], ["G4.8", "E4.8"], "-.8", "-.4", ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4", ["G4.8", "B4.8"], ["D5.8", "F5.8"], "-.8", ["D5.8", "F5.8"], ["D5.4T3", "F5.4T3"], ["C5.4T3", "E5.4T3"], ["B4.4T3", "D5.4T3"], ["G4.8", "C5.8"], "E4.8", "-.8", "E4.8", "C4.8", "-.8", "-.4", ["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], "-.8", ["G4.8", "E5.8"], ["C5.8", "E4.8"], "-.8", ["A4.8", "E4.8"], ["G4.8", "C4.8"], "-.8", "-.4", ["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], ["G4.8", "E5.8"], "-.2", "-.2", ["Ab4.8", "C5.8"], ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], "-.8", ["Ab4.8", "C5.8"], ["Bb4.8", "D5.8"], "-.8", ["G4.8", "E5.8"], ["C5.8", "E4.8"], "-.8", ["A4.8", "E4.8"], ["G4.8", "C4.8"], "-.8", "-.4", ["E5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8" , ["E5.8", "F#4.8"], "-.8" , ["C5.8", "F#4.8"], ["E5.8", "F#4.8"], "-.8", ["G5.8", "B4.8", "G4.8"], "-.8", "-.4" , "G4.8", "-.8", "-.4", ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4", ["B4.4T3", "G4.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["E5.4T3", "G5.4T3"], ["D5.4T3", "F5.4T3"], ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["A4.8", "F4.8"], ["G4.8", "E4.8"], "-.8", "-.4", ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4", ["G4.8", "B4.8"], ["D5.8", "F5.8"], "-.8", ["D5.8", "F5.8"], ["D5.4T3", "F5.4T3"], ["C5.4T3", "E5.4T3"], ["B4.4T3", "D5.4T3"], ["G4.8", "C5.8"], "E4.8", "-.8", "E4.8", "C4.8", "-.8", "-.4", ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4", ["B4.4T3", "G4.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["F5.4T3", "A5.4T3"], ["E5.4T3", "G5.4T3"], ["D5.4T3", "F5.4T3"], ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["A4.8", "F4.8"], ["G4.8", "E4.8"], "-.8", "-.4", ["E5.8", "C5.8"], ["C5.8", "A4.8"], "-.8", ["G4.8", "E4.8"], "-.4", ["G#4.8", "E4.8"], "-.8", ["A4.8", "F4.8"], ["C5.8", "F5.8"], "-.8", ["C5.8", "F5.8"], ["A4.8", "F4.8"], "-.8", "-.4", ["G4.8", "B4.8"], ["D5.8", "F5.8"], "-.8", ["D5.8", "F5.8"], ["D5.4T3", "F5.4T3"], ["C5.4T3", "E5.4T3"], ["B4.4T3", "D5.4T3"], ["G4.8", "C5.8"], "E4.8", "-.8", "E4.8", "C4.8", "-.8", "-.4" ] }, { "volume" : 0.5, "instrument" : "oscillator-square", "sheet" : [ "D3.8", "D3.8", "-.8", "D3.8", "-.8", "D3.8", "D3.8", "-.8", "G3.8", "-.8", "-.4", "G3.8", "-.8", "-.4", "G3.8", "-.4", "E3.8", "-.4", "E3.4T3", "C4.4T3", "E4.4T3", "G3.8", "-.4", "E3.8", "-.4", "E3.4T3", "C4.4T3", "E4.4T3", "C3.8", "F4.8", "C3.8", "F4.8", "-.4", "-.8", "-.4", "-.8", "F3.8", "D4.8", "F3.8", "D4.8", "-.8", "G3.8", "E4.8", "-.8", "-.8", "G3.8", "E4.8", "-.8", "-.8", "Gb3.8", "F3.8", "-.8", "C4.8", "-.8", "A3.8", "B3.8", "G3.8", "-.4", "-.8", "Gb3.8", "F3.8", "-.8", "C4.8", "-.8", "A3.8", "B3.8", "G3.8", "-.4", This is the JSON representation of the Mario Bros Theme. "C3.8", "C3.8", "C3.8", "C3.8", "-.4", "-.4", "-.4", "-.8", "G3.8", "-.4", "C4.8", "-.8", "F3.8", "-.4", "C4.8", "C4.8", "-.8", "F4.8", "-.8", "E3.8", "-.4", "G3.8", "C4.8", "-.2", "-.4", "G3.8", "-.8", "G3.8", "-.4", "C4.8", "-.8", "F3.8", "-.4", "C4.8", "C4.8", "-.8", "F4.8", "-.8", "Ab3.8", "-.4", "Bb3.8", "-.4", "C4.8", "-.4", "G3.8", "G3.8", "-.8", "C3.8", "-.8",
  • 17. var context = new webkitAudioContext() , request = new XMLHttpRequest() ; request.open("get", "/drums/snare.wav"); request.responseType = "arraybuffer"; request.onload = function () { context.decodeAudioData(request.response, function (buffer) { var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.start(0); }); }; request.send();
  • 18. 1. 2. 3. 4. 5. AJAX request Decode response on request load Create buffer source Connect source to destination Play
  • 20. var context = new webkitAudioContext() , request = new XMLHttpRequest() ; request.open("get", "/drums/snare.wav"); request.responseType = "arraybuffer"; request.onload = function () { context.decodeAudioData(request.response, function (buffer) { var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.start(0); }); }; request.send();
  • 21. 2. Decode response on request load
  • 22. var context = new webkitAudioContext() , request = new XMLHttpRequest() ; request.open("get", "/drums/snare.wav"); request.responseType = "arraybuffer"; request.onload = function () { context.decodeAudioData(request.response, function (buffer) { var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.start(0); }); }; request.send();
  • 24. var context = new webkitAudioContext() , request = new XMLHttpRequest() ; request.open("get", "/drums/snare.wav"); request.responseType = "arraybuffer"; request.onload = function () { context.decodeAudioData(request.response, function (buffer) { var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.start(0); }); }; request.send();
  • 25. 4. Connect source to destination
  • 26. var context = new webkitAudioContext() , request = new XMLHttpRequest() ; request.open("get", "/drums/snare.wav"); request.responseType = "arraybuffer"; request.onload = function () { context.decodeAudioData(request.response, function (buffer) { var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.start(0); }); }; request.send();
  • 28. var context = new webkitAudioContext() , request = new XMLHttpRequest() ; request.open("get", "/drums/snare.wav"); request.responseType = "arraybuffer"; request.onload = function () { context.decodeAudioData(request.response, function (buffer) { var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.start(0); }); }; request.send();
  • 32. WEB AUDIO BAND Drum Sequencer
  • 35. play track 1 Track 1 Track 2 Track 3 Track 4
  • 37. play track 2 Track 1 Track 2 Track 3 Track 4
  • 38. Drums.soundsMap = { "snare" : "/sounds/drums/snare.wav", "kick" : "/sounds/drums/kick.wav", "tom_hi" : "/sounds/drums/tom_hi.wav", "tom_low" : "/sounds/drums/tom_low.wav", "hihat_closed" : "/sounds/drums/hihat_closed.wav", "hihat_open" : "/sounds/drums/hihat_open.wav", "trash" : "/sounds/drums/trash.wav" };
  • 39. SoundsMapLoader.loadSounds = function (audioContext) { var dfds = [] , masterDfd = $.Deferred() ; for (var key in this.soundsMap) { dfds.push(this.loadSound(audioContext, key, this.soundsMap[key])); } $.when.apply($, dfds).then(function () { masterDfd.resolve(); }); return masterDfd; };
  • 40. SoundsMapLoader.loadSound = function (audioContext, key, url) { var request = new XMLHttpRequest() , dfd = $.Deferred() ; request.open("get", url); request.responseType = "arraybuffer"; request.onload = (function () { audioContext.decodeAudioData(request.response, (function (buffer) { this.sounds[key] = buffer; dfd.resolve(); }).bind(this)); }).bind(this); request.send(); return dfd; };
  • 41. // // // // // // // Each beat (1/4 note) has 4 divisions (1/16 notes). A full cycle has 32 1/16 notes, which will be called as positions. Something like this: - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - 0 4 8 12 16 20 24 28 31 Looper.fn.cycle = function () { if (!this.playing) { return true; } this.trigger("position-change", [this.position]); this.position = this.position === this.lastPosition ? 0 : this.position + 1; setTimeout(this.cycle.bind(this), this.positionDuration); };
  • 42. 60bpm = 1bps 1bps = 4 posições p/ segundo 1000ms / 4 => positionDuration = 250ms
  • 43. Demo (Web Audio Band - Drum Sequencer)
  • 44. WEB AUDIO BAND Synth Sequencer
  • 47. Demo (Web Audio Band - Synth Sequencer)
  • 48. WEB AUDIO BAND Bass Sequencer
  • 49.
  • 51. [Tue Nov $ ls -w A0.mp3 A1.mp3 A2.mp3 A3.mp3 A4.mp3 A5.mp3 A6.mp3 19 01:42 ~/Sites/petprojects/webaudio_band/public/sounds/bass] (master) [aws:personal] A7.mp3 Ab1.mp3 Ab2.mp3 Ab3.mp3 Ab4.mp3 Ab5.mp3 Ab6.mp3 Ab7.mp3 B0.mp3 B1.mp3 B2.mp3 B3.mp3 B4.mp3 B5.mp3 B6.mp3 B7.mp3 Bb0.mp3 Bb1.mp3 Bb2.mp3 Bb3.mp3 Bb4.mp3 Bb5.mp3 Bb6.mp3 Bb7.mp3 C1.mp3 C2.mp3 C3.mp3 C4.mp3 C5.mp3 C6.mp3 C7.mp3 C8.mp3 D1.mp3 D2.mp3 D3.mp3 D4.mp3 D5.mp3 D6.mp3 D7.mp3 Db1.mp3 Db2.mp3 Db3.mp3 Db4.mp3 Db5.mp3 Db6.mp3 Db7.mp3 E1.mp3 E2.mp3 E3.mp3 E4.mp3 E5.mp3 E6.mp3 E7.mp3 Eb1.mp3 Eb2.mp3 Eb3.mp3 Eb4.mp3 Eb5.mp3 Eb6.mp3 Eb7.mp3 F1.mp3 F2.mp3 F3.mp3 F4.mp3 F5.mp3 F6.mp3 F7.mp3 G1.mp3 G2.mp3 G3.mp3 G4.mp3 G5.mp3 G6.mp3 G7.mp3 Gb1.mp3 Gb2.mp3 Gb3.mp3 Gb4.mp3 Gb5.mp3 Gb6.mp3 Gb7.mp3
  • 52. Demo (Web Audio Band - Bass Sequencer)
  • 54.
  • 55.
  • 56.
  • 61. Demo (Web Audio Band - Remote Instruments)
  • 62. Por quê? Why did I develop this projet?
  • 63. Eu amo música. I love music.
  • 65. Aprimorei conceitos de arquitetura. I improved my architecture concepts.
  • 66. Aprendi e conheci mais sobre: I learned and got to know more about:
  • 68. E pra provar que esses caras estão errados: And did it to prove that these guys are wrong:
  • 69.
  • 70. The Web is not dead. Long live the Web.
  • 71. And I finish this talk with a picture of my cats Jamie and Lexie. <3