Coding Challenge

Поділитися
Вставка
  • Опубліковано 20 сер 2024

КОМЕНТАРІ • 123

  • @morphman86
    @morphman86 4 роки тому +54

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

    • @morphman86
      @morphman86 3 роки тому

      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...

  • @torch3198
    @torch3198 4 роки тому +56

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

  • @aditya95sriram
    @aditya95sriram 4 роки тому +17

    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 !

  • @ProgrammingwithPeter
    @ProgrammingwithPeter 4 роки тому +35

    This feels so good, welcome back!

  • @iakanoe
    @iakanoe 4 роки тому +5

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

  • @TheSynthesium
    @TheSynthesium 4 роки тому +12

    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!

    • @bgaskin
      @bgaskin 4 роки тому +2

      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.

  • @PotatoKaboom
    @PotatoKaboom 4 роки тому +7

    the song in the end warmed my heart

  • @nil2k
    @nil2k 4 роки тому +4

    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.

    • @nil2k
      @nil2k 4 роки тому +5

      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/

  • @eyemotif
    @eyemotif 4 роки тому +1

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

  • @sudoalex
    @sudoalex 4 роки тому

    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

  • @abdelrahmanomar1515
    @abdelrahmanomar1515 4 роки тому +4

    We definitely missed you !

  • @Stabby666
    @Stabby666 4 роки тому +1

    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!

  • @viraj.bhartiya
    @viraj.bhartiya 4 роки тому

    Welcome back Daniel ! Feels good to see you back 👍

  • @elishashmalo3731
    @elishashmalo3731 4 роки тому +2

    Freakin awesome, I always learn something when I watch these

  • @geoffwagner4935
    @geoffwagner4935 10 місяців тому

    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 .

  • @jitheshkuyyalil
    @jitheshkuyyalil 21 день тому

    Thank you so much! Amazing!

  • @ShaneLeeCoding
    @ShaneLeeCoding 4 роки тому

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

  • @neeharikaroyal9293
    @neeharikaroyal9293 4 роки тому +5

    Really I enjoyed learning ☺️

  • @grainfrizz
    @grainfrizz 4 роки тому +6

    Missed you, Dan!

  • @ketanbhenwal3662
    @ketanbhenwal3662 4 роки тому +1

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

  • @chigozieobialor1245
    @chigozieobialor1245 4 роки тому +2

    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.

  • @tshaylatte9502
    @tshaylatte9502 2 роки тому

    Thank you, I was struggling to get it work

  • @mmahgoub
    @mmahgoub 4 роки тому

    That was really delightful!

  • @loic.bertrand
    @loic.bertrand 4 роки тому

    Your tuner is perfect ! Good job 👏

  • @Bet0usky99
    @Bet0usky99 4 роки тому +1

    Great video, super entertaining :D

  • @NierAutomata2B
    @NierAutomata2B 3 роки тому +1

    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.

  • @lucasg.5534
    @lucasg.5534 4 роки тому +4

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

  • @eitanas85
    @eitanas85 4 роки тому +2

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

  • @EsquisseBeats
    @EsquisseBeats 4 роки тому

    Missed you, welcome back!

  • @Archelioz
    @Archelioz 4 роки тому

    Glad to see you again 👍

  • @forrymight274
    @forrymight274 3 роки тому

    Awesome!!! Good job!!

  • @gerardociarlone505
    @gerardociarlone505 3 роки тому

    Nutella is everywhere (hi I’m Italian and I’m loving your videos Daniel, wish you were my teacher 👨‍🏫)

  • @zinsy23
    @zinsy23 4 роки тому

    I remember the live stream where it took several takes to get started!

  • @benjamindragon598
    @benjamindragon598 4 роки тому +2

    Daniel you should show more processing 🚂💨

  • @Taterzz
    @Taterzz 4 роки тому

    good ol lomb scargle, hasn't let me down yet.

  • @EnchikO
    @EnchikO 4 роки тому +1

    Neighbor must be like " wth is he playing".

  • @joseortiz_io
    @joseortiz_io 4 роки тому +1

    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!😁👌

  • @lukasaudir8
    @lukasaudir8 4 роки тому

    The audioContext is the audio context and the MediaStream is the media stream

  • @Userjdanon
    @Userjdanon 4 роки тому

    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

  • @JavaAidTutorials
    @JavaAidTutorials 4 роки тому

    You are Awesome ..!!

  • @distrologic2925
    @distrologic2925 4 роки тому

    Dude, I think you are actually seriously crazy a little bit

    • @fdetv420
      @fdetv420 4 роки тому

      not crazy just enthusiastic and ready to try new things lol

  • @goresk9290
    @goresk9290 3 роки тому

    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)

  • @thoaily8352
    @thoaily8352 4 роки тому +1

    Impressive, but can you do the bass tuner

  • @AbrarZakialmer
    @AbrarZakialmer Рік тому

    Hey guys i need help can i like customize the string note using dropdown, can someone help me with that?

  • @saurav1096
    @saurav1096 4 роки тому

    Don't stop making video

  • @asaoluelijah5042
    @asaoluelijah5042 4 роки тому +2

    🔥🔥🔥

  • @ademdjek1253
    @ademdjek1253 4 роки тому

    Keep it going Dan u r awesome ❤️

  • @michalbotor
    @michalbotor 4 роки тому +3

    (18:12) freak! XD

  • @clipi_
    @clipi_ 4 роки тому +1

    Remember im gonna be a member of the chanel as soon you upload the rubiks cube solver!!!
    Also im the first :)

    • @SimonTiger
      @SimonTiger 4 роки тому

      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.

  • @owendeheer5893
    @owendeheer5893 4 роки тому

    I will definitely try to make this myself! But with the math...

  • @nevertwenty
    @nevertwenty 4 роки тому

    YES DAN!

  • @anuraghazra4772
    @anuraghazra4772 4 роки тому +3

    now i should really jump into Machine Learning. don't know why i'm avoiding it.

  • @geoffwagner4935
    @geoffwagner4935 10 місяців тому

    hmm wow, also removed need for model.json at end of link it adds it automatically now .

  • @pushpakgupta7396
    @pushpakgupta7396 4 роки тому +5

    On a scale from 1 to 10,how good this video is?
    Me:100

  • @douglaslopez2311
    @douglaslopez2311 4 роки тому

    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,

  • @WispYart
    @WispYart 4 роки тому +1

    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

    • @chigozieobialor1245
      @chigozieobialor1245 4 роки тому

      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.

    • @WispYart
      @WispYart 4 роки тому

      @@chigozieobialor1245 it does not matter which instrument pitch you are detecting

    • @chigozieobialor1245
      @chigozieobialor1245 4 роки тому

      @@WispYart What you are suggesting is another approach, what Daniel did was very correct.

    • @WispYart
      @WispYart 4 роки тому

      @@chigozieobialor1245 nope, it's not correct as I explained above

    • @chigozieobialor1245
      @chigozieobialor1245 4 роки тому

      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.

  • @mischamin7188
    @mischamin7188 2 роки тому

    can you adjust the code to show the graph of the pitch?

  • @amanmahendroo1784
    @amanmahendroo1784 4 роки тому

    gave an error when I tried. Says the model url is not a valid url to use in pitchDetection(). Please help

  • @brunoavelar4003
    @brunoavelar4003 2 роки тому

    How could I run this in a HTML page?

  • @yashwanthd1998
    @yashwanthd1998 4 роки тому +1

    Anyone knows or uses processing for android i really need help with a issue
    Dani?

    • @TheCodingTrain
      @TheCodingTrain  4 роки тому

      Did you try posting at discourse.processing.org?

  • @thefreeze6023
    @thefreeze6023 4 роки тому +17

    And the day where Dan finally used Vanilla JS...
    Has not yet come... :(

    • @TheCodingTrain
      @TheCodingTrain  4 роки тому +5

      take a look at ua-cam.com/play/PLRqwX-V7Uu6YxDKpFzf_2D84p0cyk4T7X.html !

    • @SimonTiger
      @SimonTiger 4 роки тому +1

      What do you mean by vanilla JS... ES6? He used that already in 2017!

    • @thefreeze6023
      @thefreeze6023 4 роки тому +4

      @@TheCodingTrain yes but it would be nice to see you do other things without libraries too.

    • @RedStoneArchitekt
      @RedStoneArchitekt 4 роки тому

      @@thefreeze6023 agreed

  • @michalbotor
    @michalbotor 4 роки тому +3

    (25:06) train is coming!

  • @cleam7840
    @cleam7840 3 роки тому

    can we add some FFt+windowing to this stuff

  • @agentNirmites
    @agentNirmites 4 роки тому +1

    Which mac does he has ?

  • @MidnightSun-Gaming
    @MidnightSun-Gaming 4 роки тому

    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.

  • @richardsantos20able
    @richardsantos20able 4 роки тому +1

    Make a video: How interact with 3d objects
    Pleasse

  • @asaa2831
    @asaa2831 4 роки тому

    Visualization is complex work

  • @thatsnuts8935
    @thatsnuts8935 4 роки тому

    love you ❤

  • @thewarhammer6606
    @thewarhammer6606 3 місяці тому

    Remake this please. It doesn't work in Chrome launching it from my local computer

  • @DejenTeklit
    @DejenTeklit 4 роки тому

    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!

  • @harshaaddanki4606
    @harshaaddanki4606 3 роки тому

    35:54 Instead if jsDelivr i can get a url straight from github

  • @arf20
    @arf20 4 роки тому

    They could just decompose the complex wave in to a spectrum (relative amplitude over frequency), and return the pitch of the highest amplitude point

  • @geoffwagner4935
    @geoffwagner4935 10 місяців тому

    a little Arduino and a motor, someone could just let this tune it for them lol xD

  • @anupamnavy
    @anupamnavy 4 роки тому

    Can you do a video of a Guitar Tuner Too?

    • @davidaaronliraricardez8729
      @davidaaronliraricardez8729 3 роки тому

      It's basiclly the same principle but in the object array put the guitar strings frequency =D

  • @someguy007
    @someguy007 4 роки тому

    Can u please learn us how to do in Java?

  • @Yoshie_2000
    @Yoshie_2000 4 роки тому

    Where's the rubics cube?

  • @weewoo341
    @weewoo341 4 роки тому +1

    Conv. REpr. Pitch. Estim. : *exist*
    Me as a french : *The crêpe from la Breatgne ?*

  • @Erik444x
    @Erik444x 4 роки тому

    tremendo xD

  • @m.taopik_
    @m.taopik_ 4 роки тому

    Pro

  • @starmaq3013
    @starmaq3013 4 роки тому

    3rd

  • @omkarbadhe421
    @omkarbadhe421 4 роки тому

    Learn the quick sort please sir please

    • @clipi_
      @clipi_ 4 роки тому

      What do you mean?

    • @omkarbadhe421
      @omkarbadhe421 4 роки тому

      @@clipi_ quick sorting example

    • @clipi_
      @clipi_ 4 роки тому +1

      @Omkar badhe ua-cam.com/video/eqo2LxRADhU/v-deo.html
      Thats a video of the quick sort algorithm by Dan (The Coding Train)

  • @kamilguchowski2793
    @kamilguchowski2793 4 роки тому

    Jej

  • @walney2008
    @walney2008 3 роки тому

    please speak game guitar hero, convert midi json, notes durations songs, please

  • @zeegrey3447
    @zeegrey3447 4 роки тому

    I need someone to help me code an azure kinect for a project.
    I cant share my idea if there is someone hmu.

    • @Stabby666
      @Stabby666 4 роки тому

      "I've got a super secret idea - I just need someone to do all the work" - good luck 🤣

    • @zeegrey3447
      @zeegrey3447 4 роки тому

      Thats the whole plan

  • @vilkillian
    @vilkillian 4 роки тому

    i more like to pronounce this like "K REE PEE"

  • @Lixxide
    @Lixxide Рік тому

    crepe

  • @budibudicooks
    @budibudicooks 4 роки тому

    4th

  • @SimonTiger
    @SimonTiger 4 роки тому

    ALL SECRETS ARE REVEALED WITH DAN'S UKALELE :):):)))))

  • @ElBoboMan
    @ElBoboMan 4 роки тому

    75th banana

  •  4 роки тому

    Well, duh.

  • @abhishekkattimani1302
    @abhishekkattimani1302 4 роки тому

    Sir make candy crush game