SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
Music is the Soul 
The Web is the Platform 
@sydlawrence 
@wemakeawesomesh
DISCLAIMER 
There are no GIFs 
@sydlawrence 
@wemakeawesomesh
DISCLAIMER 
There are no GIFs 
@sydlawrence 
@wemakeawesomesh
Audio Playback 
Audio Metadata 
Audio Analysis 
Audio Filters 
Audio Synthesis 
Web MIDI 
@sydlawrence 
@wemakeawesomesh
Audio Playback 
We are literally swimming in music 
@sydlawrence 
@wemakeawesomesh
Alright, not literally
Simple MP3 Playback 
@sydlawrence 
@wemakeawesomesh 
var audio = new Audio(); 
audio.src = 'mysong.mp3'; 
audio.play();
Soundcloud Playback 
SC.stream('/tracks/6049255', function(sound){ 
@sydlawrence 
@wemakeawesomesh 
sound.play(); 
}); 
https://developers.soundcloud.com/
rdio Playback 
var player = document.getElementById('rdio'); 
player.rdio_play('http://rd.io/x/QUxMDDdzOP0/'); 
@sydlawrence 
@wemakeawesomesh 
http://www.rdio.com/developers/
Deezer Playback 
@sydlawrence 
@wemakeawesomesh 
http://developers.deezer.com/ 
DZ.player.playTracks([82230030]);
Spotify Playback 
@sydlawrence 
@wemakeawesomesh 
https://developer.spotify.com/ 
Computer says no 
Emeddable widget only
Toma.hk Playback 
@sydlawrence 
http://toma.hk/api.html 
var track = window.tomahkAPI.Track( 
'Never Gonna Give You Up','Rick Astley', 
{ 
@wemakeawesomesh 
disabledResolvers: ['spotify'] 
} 
); 
$('body').append(track.render()); 
track.play();
Audio Metadata 
“Get me all the songs by Rick Astley” 
@sydlawrence 
@wemakeawesomesh
the echonest 
http://developer.echonest.com/api/v4/artist/songs 
?api_key=<YOUR_API_KEY> 
&name=rick+astley 
&format=jsonp 
&callback=JSONP_CALLBACK 
@sydlawrence 
@wemakeawesomesh 
http://developer.echonest.com/
Music Graph 
http://api.musicgraph.com/api/v2/artist/e41999c6-a6b5-11e0-b446-00251188dd67/tracks 
?api_key=<YOUR_API_KEY> 
@sydlawrence 
@wemakeawesomesh 
https://developer.musicgraph.com/
https://cXXXXXXX.web.cddbp.net/webapi/xml/1.0/ 
! 
<QUERIES> 
<LANG>eng</LANG> 
<AUTH> 
<CLIENT>XXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</CLIENT> 
<USER>XXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</USER> 
</AUTH> 
<QUERY CMD="ALBUM_SEARCH"> 
<TEXT TYPE=“ARTIST">rick astley</TEXT> 
</QUERY> 
</QUERIES> 
gracenote 
@sydlawrence 
@wemakeawesomesh 
https://developer.gracenote.com/
gracenote 
SUPER 
SIMPLE* 
*sarcasm 
@sydlawrence 
@wemakeawesomesh
@sydlawrence 
@wemakeawesomesh 
Audio Analysis 
When just simply playing 
music isn’t enough
AudioContext 
@sydlawrence 
@wemakeawesomesh 
AudioContext 
Source ? Destination
AudioContext Buffer 
var audioBuffer = null; 
window.AudioContext = window.AudioContext || window.webkitAudioContext; 
var context = new AudioContext(); 
! 
var request = new XMLHttpRequest(); 
request.open('GET', 'mysound.mp3', true); 
request.responseType = 'arraybuffer'; 
! 
request.onload = function() { 
context.decodeAudioData(request.response, function(buffer) { 
@sydlawrence 
@wemakeawesomesh 
audioBuffer = buffer; 
}, onError); 
}; 
request.send();
AudioContext Playback 
@sydlawrence 
// creates a sound source 
var source = context.createBufferSource(); 
! 
// tell the source which sound to play 
source.buffer = audioBuffer; 
! 
// connect the source to the context's destination 
source.connect(context.destination); 
source.start(0); 
@wemakeawesomesh
@sydlawrence 
@wemakeawesomesh 
FFT 
A fast Fourier transform (FFT) is an efficient algorithm to compute the 
discrete Fourier transform (DFT) of an input vector. Efficient means 
that the FFT computes the DFT of an n-element vector in O(nlog n) 
operations in contrast to the O(n2) operations required for computing 
the DFT by definition.
@sydlawrence 
@wemakeawesomesh 
FFT
FFT 
SUPER 
SIMPLE* 
*sarcasm 
@sydlawrence 
@wemakeawesomesh
FFT 
@sydlawrence 
@wemakeawesomesh
@sydlawrence 
@wemakeawesomesh
@sydlawrence 
@wemakeawesomesh 
dancer.js 
var dancer = new Dancer(); 
! 
dancer.load(audio); 
! 
dancer.bind( 'update', function() { 
var magnitude = this.getFrequency(startF, endF); 
}); 
http://jsantell.github.io/dancer.js/
@sydlawrence 
Here’s something 
I made earlier 
@wemakeawesomesh 
wmas.it/musicviz/ripple/
@sydlawrence 
@wemakeawesomesh 
Audio Filters 
Let’s pretend we are super star DJS
Setup the audio node 
@sydlawrence 
var audioContext = new webkitAudioContext; 
! 
var gainNode = audioContext.createGain(); 
! 
gainNode.connect(audioContext.destination); 
@wemakeawesomesh
@sydlawrence 
@wemakeawesomesh 
Set up the filter 
// create the filter 
var lowPassFilter = audioContext.createBiquadFilter(); 
lowPassFilter.frequency.value = frequency; 
! 
// create the wave shaper 
var waveShaper = audioContext.createWaveShaper(); 
! 
// connect the bits together 
var waveShaper.connect(lowPassFilter); 
lowPassFilter.connect(audioContext.destination); 
! 
// create the curve array and set it to the shaper 
var wsCurve = new Float32Array(22050); 
// .. add floats to the curve 
waveShaper.curve = wsCurve;
Add the filter to the audio 
gainNode.connect(lowPassFilter); 
@sydlawrence 
@wemakeawesomesh
Audio Filters 
SUPER 
SIMPLE* 
*sarcasm 
@sydlawrence 
@wemakeawesomesh
@sydlawrence 
Here’s something 
I made earlier* 
@wemakeawesomesh 
wmas.it/vineboard 
! 
! 
*I didn’t make it, 
@skattyadz & @robhampson did
@sydlawrence 
@wemakeawesomesh 
Audio Synthesis 
Now we can pretend 
we are musicians
@sydlawrence 
@wemakeawesomesh 
Tone Synthesis 
var context = new webkitAudioContext(), 
oscillator = context.createOscillator(); 
! 
oscillator.type = 0; // sine wave 
oscillator.frequency.value = 2000; 
oscillator.connect(context.destination); 
oscillator.noteOn && oscillator.noteOn(0);
@sydlawrence 
@wemakeawesomesh 
Tone Synthesis 
http://codepen.io/sydlawrence/pen/lruEy
@sydlawrence 
Here’s something 
I made earlier* 
@wemakeawesomesh 
somakeit.github.io/potzy 
! 
! 
*I didn’t make it, 
@Benjie & @MichDdev did
@sydlawrence 
@wemakeawesomesh 
Web MIDI 
Let’s use instruments with the web
@sydlawrence 
@wemakeawesomesh 
What is MIDI? 
! 
MIDI is just a messaging protocol 
You can send MIDI messages and receive MIDI messages 
They consist of channel, key and velocity
@sydlawrence 
It is experimental! 
Behind a flag in chrome 
OR Install a browser plugin 
http://jazz-soft.net/doc/Jazz-Plugin/ 
@wemakeawesomesh
navigator.requestMIDIAccess().then(success,error); 
! 
var success = function(midi) { 
inputs = midi.inputs(); 
outputs = midi.outputs(); 
}; 
! 
var error = function() { 
console.log('oops'); 
}; 
@sydlawrence 
Request MIDI Access 
@wemakeawesomesh
input.onmidimessage = function(e) { 
var message = e.data; // [ channel, key, velocity ] 
}; 
! 
output.send( [ channel, key, velocity ] ); 
@sydlawrence 
Send & Receive MIDI 
@wemakeawesomesh
Web MIDI 
SUPER 
SIMPLE* 
*NO SARCASM!!!!! 
@sydlawrence 
@wemakeawesomesh
@sydlawrence 
Here’s something 
I made earlier 
@wemakeawesomesh 
wmas.it/midi
Thank you for listening 
@sydlawrence 
@wemakeawesomesh

