Turn Arduino Uno into a Class Compliant MIDI Device

Sdílet
Vložit
  • čas přidán 27. 12. 2020
  • Homebrew:
    brew.sh/
    mocoLUFA Repository:
    github.com/kuwatay/mocolufa
    Windows Executable:
    sourceforge.net/projects/dfu-...
    Original Arduino Uno Hex:
    github.com/arduino/ArduinoCor...
    Follow me on SoundCloud:
    / corvusp
    ^^
  • Hudba

Komentáře • 69

  • @woosix7735
    @woosix7735 Před 2 lety +1

    clean tutorial! love it

  • @jebimasta4604
    @jebimasta4604 Před rokem +1

    This is so niche, I love it. I've currently got an Arduino Uno running a strobe controller with 9 buttons, 3 bpm values and 1, 2, or 4 flashes per beat. I'm hoping to cut that down to 3 buttons and have the arduino pull the current bpm from my DJ software. Wish me luck!

  • @samuelsenigl
    @samuelsenigl Před 6 měsíci

    I spend looong time googling the solution....but this video was the best one!!!!!

  • @leandroconejo
    @leandroconejo Před rokem

    Great Tutorial !!!! Gracias!

  • @pouisjude4431
    @pouisjude4431 Před 3 lety

    Legend

  • @martingrieco
    @martingrieco Před rokem

    life saver

  • @adinwalls
    @adinwalls Před 2 lety +1

    Okay so now that I have got my Uno to be midi compliant none of the usb midi codes will upload to the board - what do you recommend? I am trying to make something to connect to me ipad.

    • @CorvusPrudens
      @CorvusPrudens  Před 2 lety +1

      Did you put a jumper on to set it to serial mode? By default, it'll just show up as a MIDI device which can't be programmed with the Arduino IDE.

    • @adinwalls
      @adinwalls Před 2 lety

      @@CorvusPrudens yes I am programming it but once it is programmed it does not seem to register with my device. I am trying to get it to send midi notes to my iPad.

    • @adinwalls
      @adinwalls Před 2 lety

      @@CorvusPrudens hey there I am about to give up on this. If you or anyone can guide me in building a MIDI footswitch that sends note messages to my iPad to control my backing track app I would be so grateful.

    • @gguitarwilly
      @gguitarwilly Před rokem

      @@adinwalls Use a midi library and use a five pin midi port and a midi to USB cable. Your Arduino won’t be native midi, the cable will take care of that. works fine with PC and iPad

  • @stevanastardust8487
    @stevanastardust8487 Před 8 měsíci

    The bridge is also known as a 2.54mm shunt if you need to get it on it's own

  • @willemfeltkamp5314
    @willemfeltkamp5314 Před rokem

    I imported a midi library into the Arduino IDE and I am now able to use my homemade midi keyboard using a midi to usb cable both on PC and Ipad.
    That seems easier. But you need the midi to usb cable.

  • @Lugubrisimo
    @Lugubrisimo Před 3 měsíci

    I have an Arduino Uno, but when I try to convert it into MIDI or Mocolufa, it doesn't allow me, and I noticed it says CH340. My question is if it can be used to create a MIDI controller since I have the code created with 4 potentiometers, and it works with the program. However, when I use it in my DAW Reaper, it doesn't recognize the potentiometers as MIDI or doesn't assign each potentiometer to the DAW.

  • @kayocastan944
    @kayocastan944 Před 2 lety

    Thank you, using your video i finally make the arduino shows as a midi device. One question that i don'tknow if you can help me, using in arduino mode, with the bridge and Hairless Midi Serial, all buttons and the potentiometers works fine, but in Midi mode, without the bridge, the buttons don't work and the potentiometer keeps sending the signal to multiple channels so i cant control one fader with it.
    The problem maybe the code ?

    • @CorvusPrudens
      @CorvusPrudens  Před 2 lety +1

      How are you testing the buttons and pots? The bridge should only affect the 16u2 (and not the main processor), so the code should run exactly the same way. If you're testing with the serial monitor, then that won't actually work in midi mode (since the device is no longer seen as a serial device on a COM port).
      Are you sure you're sending properly formatted midi messages?

  • @efeceele.official
    @efeceele.official Před rokem +1

    Hi, thanks for this, it is great! what arduino MIDI library do you recommend to work after turn it into Class Compilant MIDI Device?

  • @gypsyofcruzz200
    @gypsyofcruzz200 Před rokem

    Hi bro, great channel. Do you have any solution for ARM processors with Monterey ??

  • @ultimatesheep
    @ultimatesheep Před 9 měsíci +1

    Do you mind helping after 2 years? the problem I have is that I've already flashed already but when I try to upload to the board, I can't. I've already switched to the dfu mode but the ide still doesn't recognize it

  • @adelderderder
    @adelderderder Před rokem

    i got restarting laptop utomticly when erasing and flshing (atmega16u2), and in device manager the port name still "arduino uno", how to fix that??

  • @MZump1
    @MZump1 Před rokem

    Great Job!!
    The only issue I have met is that sometimes the Arduino is seen by my Mac as....an Arduino UNO ;-) instead of a MocoLUFA device. Do you have an idea why, after it worked fine for a week, it is seen sometimes as an Arduino board and sometimes as a MocoLUFA? I don't do anything, but it have this behaviour.
    And it is not a damaged board because the issue appears on a couple of Arduino UNO boards
    Thanks!!

    • @CorvusPrudens
      @CorvusPrudens  Před rokem

      Well, the USB class detection mechanism is just that pin that you can put a jumper on. Maybe there's some electrical interference going on there? Try tying it directly high or low depending on what firmware you want and see if that does anything.

  • @ricky-oj2ji
    @ricky-oj2ji Před 2 lety

    hi! when i try to run the executable in the command box, it says libusb0.dll is not found. have any idea whats up? thanks!!

  • @ClementsAudio
    @ClementsAudio Před 2 lety

    Thanks for the video! I am having "no device present" when trying to erase my atmega16u2 in cmd prompt on Windows 10. I've tried to reset the arduino a rew times and it still says no device present. Device Manager sees the arduino connected in the Ports (COM & LPT) as "Arduino Mega 3560 (COM3)

    • @CorvusPrudens
      @CorvusPrudens  Před 2 lety +1

      Hm, sounds like the 16u2 isn't actually getting reset. Before erasing, you'll have to ensure that it shows up in device manager as "ATMEGA16U2 in DFU mode" (or something similar). If you're still seeing the regular Arduino device, then you won't be able to erase or flash it.
      Just to be clear, resetting the whole Arduino won't get the 16u2 into DFU mode. You specifically have to reset the 16u2 while the Arduino is powered.

    • @ClementsAudio
      @ClementsAudio Před 2 lety

      @@CorvusPrudens Thanks a ton! I was able to finish the cmd prompts that you walked us through. How do I put it in midi mode? After the cmd prompts, I opened a few DAWs but could not see any new midi devices in the midi menus.

    • @ryanpires10
      @ryanpires10 Před 2 lety +1

      as you did? in mine the same error message appeared “no device present”

  • @angelbergjosue8580
    @angelbergjosue8580 Před rokem +1

    why i cant download the DFU 7.2 zip?

  • @s.zendar
    @s.zendar Před 2 lety

    Hey, I have the issue that even though I reset the 16u2 I get the no device Present every time I tried to erase it do you know of any posible causes for that? would be great if you could help me to get that thing runing.

    • @s.zendar
      @s.zendar Před 2 lety

      I found that the problem was the libusb I was using but thank you anyways for the great video

    • @CorvusPrudens
      @CorvusPrudens  Před 2 lety

      Nice! Yeah libusb can be troublesome.

  • @DavcomBass
    @DavcomBass Před 2 lety

    That’s great ! However a Leonardo is just cheaper and does it automatically

    • @leandroconejo
      @leandroconejo Před rokem

      Only for smaller projects, Leonardos ram and pins are very limited.

  • @TheJavaSync
    @TheJavaSync Před 2 lety

    Is it work to arduino clone with ch340? & windows7

    • @CorvusPrudens
      @CorvusPrudens  Před 2 lety +1

      This process won't work with the ch340 (windows 7 ought to work just fine, though). The ch340 is a purpose-built USB to UART converter, meaning it can't easily be repurposed into a MIDI device. The atmega16u2 is a general purpose microcontroller (like the ch341), so you can load whatever firmware you want on it.

  • @sergioalmeida1757
    @sergioalmeida1757 Před 3 lety

    How can i change the name from the mocoLufa to the name from my controller ?

    • @CorvusPrudens
      @CorvusPrudens  Před 3 lety

      Hey! So, there's a couple ways to do this. The easy way is to go to moco-lufa-web-client.herokuapp.com/#/ where you can very simply change the name, manufacturer, and PID of the resulting hex. The hard way is to follow the mocoLUFA's instructions in inserting the source into LUFA and using make to generate the hex. I've tried this before, but even on Linux I ran into issues with dependencies.
      If you only want to change the name of the MIDI mode, then the link above works great.

  • @Eefiscat
    @Eefiscat Před 3 lety

    hey, after typing in dfu-programmer --help on my windows pc, it comes up with an error saying it can't start correctly. I'd really love some help on how to fix it. thanks

    • @CorvusPrudens
      @CorvusPrudens  Před 3 lety

      Hey there! So, what exactly did it say? Was that Windows saying it couldn't open the program correctly, or dfu-programmer itself? A screenshot would help if you can get that.

    • @Eefiscat
      @Eefiscat Před 3 lety

      @@CorvusPrudens oh don't worry, I believe I managed to fix it. I'll comment again if that isn't the case. Thank you.

    • @Buildings1772
      @Buildings1772 Před 2 lety

      @@CorvusPrudens Im getting an error opening the DFU programmer on windows here it says
      "The code execution cannot proceed because libusb0.dll was not found. Reinstalling the program may fix this problem"

    • @DudawarEcomandos
      @DudawarEcomandos Před 2 lety

      @@Buildings1772 I had the same problem

    • @Buildings1772
      @Buildings1772 Před 2 lety

      @@DudawarEcomandos I think i fixed it by downloading each file it said was missing from the internet and placing it where it needed to go.
      was a few files.
      has been a while so i might be wrong

  • @rospie
    @rospie Před rokem

    Hello man, clean tutorial, but when I try to flash the atmega chip, it says this:
    Checking memory from 0x0 to 0x167F... Empty.
    0% 100% Programming 0x1680 bytes...
    [>>>>>>>>>>>>>>>>>>Device is write protected.
    X ERROR
    Memory write error, use debug for more info.
    Any ideas? I'm following the Mac method...

    • @CorvusPrudens
      @CorvusPrudens  Před rokem

      It looks like an internal fuse is written (device is write protected). There might be ways to change that with the dfu tool, but I've never had to do that before

    • @rospie
      @rospie Před rokem

      @@CorvusPrudens dang it… i have a spare board lying around, i’ll try it with that, but first i’ll use it to reset the first one to its factory state

  • @danmarshall3089
    @danmarshall3089 Před rokem

    how do a porgram it

  • @alonsoblancodcc
    @alonsoblancodcc Před rokem

    Hey can you please share the .exe please, it is not in the repository anymore u.u

  • @paki26th36
    @paki26th36 Před 2 lety

    So now i can make myself a piano/drum with arduino uno atmega328 ?

    • @CorvusPrudens
      @CorvusPrudens  Před 2 lety +1

      Sample playback tends to be pretty hefty for embedded processors, so a piano might be difficult to get going. Also the arduino uno doesn't have real analog outputs, so any samples you did play wouldn't sound great. Of course, you could always hook up a DAC, but you'd struggle to get anything out of the arduino at a reasonable sample rate.

    • @paki26th36
      @paki26th36 Před 2 lety

      @@CorvusPrudens sorry , i meant arduino uno atmega328

    • @CorvusPrudens
      @CorvusPrudens  Před 2 lety

      Haha yeah that's even harder! It's difficult to get a good piano player even on an STM32H7 (running at 480 MHz). Plus, the maximum storage for a 328p is 64KB (I think). You could maybe fit one sample XD

  • @manassehabraham5589
    @manassehabraham5589 Před 3 lety

    Is it the same step for Arduino mega

    • @CorvusPrudens
      @CorvusPrudens  Před 3 lety +1

      The Mega uses the same 16u2 for USB connectivity, so the process should be pretty much the same.

  • @markowen2243
    @markowen2243 Před 2 lety

    libusb0 error for me on windows 10. Frustrating!

  • @lilyung4584
    @lilyung4584 Před 2 měsíci

    argh my daw is able to recognise that its a midi device, but the arduino ide is longer able to upload sketches onto it :(

    • @lilyung4584
      @lilyung4584 Před 2 měsíci

      it works! for some reason i ran into issues with uploading onto a clone mega328p. i tried the steps on a clone mega2560. i thought i had bricked them both, leading me to an arduino stack exchange post by nick gammon on 'Have I bricked my Arduino Uno? Problems with uploading to board'. I ended up using one of his sketches "atmega bootloader programmer" and reinstalled the bootloader for atmega328p. after that i could upload sketches again. i then followed your steps again for dual booting. i can now easily swap between the normal mode and midi mode. took me a couple hours but i hope my comment saves time for some one! especially for those who own cloned boards!

    • @lilyung4584
      @lilyung4584 Před 2 měsíci

      i was able to fix this by reprogramming the bootloader (nick gammon on stackexchange post on have i bricked my arduino) then flashing mocolufa

  • @SubhamCreative.613kviews

    I want to hack 16u2 to midi class compliant.
    But your video confused me can you please make separately video for only windows. please

  • @natodemelo
    @natodemelo Před 2 lety

    I have a code that sends MIDI through Hairless, everything works fine with any DAW, after the new firmware do I need to change something in the code?
    my sketch
    void loop() {
    MIDI_TX(144,30,64); //noteON
    delay(1000);
    MIDI_TX(128,30,64); //noteOFF
    delay(1000);
    }
    void MIDI_TX(unsigned char MESSAGE, unsigned char PITCH, unsigned char VELOCITY) {
    status = MESSAGE + midichannel;
    Serial.write(status);
    Serial.write(PITCH);
    Serial.write(VELOCITY);
    }

    • @natodemelo
      @natodemelo Před 2 lety

      I tested it and it worked, same code I used with hairless, but in Serial.begin() you have to put the speed in 31250 baud. getting Serial.begin (31250).
      Thanks

    • @CorvusPrudens
      @CorvusPrudens  Před 2 lety +1

      Yeah that would be the one thing I'd think to check. Glad it just worked otherwise, though!

    • @lupe_g2
      @lupe_g2 Před rokem +1

      @@natodemelo Holy shit thank you so much