Coding Challenge #151: Ukulele Tuner with Machine Learning Pitch Detection Model

preview_player
Показать описание


References:

Related Coding Challenges:

Timestamps:
00:00 Introduction
01:04 Import the ml5 library
01:34 Pitch detection using ml5
02:24 The CREPE model
05:07 Using the CREPE model in the web editor
07:19 Create a pitch detector with ml5
11:57 The new keyword: constructors vs functions
13:26 Get a frequency value from the microphone
14:48 Make sure the microphone is ready first
15:33 ml5 callbacks are error-first
17:12 Checking the frequency continuously
18:05 Drawing the frequency in the canvas
19:46 Tuning the A string of the ukulele
25:08 Improving the graphical interface
27:06 Tuning the other strings of the ukulele
28:44 Figure out which note is the closest one
31:51 Debugging and fixing the code
34:51 Wrapping up this coding challenge

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

#machinelearning #pitchdetection #sound #tuner #p5js #ml5js #javascript
Рекомендации по теме
Комментарии
Автор

"My tuner broke"

Good reason as any to just teach a computer how to think for itself and help you out with that tuning

morphman
Автор

Whenever I watch your training, you are really a Javascript master.

torch
Автор

Great video! One thing i would suggest is to convert frequency to cents since frequency scale is logarithmic and notes scale is linear. You can do it with this formula: p = 69 + 12 * log2(f/440). Where p is a midi note number, and f is a frequency of incoming signal. Then you can have diff in cents with Math.round((p - Math.round(p)) * 100). This approach is more accurate for tuning purpose. As always thanks for great work!

TheSynthesium
Автор

That is what I love about you, you could have left it at tuning just "A", but you didn't.
Also, great to have you back !

adityasriram
Автор

I love when A4 vibrates at 440 _frequency values_ | Great to have you back Dan!

iakanoe
Автор

You've never made a coding train that had me yelling advice at the screen before. I am totally going to have to make my own tuner to share with you now.

nilk
Автор

Javascript actually has built in FFT for frequency analysis (which would do exactly this in real-time :) ) I've used this along with WebGL for visualisers and beat detectors for art installations. Interesting to see ML used though! Love your videos!

Stabby
Автор

wow, that is just unreal. i did finally run my happy, sad classifier in my p5 editor on web and trained. un.... real . my phone can tell objects even happy and sad . i never ran it on web editor yet with the cdns .

geoffwagner
Автор

Hello Daniel, how are you?...you did a pretty amazing job on this project, I truly appreciate your work and how you explained it. Please I will like you to implement this same project using Processing. Many thanks for your help.

chigozieobialor
Автор

This is one of my fav coding challenge videos! I'm quite curious about how pitch detection models work for different timbres such as piano, violin, trumpet etc, and how this ML model compares with FFT-based approaches. Does anyone here know this topic? I'll have to read the CREPE paper first and do some research in this area.

NierAutomataB
Автор

even though im not as interested in programming right now, your videos are so fun & well made that theyre always a good watch!

eyemotif
Автор

I'm glad you're back! Thanks for still making this videos you were really helpful when I was deciding what I wanted to do the rest of my life

sudoalex
Автор

Freakin awesome, I always learn something when I watch these

elishashmalo
Автор

Daniel, you are amazing.
I wish I could know you and be your student

eitanas
Автор

Thank you, I was struggling to get it work

tshaylatte
Автор

Welcome back Daniel ! Feels good to see you back 👍

viraj.bhartiya
Автор

This is a great tutorial - I would never have thought this could be so easy (or a at least you make it look easy!)

ShaneLeeCoding
Автор

Keep posting videos like this this gives hope to us to learn ML

ketanbhenwal
Автор

Enjoyed your Uke tuner. I'm trying to get a version to run locally, without the internet.
I followed p5.js "getStarted" and downloaded the p5.js.complete code. I also followed
those directions to create a local server. Can't get it to get to run beyond "listening". Tried using
both Chrome and Firefox on a Windows pc. Would love to find a working example that runs off-line.
Thanks, Fred
(ps. For me, your example runs on Chrome, but not Firefox)

goresk
Автор

Love this coding challenge as I also have a ukulele myself at home! Thanks :D

lucasg.