Contenu connexe

Similaire à Music is the Soul - The Web is the Platform FOWA London 2014

Ig2 task 1_work_sheet
Ig2 task 1_work_sheetIg2 task 1_work_sheet
Ig2 task 1_work_sheet
Fryers
 

Similaire à Music is the Soul - The Web is the Platform FOWA London 2014 (20)

What Shazam doesn't want you to know
What Shazam doesn't want you to knowWhat Shazam doesn't want you to know
What Shazam doesn't want you to know
 
KKBOX WWDC17 Airplay 2 - Dolphin
KKBOX WWDC17 Airplay 2 - DolphinKKBOX WWDC17 Airplay 2 - Dolphin
KKBOX WWDC17 Airplay 2 - Dolphin
 
Core audio
Core audioCore audio
Core audio
 
Experiential Audio
Experiential AudioExperiential Audio
Experiential Audio
 
Kayac Lightning-Talk | Interaction Design with Web Audio API
Kayac Lightning-Talk | Interaction Design with Web Audio APIKayac Lightning-Talk | Interaction Design with Web Audio API
Kayac Lightning-Talk | Interaction Design with Web Audio API
 
How To Do A Podcast - Bsides RI 2013
How To Do A Podcast - Bsides RI 2013How To Do A Podcast - Bsides RI 2013
How To Do A Podcast - Bsides RI 2013
 
