Submit Search
Upload
Web Audio APIとNode.jsでウェブ楽器作った ~ Beatonicaの紹介 ~
•
12 likes
•
3,149 views
aike
Follow
Sapporo.js-2012.05.05発表資料
Read less
Read more
Technology
Report
Share
Report
Share
1 of 36
Download now
Download to read offline
Recommended
Web Audio APIで作る各種ウェブ楽器
Web Audio APIで作る各種ウェブ楽器
aike
Web Audio APIでシンセサイザーの作成
Web Audio APIでシンセサイザーの作成
aike
Oscillatorで楽器を作りたい!
Oscillatorで楽器を作りたい!
Hisashi Oikawa
WebブラウザでP2Pを実現する、WebRTCのAPIと周辺技術
WebブラウザでP2Pを実現する、WebRTCのAPIと周辺技術
Yoshiaki Sugimoto
Web Audio API, Web MIDI API - 2015 html5 conference
Web Audio API, Web MIDI API - 2015 html5 conference
Ryoya Kawai
Practical Web Audio API Programming
Practical Web Audio API Programming
aike
WebInstruments My Works
WebInstruments My Works
aike
自作ウェブ楽器の紹介
自作ウェブ楽器の紹介
aike
Recommended
Web Audio APIで作る各種ウェブ楽器
Web Audio APIで作る各種ウェブ楽器
aike
Web Audio APIでシンセサイザーの作成
Web Audio APIでシンセサイザーの作成
aike
Oscillatorで楽器を作りたい!
Oscillatorで楽器を作りたい!
Hisashi Oikawa
WebブラウザでP2Pを実現する、WebRTCのAPIと周辺技術
WebブラウザでP2Pを実現する、WebRTCのAPIと周辺技術
Yoshiaki Sugimoto
Web Audio API, Web MIDI API - 2015 html5 conference
Web Audio API, Web MIDI API - 2015 html5 conference
Ryoya Kawai
Practical Web Audio API Programming
Practical Web Audio API Programming
aike
WebInstruments My Works
WebInstruments My Works
aike
自作ウェブ楽器の紹介
自作ウェブ楽器の紹介
aike
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Web Audio APIとNode.jsでウェブ楽器作った ~ Beatonicaの紹介 ~
1.
Web Audio APIと Node.jsでウェブ楽器作った
〜 Beatonicaの紹介 〜 藍 圭介 http://d.hatena.ne.jp/aike @aike1000
2.
ウェブ楽器? CC-BY-NC-SA http://www.flickr.com/photos/mediawench/2037762495/ CC-
BY- NC- SA http://www.flickr.com/photos/mediawench/2037762495/
3.
Beatonica http://beatonica.com/
4.
一部で話題
5.
クリックすると
音が出る ※写真はイメージです http://www.etsy.com/shop/thepusspuss http://www.etsy.com/shop/thepusspuss
6.
自動でどんどん 音楽生成 CC-BY-NC-SA http://www.flickr.com/photos/michaelz1/4414898915/ CC- BY-
NC- SA
7.
ソーシャルグラフ の多様性を 音として鳴らす CC-BY-NC-SA http://www.flickr.com/photos/koesteran/5185861058/
CC- BY- NC- SA http://www.flickr.com/photos/koesteran/5185861058/
8.
クラシック版 ロック版
9.
Web Audio API
CC-BY http://www.flickr.com/photos/nkashirin/5325053378/ CC- BY http://www.flickr.com/photos/nkashirin/5325053378/
10.
ウェブブラウザ ネイティブの サウンドAPI
11.
と、いうことは
12.
プラグイン不要 No Flash No Java
Applet
13.
Yes JavaScript
CC-BY-ND http://www.flickr.com/photos/joecrimmings/2238699461/ CC- BY- ND http://www.flickr.com/photos/joecrimmings/2238699461/
14.
サーバ側は どうしよう?
15.
そうだ、あれが あるじゃないか
16.
Node.js
17.
Yes JavaScript CC-BY-ND http://www.flickr.com/photos/joecrimmings/2238699461/
CC- BY- ND http://www.flickr.com/photos/joecrimmings/2238699461/
18.
全部 JavaScript
19.
処理の ほとんどは クライアント側
20.
ソース 読み放題
21.
Web Audio API
CC-BY http://www.flickr.com/photos/nkashirin/5325053378/ CC- BY http://www.flickr.com/photos/nkashirin/5325053378/
22.
音の加工機能 が充実
23.
ノードによる 部品化 ボリューム、パン、ミキサー
その他エフェクター
24.
機器をケーブルで 接続するように
コーディング
25.
ボリューム→ディレイ→出⼒の例 // コンテキスト作成
var ctx = new webkitAudioContext(); // ボリュームノード作成 var volume = ctx.createGainNode(); // ディレイノード作成 var delay = ctx.createDelayNode(); // ノード同士を接続 volume.connect(delay); delay.connect(ctx.destination);
26.
まだちょっと いまいちな 所もある
27.
MP3ファイルを 非同期でロード して鳴らす処理
28.
こうですか!?わかりません>< SampleBuffer.prototype.loadBuffer =
Player.prototype.playSound = function(callback) { function(buffer) { var request = new XMLHttpRequest(); this.src = this.context.createBufferSource(); request.open("GET", this.url, true); this.src.buffer = buffer; request.responseType = "arraybuffer"; this.src.connect(this.context.destination); var self = this; this.src.noteOn(0); request.onload = function() { }; self.context.decodeAudioData( request.response, function(buffer) { ↑MP3再生 if (!buffer) { console.log('error: ' + self.url); なぜか音を鳴らすたびにcreateBufferSourceで return; バッファ作成する必要がある } self.buffer = buffer; if (callback) { callback(self.buffer.getChannelData(0)); }, } なぜかあまりシンプルに書けない function() { console.log('error: ' + self.url); return; もっと効率の良い⽅法があれば ); } 教えてください! } request.onerror = function() { alert('BufferLoader: XHR error'); } ←MP3ファイルロード request.send(); XHR処理を⾃前で書く必要があり } エラー対応も⼊れるとけっこう⻑くなる
29.
Node.js 簡単
30.
モジュール充実 express
webフレームワーク ejs テンプレートエンジン everyauth OAuth認証等 twit Twitter API
31.
サーバ側コード シンプル
約550⾏
32.
Node.js 難しい
33.
モジュール⾼度すぎ ほとんど⿊魔術 トラブル時に原因究明が大変
CC-BY http://www.flickr.com/photos/andersbachmann/5934075365/ CC- BY http://www.flickr.com/photos/andersbachmann/5934075365/
34.
Node.js難しい ・不親切なエラーメッセージ ・404ページ出すの大変 (expressのapp.useが⾒つけにくかった) ・追いづらいライブラリ処理
// イベントドリブン+メソッドチェーン+無名関数引数 foo(function() { 処理 }) .bar(function() { 処理 }) .hoge(function() { ・・・続く
35.
36.
JavaScriptが サウンドプログラミングの 主役になる日は近い CC-BY-ND http://www.flickr.com/photos/joecrimmings/2238699461/
CC- BY- ND http://www.flickr.com/photos/joecrimmings/2238699461/
Download now