SlideShare a Scribd company logo
1 of 9
Download to read offline
Web MIDI API 
- API updates at Chrome 39 - 
Takashi Toyoshima <toyoshim@chromium.org>
Implementation Status 
Chrome 37 (stable) 
supports Web MIDI behind a flag* on all platforms 
(Windows, OS X, Linux, Chrome OS, Android) 
Note: Chrome OS 37 and 38 has a problem on udev that 
does not provide a right permission for /dev/snd/seq. We 
will fix 38. 
(*) chrome://flags/#enable-web-midi
API update at Chrome 39 
❏ Chrome implemented old API 
❏ 
❏ Chrome 39 implements the latest API 
❏ http://webaudio.github.io/web-midi-api/ 
It contains an important API change that breaks 
compatibility on MIDIAccess.inputs and MIDIAccess. 
outputs.
MIDIAccess 
❏ inputs and outputs were functions that returned an Array 
interface MIDIAccess : EventTarget { 
sequence<MIDIInput> inputs (); 
sequence<MIDIOutput> outputs (); 
readonly attribute boolean sysexEnabled; 
}; 
❏ inputs and outputs are attributes of MIDIInputMap and MIDIOutputMap 
interface MIDIAccess : EventTarget { 
readonly attribute MIDIInputMap inputs; 
readonly attribute MIDIOutputMap outputs; 
readonly attribute boolean sysexEnabled; 
};
JavaScript code examples 
/* Old version */ 
var inputs = access.inputs(); 
for (var i = 0; i < inputs.length; ++i) { 
if (inputs[i].name == “nice controller”) 
…… 
} 
/* New version with ES Harmony syntax from Chrome 38*/ 
for (var input of access.inputs.values()) { 
// Caveat: iteration order is not guaranteed for now 
if (input.name == “great controller”) 
…… 
}
MIDI{Input,Output}Map 
❏ Map like object (Map is a collection that is introduced in ECMAScript 6) 
interface { 
readonly attribute unsigned long size; 
MIDIKeyIterator keys (); // iterator for MIDIPort.id 
MIDIEntryIterator entries (); // iterator for [MIDIPort.id, MIDI{Input,Output}] 
MIDIValueIterator values (); // iterator for MIDI{Input,Output} 
MIDI{Input,Output} get (DOMString id); 
boolean has (DOMString key /* id */); 
void forEach (ForEachCallback callback); // not implemented yet 
};
Transitional code for 37-39 
var inputs = []; 
if (typeof midiAccess.inputs === "function") { 
// For OLD API used until Chrome 38 
inputs = midiAccess.inputs(); 
} else { 
// For 39 or later (Use next() since Chrome 37 can not parse ‘for...of’) 
var it = midiAccess.inputs.values(); 
for (var o = it.next(); !o.done; o = it.next()) 
inputs.push(o.value); 
} 
for (var i = 0; i < inputs.length; i++) 
console.log("MIDI interface: " + list[i].name);
MIDIConnectionEvent 
Not implemented yet, but we will introduce it 
from Chrome 39, step by step.
Stay tuned!

More Related Content

Viewers also liked

140913_WebMusicHackathon_WMDC
140913_WebMusicHackathon_WMDC140913_WebMusicHackathon_WMDC
140913_WebMusicHackathon_WMDCYukio TADA
 
第2回html5jゲーム部勉強会 Oh! JavaScript 夢の続きを語ろうよ〜emscriptenの逆襲 - html5編
第2回html5jゲーム部勉強会   Oh! JavaScript 夢の続きを語ろうよ〜emscriptenの逆襲 - html5編第2回html5jゲーム部勉強会   Oh! JavaScript 夢の続きを語ろうよ〜emscriptenの逆襲 - html5編
第2回html5jゲーム部勉強会 Oh! JavaScript 夢の続きを語ろうよ〜emscriptenの逆襲 - html5編Takashi Toyoshima
 
Web Audio API, Web MIDI API - 2015 html5 conference
Web Audio API, Web MIDI API - 2015 html5 conferenceWeb Audio API, Web MIDI API - 2015 html5 conference
Web Audio API, Web MIDI API - 2015 html5 conferenceRyoya Kawai
 
Chrome Packaged Apps
Chrome Packaged AppsChrome Packaged Apps
Chrome Packaged AppsRyoya Kawai
 
VSTiつくるよゼミ
VSTiつくるよゼミVSTiつくるよゼミ
VSTiつくるよゼミy3eadgbe
 

Viewers also liked (6)

140913_WebMusicHackathon_WMDC
140913_WebMusicHackathon_WMDC140913_WebMusicHackathon_WMDC
140913_WebMusicHackathon_WMDC
 
第2回html5jゲーム部勉強会 Oh! JavaScript 夢の続きを語ろうよ〜emscriptenの逆襲 - html5編
第2回html5jゲーム部勉強会   Oh! JavaScript 夢の続きを語ろうよ〜emscriptenの逆襲 - html5編第2回html5jゲーム部勉強会   Oh! JavaScript 夢の続きを語ろうよ〜emscriptenの逆襲 - html5編
第2回html5jゲーム部勉強会 Oh! JavaScript 夢の続きを語ろうよ〜emscriptenの逆襲 - html5編
 