JavaOne 2010, Rock Star winning presentation on Fugue and Log4JFugue
JavaOne 2010, Rock Star winning presentation on Fugue and Log4JFugueJavaOne 2010, Rock Star winning presentation on Fugue and Log4JFugue
JavaOne 2010, Rock Star winning presentation on Fugue and Log4JFugue
 
Ig2 task 1_work_sheet
Ig2 task 1_work_sheetIg2 task 1_work_sheet
Ig2 task 1_work_sheet
 
Deep dive into Android’s audio latency problem
Deep dive into Android’s audio latency problemDeep dive into Android’s audio latency problem
Deep dive into Android’s audio latency problem
 
Building Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngineBuilding Modern Audio Apps with AVAudioEngine
Building Modern Audio Apps with AVAudioEngine
 
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)
Video Killed the Rolex Star (CocoaConf San Jose, November, 2015)
 
Audio Production
Audio ProductionAudio Production
Audio Production
 
Sound recording glossary improved 3
Sound recording glossary improved 3Sound recording glossary improved 3
Sound recording glossary improved 3
 
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
 
Ig2 task 1 work sheet
Ig2 task 1 work sheetIg2 task 1 work sheet
Ig2 task 1 work sheet
 
Music With Pharo
Music With PharoMusic With Pharo
Music With Pharo
 
Web &amp; sound
Web &amp; soundWeb &amp; sound
Web &amp; sound
 
I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
 
Let's Make Some Noise with Web Audio API
Let's Make Some Noise with Web Audio APILet's Make Some Noise with Web Audio API
Let's Make Some Noise with Web Audio API
 
I've got key to your API, now what?
I've got key to your API, now what?I've got key to your API, now what?
I've got key to your API, now what?
 

Plus de Syd Lawrence

Mobile Web App Development (Becoming native)
Mobile Web App Development (Becoming native)Mobile Web App Development (Becoming native)
Mobile Web App Development (Becoming native)
Syd Lawrence
 

Plus de Syd Lawrence (10)

High Performance PhoneGap Apps
High Performance PhoneGap AppsHigh Performance PhoneGap Apps
High Performance PhoneGap Apps
 
Mobile Apps with Web Tech
Mobile Apps with Web TechMobile Apps with Web Tech
Mobile Apps with Web Tech
 
It's the start of the web revolution, but it's not what you think
It's the start of the web revolution, but it's not what you thinkIt's the start of the web revolution, but it's not what you think
It's the start of the web revolution, but it's not what you think
 
Rewriting The History Books
Rewriting The History BooksRewriting The History Books
Rewriting The History Books
 
Mobile Web App Development (Becoming native)
Mobile Web App Development (Becoming native)Mobile Web App Development (Becoming native)
Mobile Web App Development (Becoming native)
 
Mobile Web App Development (Building your API)
Mobile Web App Development (Building your API)Mobile Web App Development (Building your API)
Mobile Web App Development (Building your API)
 
Mobile web app development
Mobile web app developmentMobile web app development
Mobile web app development
 
Javascript Development
Javascript DevelopmentJavascript Development
Javascript Development
 
Introduction to javascript
Introduction to javascriptIntroduction to javascript
Introduction to javascript
 
Making AJAX User Friendly, Google Friendly, Friendly Friendly using the Histo...
Making AJAX User Friendly, Google Friendly, Friendly Friendly using the Histo...Making AJAX User Friendly, Google Friendly, Friendly Friendly using the Histo...
Making AJAX User Friendly, Google Friendly, Friendly Friendly using the Histo...
 

Dernier

Dernier (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

Music is the Soul - The Web is the Platform FOWA London 2014