SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
jsbpm
onset detection in the Browser
Janessa Det - WEB eng @TWITTERNYC
hello.
bpmjs
janessa det (@jandet)
twitter nyc
Software engineer
Web Team
columbia university
M.S. Computer science
Graphics & Vision
duke university
B.S.E. biomedical engineering
IRON MAN
onset detection
bpm. what?
bpmjs
janessa det (@jandet)
onset detection
fundamental to:
sonar, speech, EKG's,
movement detection
this
thing
IRON MAN
IRON MAN
onset detection
bpm. what?
bpmjs
janessa det (@jandet)
onset detection
fundamental to:
sonar, speech, EKG's,
movement detection
this
thing
IRON MAN
AUTOMATIC
TRANSCRIPTION
OF MUSIC
onset detection
bpm. what?
bpmjs
janessa det (@jandet)
AUTOMATIC
TRANSCRIPTION
OF MUSIC
this
thing
1. instrument identification
2. instrument isolation
3. pitch detection
4. dynamics
accessible
applicable
sharable
cross-platform
fast
digital signals processing
in the browser. why?
bpmjs
janessa det (@jandet)
accessible
applicable
sharable
cross-platform
fast
digital signals processing
javascript
in the browser. why?
bpmjs
janessa det (@jandet)
because
javascript
and it would be cool
is fun
to play with
diverse
diversity is powerful.
bpmjs
janessa det (@jandet)
the browseris
diverse
the community
diverse
diversity is powerful.
bpmjs
janessa det (@jandet)
the browseris
diverse
the community
diversity is powerful.
bpmjs
janessa det (@jandet)
yeah,
that’s me
reality
the dream
"finding ways to breed
engineering research, music, and art
with the trusty steed of javascript
to make the magical unicorns
of my imagination a reality"
diversity is powerful.
bpmjs
janessa det (@jandet)
yeah,
that’s me
reality
the dream
"finding ways to breed
engineering research, music, and art
with the trusty steed of javascript
to make the magical unicorns
of my imagination a reality"
ok, let’s
breed some
unicorns
onset detection?
how do we do
onset detection?
GENRES
tempos
beats
onsets
what is bpm?
bpmjs
janessa det (@jandet)
1. pitch
2. notes
3. percussive beats
DRUM AND BASS 160-180 BPM
House 118-135 BPM
hip-hop 115 BPM
Concert marches 120 BPM
Screamers 130-150 BPM
beats
GENRES
what is a beat?
1. pitched non-percussive
2. pitched percussive
3. non-pitched percussive
4. complex mixed
onsets
tempos
Largo 40-60 BPM
Larghetto 60-66 BPM
Adagio 66-76 BPM
Andante 76-108 BPM
Moderato 108-120 BPM
Allegro 120-168 BPM
Presto 168-200 BPM
Prestissimo 200+ BPM
bpmjs
janessa det (@jandet)
detection method.
DETECTION
FUNCTION
stft
DETECTION
FUNCTION
STFT PEAK PICKINGPEAK PICKING BPMBPM
Prep the signal
for Detection
Functions
Selectively maximize
for onset properties
Pick out peak times from
Detection Function
Calculate
BPM
ಠ_ಠ
bpmjs
janessa det (@jandet)
detection method.
DETECTION
FUNCTION
stft
DETECTION
FUNCTION
STFT PEAK PICKINGPEAK PICKING BPMBPM
Prep the signal
for Detection
Functions
Selectively maximize
for onset properties
Pick out peak times from
Detection Function
Calculate
BPM
stft. short-time fourier transform.
bpmjs
janessa det (@jandet)
4. zero padding
Zero pad to nearest power of 2
2. hamming window
Apply windowing function -- Hamming
3. normalization
Normalize magnitude
5. fast fourier transform
Convert to frequency domain
1. window slicing
Slice signal into overlapping windows
detection functions.
bpmjs
janessa det (@jandet)
frequency based methods
3. phase deviation
1. High frequency content
2. spectral difference
4. euclidian distance
peak picking
build threshold
peak picking.
bpmjs
janessa det (@jandet)
build threshold
1. median filter
Smooth out the signal for thresholding
2. adaptive thresholding
Threshold by median-filtered signal
3. initial peak finding
Identify local maxima
4. thresholding peaks
Apply adaptive threshold to peak findings
5. refractory period
Apply minimum time between peaks as threshold
peak picking
120 BPM
bpm calculation.
bpmjs
janessa det (@jandet)
0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
peak times (in seconds)
0.5
1 beat / 0.5 sec * 60 sec / 1 min
= 120 BPM
in javascript?
how do we do it
in javascript?
color profile of
music characterization.
bpmjs
janessa det (@jandet)
color profile of
so insane by discovery
average ~ 115 bpm
0:30 1:000:15 0:45 1:15 1:45 2:151:30 2:000:00 2:30 3:002:45 3:15
dsp.js
web audio
complex arithmetic
a lot of loops & math
browserify
tools used.
bpmjs
janessa det (@jandet)
dsp.js
web audio
complex arithmetic
a lot of loops & math
browserify
i
modules.
bpmjs
janessa det (@jandet)
peak picking
detection
bpm
web audio
AudioBuffer node
hfc sd pd e. dist.
dsp.js
fft windowing
complex
stft
how to not break chrome
js challenges.
bpmjs
janessa det (@jandet)
float32array
how to not break chrome
compatibility
complex arithmetic
matrices
how to not break chrome
js challenges.
bpmjs
janessa det (@jandet)
float32array
how to not break chrome
compatibility
complex arithmetic
matrices
NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...
NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
NaNNaNNaNNaNNaNNaNNaNNaN
0. signal winndow
stft. short-time fourier transform.
bpmjs
janessa det (@jandet)
3. ZERO PADDING
1. HAMMING WINDOW
2. NORMALIZATION
4. FFT -> Complex objects
bpmjs
janessa det (@jandet)
detection functions.
hfc
sd
pd
e. dist.
not bad...
bpmjs
janessa det (@jandet)
peak picking.
detection
function (ed)
median filtered
thresholded
etc
THE DREAM:
matlab!!
benchmarks
optimizations
& performance
bpmjs
janessa det (@jandet)
1. web workers for stft
2. SLICE WELL-SELECTED WINDOWS
benchmarks
vs. matlab!!
THE DREAM: “REAL-TIME”
3. asm.js, enscripten, LLjs
weaknesses.
future work.
weaknesses.
bpmjs
janessa det (@jandet)
1. sensitive tuning parameters
2. a priori knowledge helpful to select detection functions
3. median filtering or aggressive thresholding can cripple
the detection function
future work.
1. only scratching the surface of research
2. many detection functions
3. onset detection for different applications
is the unicorn beautiful?
ok so how did i do?
is the unicorn beautiful?
bpmjs
janessa det (@jandet)
ok, it feels a
little forced
but we’re getting
there!!
the web is changing.
bpmjs
janessa det (@jandet)
web audio api
dsp.js
God Bless
npm
rethinking
web engineering.
bpmjs
janessa det (@jandet)
what does it mean to be a
web engineer?
how about more engineering?
this is not the
final frontier
bpmjs
janessa det (@jandet)
embrace diversity
open community of learning
knowledge builds upon itself
combining fields is very powerful
think outside the box
breed those unicorns
rethinking
web engineering.
bpmjs
janessa det (@jandet)
thanks.
go forth and breed unicorns
main references
Beat Detection for Automated Music Transcription:
An exploration of Onset Detection Algorithms.
http://bingweb.binghamton.edu/~ahess2/Onset_Detection_Nov302011.pdf
The Scientist and Engineer's Guide to
Digital Signal Processing
By Steven W. Smith, Ph.D.
http://www.dspguide.com/pdfbook.htm
additional resources:
Gamedev: beat detection algorithms
http://archive.gamedev.net/archive/
reference/programming/features/beatdetection/index.html
BPM Database
http://www.bpmdatabase.com/

