Does anyone ever fall for that scam? They always come in 2, and the messages are always identical, and the reply "testing it out now" is always posted 1 second after the scam post. Different accounts every time, so you can probably guess what will happen if you fall for this one...
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!
Thanks! Yes I was going to say something about logarithms too. You said it better than me, and that's a useful formula I might use in my own music/pitch visualization project.
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.
Ok, here are the fixes to your code I suggested while watching: editor.p5js.org/nlaredo/sketches/pIvQ7m7ZB A couple things I noticed running this.. stand alone, it doesn't work because chrome requires interaction to enable a web audio context (the p5js environment hides this by requiring interaction to make the javascript start in the first place). I will probably redo this myself without p5js because I don't like introducing dependencies, but I wanted to get you the suggestions I made while watching your video as quickly as possible. The pitch detector you are using is pretty inaccurate outside a "sweet spot" range and outside a sine-wave-like waveform (square waves really trip it up), but it does detect chromatic notes for a pretty good range with sine wave inputs. The main difference with your youtube code is that instead of using a table and finding the closest match, I just use math to calculate a note and cents value based on a given frequency, and I present this to the user. Additionally, after some time running, the pitch detector gets slower and slower until it basically stuffs up the browser almost completely, and it's hard to understand what is going on because things are hidden inside some unexplored dependencies you introduced in this project. Ideally the frequency detection would be replaced with web audio using a FFT analyzer and then doing cubic interpolation to find the most accurate peak position possible within the fft to get a reasonable approximation of frequency. Cubic interpolation is a good skill to teach too: paulbourke.net/miscellaneous/interpolation/
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!
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 .
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.
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.
Hey Dan! Great video! I always look forward to these challenges 👌 Does anyone here know the most current method of pitch detection? I don't think it's FFT . Thanks in advance!😁👌
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)
I discussed this with Daniel, he was planning to do it with a genetic algorithm... Dan: Uh-oh... the search space is so vast that you can't use a genetic algorithm! And even if you could, how would you easily come up with a fitness function!? Me: Use Q-Learning??? Dan: That would require a whole new playlist of videos. Dan: Use a genetic algorithm to do every step of a Rubik's Cube Algorithm? Me (silently): No! He wants to not use an explicitly programmed AI! That's how hard it is to program a Rubik's Cube Solver using ML. And how long it will probably take to get the video done.
Thanks a lot for your explanation. I watched this video twice but the frequency produced is null several times with the recursion included. I am using chrome as browser. Any comment to solve this problem? Thank you so much. best regards,
Nicely done! I love that your tutorial is now features in ml5 docs! One thing I need to point out is that your detection of closest note is not working properly, because notes are existing in "cents" scale, 100 cents per note, 1200 cents per octave while you are trying to operate in frequency scale in hertz. The problem is that relation between frequency scale and notes scale is not linear, so closest note by frequency distance != closest note by cents distance. So my suggestion is to switch to cents as fast as possible. You can additionally remove hardcoded notes from the code, since any note frequency can be calculated from the base A5 440.0 Hz. Here is how I am calculating closest note to given frequency, if it helps: github.com/ocwalk/ocwalk/blob/master/shared/src/main/scala/ocwalk/model.scala And here is a live pitch detector that also uses CREPE, very close to how you are doing things: ocwalk.com/pitch
I don't get you man!, everything is working very fine and you say it is not correct. You made a lot of wrong statements in your comment, like this one : The problem is that relation between frequency scale and notes scale is not linear. I know the relationship between note and frequency is not linear(it is a log scale) but he was not comparing frequency and note, he was comparing frequency and frequency difference which is no big deal if he wanted it in percentage.
i'm trying to build this but using react native (new to react). I installed everything needed like smthg called npm but how do i include this code in my app and have it work on my phone instead of it opening in the browser? Cause when i include the sketch.js file written above and run the app its giving me errors like about a render method or missing components. If someone can tell me what lines of code i need to add around the js code above to make it work in the app would be much appreciated.
i have seen your videos and are very helpful .Now i need your help i am in two ways, should i study a software enginnering or Machine Learning as a computer sceince? Thank you!
"My tuner broke"
Good reason as any to just teach a computer how to think for itself and help you out with that tuning
Does anyone ever fall for that scam? They always come in 2, and the messages are always identical, and the reply "testing it out now" is always posted 1 second after the scam post.
Different accounts every time, so you can probably guess what will happen if you fall for this one...
Whenever I watch your training, you are really a Javascript master.
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 !
This feels so good, welcome back!
I love when A4 vibrates at 440 _frequency values_ | Great to have you back Dan!
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!
Thanks! Yes I was going to say something about logarithms too. You said it better than me, and that's a useful formula I might use in my own music/pitch visualization project.
the song in the end warmed my heart
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.
Ok, here are the fixes to your code I suggested while watching: editor.p5js.org/nlaredo/sketches/pIvQ7m7ZB
A couple things I noticed running this.. stand alone, it doesn't work because chrome requires interaction to enable a web audio context (the p5js environment hides this by requiring interaction to make the javascript start in the first place). I will probably redo this myself without p5js because I don't like introducing dependencies, but I wanted to get you the suggestions I made while watching your video as quickly as possible.
The pitch detector you are using is pretty inaccurate outside a "sweet spot" range and outside a sine-wave-like waveform (square waves really trip it up), but it does detect chromatic notes for a pretty good range with sine wave inputs. The main difference with your youtube code is that instead of using a table and finding the closest match, I just use math to calculate a note and cents value based on a given frequency, and I present this to the user.
Additionally, after some time running, the pitch detector gets slower and slower until it basically stuffs up the browser almost completely, and it's hard to understand what is going on because things are hidden inside some unexplored dependencies you introduced in this project.
Ideally the frequency detection would be replaced with web audio using a FFT analyzer and then doing cubic interpolation to find the most accurate peak position possible within the fft to get a reasonable approximation of frequency. Cubic interpolation is a good skill to teach too: paulbourke.net/miscellaneous/interpolation/
even though im not as interested in programming right now, your videos are so fun & well made that theyre always a good watch!
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
We definitely missed you !
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!
Welcome back Daniel ! Feels good to see you back 👍
Freakin awesome, I always learn something when I watch these
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 .
Thank you so much! Amazing!
This is a great tutorial - I would never have thought this could be so easy (or a at least you make it look easy!)
Really I enjoyed learning ☺️
Missed you, Dan!
Keep posting videos like this this gives hope to us to learn ML
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.
Thank you, I was struggling to get it work
That was really delightful!
Your tuner is perfect ! Good job 👏
Great video, super entertaining :D
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.
Love this coding challenge as I also have a ukulele myself at home! Thanks :D
Daniel, you are amazing.
I wish I could know you and be your student
Missed you, welcome back!
Glad to see you again 👍
Awesome!!! Good job!!
Nutella is everywhere (hi I’m Italian and I’m loving your videos Daniel, wish you were my teacher 👨🏫)
I remember the live stream where it took several takes to get started!
Daniel you should show more processing 🚂💨
good ol lomb scargle, hasn't let me down yet.
Neighbor must be like " wth is he playing".
Hey Dan! Great video! I always look forward to these challenges 👌 Does anyone here know the most current method of pitch detection? I don't think it's FFT . Thanks in advance!😁👌
The audioContext is the audio context and the MediaStream is the media stream
Less is more.
didnt watch it yet but you can do a discrete fourier transformation on the sound sample and detect the most frequent frequency as the pitch
You are Awesome ..!!
Dude, I think you are actually seriously crazy a little bit
not crazy just enthusiastic and ready to try new things lol
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)
Impressive, but can you do the bass tuner
Hey guys i need help can i like customize the string note using dropdown, can someone help me with that?
Don't stop making video
🔥🔥🔥
Keep it going Dan u r awesome ❤️
(18:12) freak! XD
Remember im gonna be a member of the chanel as soon you upload the rubiks cube solver!!!
Also im the first :)
I discussed this with Daniel, he was planning to do it with a genetic algorithm...
Dan: Uh-oh... the search space is so vast that you can't use a genetic algorithm! And even if you could, how would you easily come up with a fitness function!?
Me: Use Q-Learning???
Dan: That would require a whole new playlist of videos.
Dan: Use a genetic algorithm to do every step of a Rubik's Cube Algorithm?
Me (silently): No! He wants to not use an explicitly programmed AI!
That's how hard it is to program a Rubik's Cube Solver using ML. And how long it will probably take to get the video done.
I will definitely try to make this myself! But with the math...
YES DAN!
now i should really jump into Machine Learning. don't know why i'm avoiding it.
hmm wow, also removed need for model.json at end of link it adds it automatically now .
On a scale from 1 to 10,how good this video is?
Me:100
Thanks a lot for your explanation. I watched this video twice but the frequency produced is null several times with the recursion included. I am using chrome as browser. Any comment to solve this problem? Thank you so much. best regards,
Nicely done! I love that your tutorial is now features in ml5 docs!
One thing I need to point out is that your detection of closest note is not working properly, because notes are existing in "cents" scale, 100 cents per note, 1200 cents per octave while you are trying to operate in frequency scale in hertz. The problem is that relation between frequency scale and notes scale is not linear, so closest note by frequency distance != closest note by cents distance.
So my suggestion is to switch to cents as fast as possible.
You can additionally remove hardcoded notes from the code, since any note frequency can be calculated from the base A5 440.0 Hz.
Here is how I am calculating closest note to given frequency, if it helps:
github.com/ocwalk/ocwalk/blob/master/shared/src/main/scala/ocwalk/model.scala
And here is a live pitch detector that also uses CREPE, very close to how you are doing things:
ocwalk.com/pitch
I've analyzed that code and found out it is for the piano keyboard. So no thanks, this tutorial is excellent, you can't find anything better.
@@chigozieobialor1245 it does not matter which instrument pitch you are detecting
@@WispYart What you are suggesting is another approach, what Daniel did was very correct.
@@chigozieobialor1245 nope, it's not correct as I explained above
I don't get you man!, everything is working very fine and you say it is not correct. You made a lot of wrong statements in your comment, like this one : The problem is that relation between frequency scale and notes scale is not linear. I know the relationship between note and frequency is not linear(it is a log scale) but he was not comparing frequency and note, he was comparing frequency and frequency difference which is no big deal if he wanted it in percentage.
can you adjust the code to show the graph of the pitch?
gave an error when I tried. Says the model url is not a valid url to use in pitchDetection(). Please help
How could I run this in a HTML page?
Anyone knows or uses processing for android i really need help with a issue
Dani?
Did you try posting at discourse.processing.org?
And the day where Dan finally used Vanilla JS...
Has not yet come... :(
take a look at ua-cam.com/play/PLRqwX-V7Uu6YxDKpFzf_2D84p0cyk4T7X.html !
What do you mean by vanilla JS... ES6? He used that already in 2017!
@@TheCodingTrain yes but it would be nice to see you do other things without libraries too.
@@thefreeze6023 agreed
(25:06) train is coming!
can we add some FFt+windowing to this stuff
Which mac does he has ?
i'm trying to build this but using react native (new to react). I installed everything needed like smthg called npm but how do i include this code in my app and have it work on my phone instead of it opening in the browser? Cause when i include the sketch.js file written above and run the app its giving me errors like about a render method or missing components. If someone can tell me what lines of code i need to add around the js code above to make it work in the app would be much appreciated.
Make a video: How interact with 3d objects
Pleasse
Visualization is complex work
love you ❤
Remake this please. It doesn't work in Chrome launching it from my local computer
i have seen your videos and are very helpful .Now i need your help i am in two ways, should i study a software enginnering or Machine Learning as a computer sceince? Thank you!
35:54 Instead if jsDelivr i can get a url straight from github
They could just decompose the complex wave in to a spectrum (relative amplitude over frequency), and return the pitch of the highest amplitude point
a little Arduino and a motor, someone could just let this tune it for them lol xD
Can you do a video of a Guitar Tuner Too?
It's basiclly the same principle but in the object array put the guitar strings frequency =D
Can u please learn us how to do in Java?
Where's the rubics cube?
Conv. REpr. Pitch. Estim. : *exist*
Me as a french : *The crêpe from la Breatgne ?*
tremendo xD
Pro
3rd
Learn the quick sort please sir please
What do you mean?
@@clipi_ quick sorting example
@Omkar badhe ua-cam.com/video/eqo2LxRADhU/v-deo.html
Thats a video of the quick sort algorithm by Dan (The Coding Train)
Jej
please speak game guitar hero, convert midi json, notes durations songs, please
I need someone to help me code an azure kinect for a project.
I cant share my idea if there is someone hmu.
"I've got a super secret idea - I just need someone to do all the work" - good luck 🤣
Thats the whole plan
i more like to pronounce this like "K REE PEE"
crepe
4th
ALL SECRETS ARE REVEALED WITH DAN'S UKALELE :):):)))))
75th banana
Well, duh.
Sir make candy crush game