Web Audio API, Web MIDI API - 2015 html5 conference
Web Audio API, Web MIDI API - 2015 html5 conferenceWeb Audio API, Web MIDI API - 2015 html5 conference
Web Audio API, Web MIDI API - 2015 html5 conference
 
Chrome Packaged Apps
Chrome Packaged AppsChrome Packaged Apps
Chrome Packaged Apps
 
VSTiつくるよゼミ
VSTiつくるよゼミVSTiつくるよゼミ
VSTiつくるよゼミ
 
USB MIDI - DMX bridge
USB MIDI - DMX bridgeUSB MIDI - DMX bridge
USB MIDI - DMX bridge
 

Similar to Web MIDI API updates in Chrome 39

Programming smart contracts in solidity
Programming smart contracts in solidityProgramming smart contracts in solidity
Programming smart contracts in solidityEmanuel Mota
 
WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms philn2
 
WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...
WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...
WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...Igalia
 
[WELC] 21. I’m Changing the Same Code All Over the Place
[WELC] 21. I’m Changing the Same Code All Over the Place[WELC] 21. I’m Changing the Same Code All Over the Place
[WELC] 21. I’m Changing the Same Code All Over the Place종빈 오
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14Matthieu Garrigues
 
JVM code reading -- C2
JVM code reading -- C2JVM code reading -- C2
JVM code reading -- C2ytoshima
 
Engineering Efficiency in LINE
Engineering Efficiency in LINEEngineering Efficiency in LINE
Engineering Efficiency in LINEHuy Do
 
Production Time Profiling and Diagnostics on the JVM
Production Time Profiling and Diagnostics on the JVMProduction Time Profiling and Diagnostics on the JVM
Production Time Profiling and Diagnostics on the JVMMarcus Hirt
 
session6-Network Programming.pptx
session6-Network Programming.pptxsession6-Network Programming.pptx
session6-Network Programming.pptxSrinivasanG52
 
Parallel Futures of a Game Engine
Parallel Futures of a Game EngineParallel Futures of a Game Engine
Parallel Futures of a Game EngineJohan Andersson
 
Lec 47.48 - stream-files
Lec 47.48 - stream-filesLec 47.48 - stream-files
Lec 47.48 - stream-filesPrincess Sam
 
programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++Haripritha
 
Effective C++/WinRT for UWP and Win32
Effective C++/WinRT for UWP and Win32Effective C++/WinRT for UWP and Win32
Effective C++/WinRT for UWP and Win32Windows Developer
 

Similar to Web MIDI API updates in Chrome 39 (20)

Programming smart contracts in solidity
Programming smart contracts in solidityProgramming smart contracts in solidity
Programming smart contracts in solidity
 
I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 
WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms
 
WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...
WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...
WebKit, HTML5 media and GStreamer on multiple platforms (GStreamer Conference...
 
Hidden Dragons of CGO
Hidden Dragons of CGOHidden Dragons of CGO
Hidden Dragons of CGO
 
[WELC] 21. I’m Changing the Same Code All Over the Place
[WELC] 21. I’m Changing the Same Code All Over the Place[WELC] 21. I’m Changing the Same Code All Over the Place
[WELC] 21. I’m Changing the Same Code All Over the Place
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14
 
JVM code reading -- C2
JVM code reading -- C2JVM code reading -- C2
JVM code reading -- C2
 
C++ via C#
C++ via C#C++ via C#
C++ via C#
 
Engineering Efficiency in LINE
Engineering Efficiency in LINEEngineering Efficiency in LINE
Engineering Efficiency in LINE
 
Production Time Profiling and Diagnostics on the JVM
Production Time Profiling and Diagnostics on the JVMProduction Time Profiling and Diagnostics on the JVM
Production Time Profiling and Diagnostics on the JVM
 
session6-Network Programming.pptx
session6-Network Programming.pptxsession6-Network Programming.pptx
session6-Network Programming.pptx
 
Parallel Futures of a Game Engine
Parallel Futures of a Game EngineParallel Futures of a Game Engine
Parallel Futures of a Game Engine
 
Pemrograman Jaringan
Pemrograman JaringanPemrograman Jaringan
Pemrograman Jaringan
 
Intro to Cuda
Intro to CudaIntro to Cuda
Intro to Cuda
 
Lec 47.48 - stream-files
Lec 47.48 - stream-filesLec 47.48 - stream-files
Lec 47.48 - stream-files
 
20151224-games
20151224-games20151224-games
20151224-games
 
programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++
 
Cgi
CgiCgi
Cgi
 
Effective C++/WinRT for UWP and Win32
Effective C++/WinRT for UWP and Win32Effective C++/WinRT for UWP and Win32
Effective C++/WinRT for UWP and Win32
 

More from Takashi Toyoshima

z-music.js - AudioProcessorNode can do it
z-music.js - AudioProcessorNode can do itz-music.js - AudioProcessorNode can do it
z-music.js - AudioProcessorNode can do itTakashi Toyoshima
 
Oh! java script 夢の続きを語ろうよ〜emscriptenの逆襲
Oh! java script 夢の続きを語ろうよ〜emscriptenの逆襲Oh! java script 夢の続きを語ろうよ〜emscriptenの逆襲
Oh! java script 夢の続きを語ろうよ〜emscriptenの逆襲Takashi Toyoshima
 
Audio Context+ at WebAudio.tokyo #1
Audio Context+ at WebAudio.tokyo #1Audio Context+ at WebAudio.tokyo #1
Audio Context+ at WebAudio.tokyo #1Takashi Toyoshima
 
子供と使う便利ツール
子供と使う便利ツール子供と使う便利ツール
子供と使う便利ツールTakashi Toyoshima
 

More from Takashi Toyoshima (6)

楽しいロリコン
楽しいロリコン楽しいロリコン
楽しいロリコン
 
z-music.js - AudioProcessorNode can do it
z-music.js - AudioProcessorNode can do itz-music.js - AudioProcessorNode can do it
z-music.js - AudioProcessorNode can do it
 
Oh! java script 夢の続きを語ろうよ〜emscriptenの逆襲
Oh! java script 夢の続きを語ろうよ〜emscriptenの逆襲Oh! java script 夢の続きを語ろうよ〜emscriptenの逆襲
Oh! java script 夢の続きを語ろうよ〜emscriptenの逆襲
 
Audio Context+ at WebAudio.tokyo #1
Audio Context+ at WebAudio.tokyo #1Audio Context+ at WebAudio.tokyo #1
Audio Context+ at WebAudio.tokyo #1
 
Web &amp; sound
Web &amp; soundWeb &amp; sound
Web &amp; sound
 
子供と使う便利ツール
子供と使う便利ツール子供と使う便利ツール
子供と使う便利ツール
 

Recently uploaded

VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneVIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneCall girls in Ahmedabad High profile
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneCall girls in Ahmedabad High profile
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Deliverybabeytanya
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 

Recently uploaded (20)

VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneVIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 

Web MIDI API updates in Chrome 39

  • 1. Web MIDI API - API updates at Chrome 39 - Takashi Toyoshima <toyoshim@chromium.org>
  • 2. Implementation Status Chrome 37 (stable) supports Web MIDI behind a flag* on all platforms (Windows, OS X, Linux, Chrome OS, Android) Note: Chrome OS 37 and 38 has a problem on udev that does not provide a right permission for /dev/snd/seq. We will fix 38. (*) chrome://flags/#enable-web-midi
  • 3. API update at Chrome 39 ❏ Chrome implemented old API ❏ ❏ Chrome 39 implements the latest API ❏ http://webaudio.github.io/web-midi-api/ It contains an important API change that breaks compatibility on MIDIAccess.inputs and MIDIAccess. outputs.
  • 4. MIDIAccess ❏ inputs and outputs were functions that returned an Array interface MIDIAccess : EventTarget { sequence<MIDIInput> inputs (); sequence<MIDIOutput> outputs (); readonly attribute boolean sysexEnabled; }; ❏ inputs and outputs are attributes of MIDIInputMap and MIDIOutputMap interface MIDIAccess : EventTarget { readonly attribute MIDIInputMap inputs; readonly attribute MIDIOutputMap outputs; readonly attribute boolean sysexEnabled; };
  • 5. JavaScript code examples /* Old version */ var inputs = access.inputs(); for (var i = 0; i < inputs.length; ++i) { if (inputs[i].name == “nice controller”) …… } /* New version with ES Harmony syntax from Chrome 38*/ for (var input of access.inputs.values()) { // Caveat: iteration order is not guaranteed for now if (input.name == “great controller”) …… }
  • 6. MIDI{Input,Output}Map ❏ Map like object (Map is a collection that is introduced in ECMAScript 6) interface { readonly attribute unsigned long size; MIDIKeyIterator keys (); // iterator for MIDIPort.id MIDIEntryIterator entries (); // iterator for [MIDIPort.id, MIDI{Input,Output}] MIDIValueIterator values (); // iterator for MIDI{Input,Output} MIDI{Input,Output} get (DOMString id); boolean has (DOMString key /* id */); void forEach (ForEachCallback callback); // not implemented yet };
  • 7. Transitional code for 37-39 var inputs = []; if (typeof midiAccess.inputs === "function") { // For OLD API used until Chrome 38 inputs = midiAccess.inputs(); } else { // For 39 or later (Use next() since Chrome 37 can not parse ‘for...of’) var it = midiAccess.inputs.values(); for (var o = it.next(); !o.done; o = it.next()) inputs.push(o.value); } for (var i = 0; i < inputs.length; i++) console.log("MIDI interface: " + list[i].name);
  • 8. MIDIConnectionEvent Not implemented yet, but we will introduce it from Chrome 39, step by step.