Weitere ähnliche Inhalte

Ähnlich wie BPM JS

Workshop NGS data analysis - 1
Workshop NGS data analysis - 1Workshop NGS data analysis - 1
Workshop NGS data analysis - 1Maté Ongenaert
 
ESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptx
ESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptx
ESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptxNikhilHRaju
 
Apache Spark Data intensive processing in practice
Apache Spark Data intensive processing in practice Apache Spark Data intensive processing in practice
Apache Spark Data intensive processing in practice Marcin Szymaniuk
 
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.GeeksLab Odessa
 
MNE group analysis presentation @ Biomag 2016 conf.
MNE group analysis presentation @ Biomag 2016 conf.MNE group analysis presentation @ Biomag 2016 conf.
MNE group analysis presentation @ Biomag 2016 conf.agramfort
 
Introduction of Plasma Chamber at EDCON 2019
Introduction of Plasma Chamber at EDCON 2019 Introduction of Plasma Chamber at EDCON 2019
Introduction of Plasma Chamber at EDCON 2019 YurikoNishijima
 
Beware the potholes on the road to serverless
Beware the potholes on the road to serverlessBeware the potholes on the road to serverless
Beware the potholes on the road to serverlessYan Cui
 
VOICE CONTROLLED WHEELCHAIR using Amharic.pdf
VOICE CONTROLLED WHEELCHAIR using Amharic.pdfVOICE CONTROLLED WHEELCHAIR using Amharic.pdf
VOICE CONTROLLED WHEELCHAIR using Amharic.pdfMubarek kebede
 
My Name is E & Open Standards
My Name is E & Open StandardsMy Name is E & Open Standards
My Name is E & Open StandardsAndreas - Creten
 
Hacking ATM machines for fun and profit!
Hacking ATM machines for fun and profit!Hacking ATM machines for fun and profit!
Hacking ATM machines for fun and profit!Zigoo0
 
Rubymanor - Nanite talk
Rubymanor - Nanite talkRubymanor - Nanite talk
Rubymanor - Nanite talkGeorgio_1999
 
How to dominate a country
How to dominate a countryHow to dominate a country
How to dominate a countryTiago Henriques
 
MongoDB & Machine Learning
MongoDB & Machine LearningMongoDB & Machine Learning
MongoDB & Machine LearningTom Maiaroto
 
Project Portfolio - Transferable Skills
Project Portfolio - Transferable SkillsProject Portfolio - Transferable Skills
Project Portfolio - Transferable Skillstuleyb
 
The Art Of Performance Tuning
The Art Of Performance TuningThe Art Of Performance Tuning
The Art Of Performance TuningJonathan Ross
 
44CON 2014 - Switches Get Stitches, Eireann Leverett & Matt Erasmus
44CON 2014 - Switches Get Stitches,  Eireann Leverett & Matt Erasmus44CON 2014 - Switches Get Stitches,  Eireann Leverett & Matt Erasmus
44CON 2014 - Switches Get Stitches, Eireann Leverett & Matt Erasmus44CON
 

Ähnlich wie BPM JS (20)

Computer Vision Anemometer (AR)
Computer Vision Anemometer  (AR)Computer Vision Anemometer  (AR)
Computer Vision Anemometer (AR)
 
Raskar Computational Camera Fall 2009 Lecture 01
Raskar Computational Camera Fall 2009 Lecture 01Raskar Computational Camera Fall 2009 Lecture 01
Raskar Computational Camera Fall 2009 Lecture 01
 
Workshop NGS data analysis - 1
Workshop NGS data analysis - 1Workshop NGS data analysis - 1
Workshop NGS data analysis - 1
 
ESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptx
ESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptx
ESD -DAY 3-PORTAL.pptxESD -DAY 3-PORTAL.pptx
 
Apache Spark Data intensive processing in practice
Apache Spark Data intensive processing in practice Apache Spark Data intensive processing in practice
Apache Spark Data intensive processing in practice
 
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
Java/Scala Lab 2016. Владимир Гарбуз: Написание безопасного кода на Java.
 
MNE group analysis presentation @ Biomag 2016 conf.
MNE group analysis presentation @ Biomag 2016 conf.MNE group analysis presentation @ Biomag 2016 conf.
MNE group analysis presentation @ Biomag 2016 conf.
 
Introduction of Plasma Chamber at EDCON 2019
Introduction of Plasma Chamber at EDCON 2019 Introduction of Plasma Chamber at EDCON 2019
Introduction of Plasma Chamber at EDCON 2019
 
Beware the potholes on the road to serverless
Beware the potholes on the road to serverlessBeware the potholes on the road to serverless
Beware the potholes on the road to serverless
 
VOICE CONTROLLED WHEELCHAIR using Amharic.pdf
VOICE CONTROLLED WHEELCHAIR using Amharic.pdfVOICE CONTROLLED WHEELCHAIR using Amharic.pdf
VOICE CONTROLLED WHEELCHAIR using Amharic.pdf
 
Detecting person's direction of interest 01
Detecting person's direction of interest 01Detecting person's direction of interest 01
Detecting person's direction of interest 01
 
My Name is E & Open Standards
My Name is E & Open StandardsMy Name is E & Open Standards
My Name is E & Open Standards
 
Hacking ATM machines for fun and profit!
Hacking ATM machines for fun and profit!Hacking ATM machines for fun and profit!
Hacking ATM machines for fun and profit!
 
Transformer and BERT
Transformer and BERTTransformer and BERT
Transformer and BERT
 
Rubymanor - Nanite talk
Rubymanor - Nanite talkRubymanor - Nanite talk
Rubymanor - Nanite talk
 
How to dominate a country
How to dominate a countryHow to dominate a country
How to dominate a country
 
MongoDB & Machine Learning
MongoDB & Machine LearningMongoDB & Machine Learning
MongoDB & Machine Learning
 
Project Portfolio - Transferable Skills
Project Portfolio - Transferable SkillsProject Portfolio - Transferable Skills
Project Portfolio - Transferable Skills
 
The Art Of Performance Tuning
The Art Of Performance TuningThe Art Of Performance Tuning
The Art Of Performance Tuning
 
44CON 2014 - Switches Get Stitches, Eireann Leverett & Matt Erasmus
44CON 2014 - Switches Get Stitches,  Eireann Leverett & Matt Erasmus44CON 2014 - Switches Get Stitches,  Eireann Leverett & Matt Erasmus
44CON 2014 - Switches Get Stitches, Eireann Leverett & Matt Erasmus
 

Kürzlich hochgeladen

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

BPM JS

  • 1. jsbpm onset detection in the Browser Janessa Det - WEB eng @TWITTERNYC
  • 2. hello. bpmjs janessa det (@jandet) twitter nyc Software engineer Web Team columbia university M.S. Computer science Graphics & Vision duke university B.S.E. biomedical engineering
  • 3. IRON MAN onset detection bpm. what? bpmjs janessa det (@jandet) onset detection fundamental to: sonar, speech, EKG's, movement detection this thing IRON MAN
  • 4. IRON MAN onset detection bpm. what? bpmjs janessa det (@jandet) onset detection fundamental to: sonar, speech, EKG's, movement detection this thing IRON MAN
  • 5. AUTOMATIC TRANSCRIPTION OF MUSIC onset detection bpm. what? bpmjs janessa det (@jandet) AUTOMATIC TRANSCRIPTION OF MUSIC this thing 1. instrument identification 2. instrument isolation 3. pitch detection 4. dynamics
  • 6. accessible applicable sharable cross-platform fast digital signals processing in the browser. why? bpmjs janessa det (@jandet) accessible applicable sharable cross-platform fast digital signals processing
  • 7. javascript in the browser. why? bpmjs janessa det (@jandet) because javascript and it would be cool is fun to play with
  • 8. diverse diversity is powerful. bpmjs janessa det (@jandet) the browseris diverse the community
  • 9. diverse diversity is powerful. bpmjs janessa det (@jandet) the browseris diverse the community
  • 10. diversity is powerful. bpmjs janessa det (@jandet) yeah, that’s me reality the dream "finding ways to breed engineering research, music, and art with the trusty steed of javascript to make the magical unicorns of my imagination a reality"
  • 11. diversity is powerful. bpmjs janessa det (@jandet) yeah, that’s me reality the dream "finding ways to breed engineering research, music, and art with the trusty steed of javascript to make the magical unicorns of my imagination a reality" ok, let’s breed some unicorns
  • 12. onset detection? how do we do onset detection?
  • 13. GENRES tempos beats onsets what is bpm? bpmjs janessa det (@jandet) 1. pitch 2. notes 3. percussive beats DRUM AND BASS 160-180 BPM House 118-135 BPM hip-hop 115 BPM Concert marches 120 BPM Screamers 130-150 BPM beats GENRES what is a beat? 1. pitched non-percussive 2. pitched percussive 3. non-pitched percussive 4. complex mixed onsets tempos Largo 40-60 BPM Larghetto 60-66 BPM Adagio 66-76 BPM Andante 76-108 BPM Moderato 108-120 BPM Allegro 120-168 BPM Presto 168-200 BPM Prestissimo 200+ BPM
  • 14. bpmjs janessa det (@jandet) detection method. DETECTION FUNCTION stft DETECTION FUNCTION STFT PEAK PICKINGPEAK PICKING BPMBPM Prep the signal for Detection Functions Selectively maximize for onset properties Pick out peak times from Detection Function Calculate BPM ಠ_ಠ
  • 15. bpmjs janessa det (@jandet) detection method. DETECTION FUNCTION stft DETECTION FUNCTION STFT PEAK PICKINGPEAK PICKING BPMBPM Prep the signal for Detection Functions Selectively maximize for onset properties Pick out peak times from Detection Function Calculate BPM
  • 16. stft. short-time fourier transform. bpmjs janessa det (@jandet) 4. zero padding Zero pad to nearest power of 2 2. hamming window Apply windowing function -- Hamming 3. normalization Normalize magnitude 5. fast fourier transform Convert to frequency domain 1. window slicing Slice signal into overlapping windows
  • 17. detection functions. bpmjs janessa det (@jandet) frequency based methods 3. phase deviation 1. High frequency content 2. spectral difference 4. euclidian distance
  • 18. peak picking build threshold peak picking. bpmjs janessa det (@jandet) build threshold 1. median filter Smooth out the signal for thresholding 2. adaptive thresholding Threshold by median-filtered signal 3. initial peak finding Identify local maxima 4. thresholding peaks Apply adaptive threshold to peak findings 5. refractory period Apply minimum time between peaks as threshold peak picking
  • 19. 120 BPM bpm calculation. bpmjs janessa det (@jandet) 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 peak times (in seconds) 0.5 1 beat / 0.5 sec * 60 sec / 1 min = 120 BPM
  • 20. in javascript? how do we do it in javascript?
  • 21. color profile of music characterization. bpmjs janessa det (@jandet) color profile of so insane by discovery average ~ 115 bpm 0:30 1:000:15 0:45 1:15 1:45 2:151:30 2:000:00 2:30 3:002:45 3:15
  • 22. dsp.js web audio complex arithmetic a lot of loops & math browserify tools used. bpmjs janessa det (@jandet) dsp.js web audio complex arithmetic a lot of loops & math browserify i
  • 23. modules. bpmjs janessa det (@jandet) peak picking detection bpm web audio AudioBuffer node hfc sd pd e. dist. dsp.js fft windowing complex stft
  • 24. how to not break chrome js challenges. bpmjs janessa det (@jandet) float32array how to not break chrome compatibility complex arithmetic matrices
  • 25. how to not break chrome js challenges. bpmjs janessa det (@jandet) float32array how to not break chrome compatibility complex arithmetic matrices NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN... NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN NaNNaNNaNNaNNaNNaNNaNNaN
  • 26. 0. signal winndow stft. short-time fourier transform. bpmjs janessa det (@jandet) 3. ZERO PADDING 1. HAMMING WINDOW 2. NORMALIZATION 4. FFT -> Complex objects
  • 27. bpmjs janessa det (@jandet) detection functions. hfc sd pd e. dist. not bad...
  • 28. bpmjs janessa det (@jandet) peak picking. detection function (ed) median filtered thresholded etc
  • 29. THE DREAM: matlab!! benchmarks optimizations & performance bpmjs janessa det (@jandet) 1. web workers for stft 2. SLICE WELL-SELECTED WINDOWS benchmarks vs. matlab!! THE DREAM: “REAL-TIME” 3. asm.js, enscripten, LLjs
  • 30. weaknesses. future work. weaknesses. bpmjs janessa det (@jandet) 1. sensitive tuning parameters 2. a priori knowledge helpful to select detection functions 3. median filtering or aggressive thresholding can cripple the detection function future work. 1. only scratching the surface of research 2. many detection functions 3. onset detection for different applications
  • 31. is the unicorn beautiful? ok so how did i do? is the unicorn beautiful?
  • 32. bpmjs janessa det (@jandet) ok, it feels a little forced but we’re getting there!!
  • 33. the web is changing. bpmjs janessa det (@jandet) web audio api dsp.js God Bless npm
  • 34. rethinking web engineering. bpmjs janessa det (@jandet) what does it mean to be a web engineer? how about more engineering? this is not the final frontier
  • 35. bpmjs janessa det (@jandet) embrace diversity open community of learning knowledge builds upon itself combining fields is very powerful think outside the box breed those unicorns rethinking web engineering.
  • 36. bpmjs janessa det (@jandet) thanks. go forth and breed unicorns
  • 37. main references Beat Detection for Automated Music Transcription: An exploration of Onset Detection Algorithms. http://bingweb.binghamton.edu/~ahess2/Onset_Detection_Nov302011.pdf The Scientist and Engineer's Guide to Digital Signal Processing By Steven W. Smith, Ph.D. http://www.dspguide.com/pdfbook.htm additional resources: Gamedev: beat detection algorithms http://archive.gamedev.net/archive/ reference/programming/features/beatdetection/index.html BPM Database http://www.bpmdatabase.com/