2# The MIDIUSB Library - MIDI Programming for the Arduino -

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

КОМЕНТАРІ • 57

  • @juliocosta5818
    @juliocosta5818 2 місяці тому +1

    And that, my friends, is how jazz was discovered :)

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

    Valeu Nerd! isso me ajudou a compreender como funciona a biblioteca, pretendo colocar-o em um órgão antigo que restaurei

  • @ClNoBody
    @ClNoBody 6 місяців тому

    Good stuff and helpful as I'm getting a Leonardo today to start prototyping.
    I disagree about using the noteOn function to turn off the note, especially when you have a noteOff function. Then you also have a comment when you shouldn't need one.

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

    I got in mind to create a node for a midi hub that keeps a copy of the simple script for the 16 channels plus editable globals of setups of the midi devices. This idea is a resolve so I do not have to pay for espensive subscriptions on my iPad for apps that do this. No knowledge on how to do that but that is what I have in mind. It seems a good resolve especially if I can extend the script over time so it becomes an app that facilitates other functions associated with my array midi devices.

  • @shulkerdragon8653
    @shulkerdragon8653 7 місяців тому

    Wonderfully explained!

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

    Excited for this one!

  • @dokmuoh33
    @dokmuoh33 2 місяці тому

    it is not straightforward that the code works with my teensy 4.0, i get an error, why? board is selected, usb port is selected, usb type midi is selected. code uploads but nothing appears in the serial monitor. also, the imported functions are generating some conflict apparently.

  • @lanphanh
    @lanphanh 18 днів тому

    Is the ESP32 work with MIDI-USB?
    Thanks!

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

    friend we got an arduino with dvs timecode feature in serato

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

    A great idea and implementation.
    I did the control on the Arduino Pro Micro. If this connect after Ableton Live (11) running, then everything works. If the device is connected before starting Ableton Live (11), then no commands work until the device is reconnected. Then everything is fine again. That is, Ableton does not see an already connected device. Can this be fixed?

  • @PhilippeCavalier38490
    @PhilippeCavalier38490 6 місяців тому

    hello so good video, but unfortuly
    i'm not avaible to understand correctly, arduino code. i need and want to make my personnal midi usb light console, like apc 40, running into sunlite suite software, who is DMX software.is this will cost me a lot of money to order you a complete running arduino code attached to a shematics i could design. hoping your answer. best regards philippe from france

  • @_just_looking_thank_you
    @_just_looking_thank_you Рік тому +1

    If a call to the flush function is required after each call to noteOn, why not simply embed a call to flush at the end of the noteOn function’s code?

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

      You want to call fliush as fast as you can after you get a read, so ideally every time hit a note. If you call at the end, imagine you have 100 buttons, you'll only hear that note you played after it finishes readin all the notes, besides it will play at the same time all the note you played during that loop.

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

      @@NerdMusician I meant, if you moved the flush INTO the noteOn function, at the very end of its. That would be functionally equivalent to where you’ve placed it, would it not? But you wouldn’t have to remember to use it whenever you call noteOn, as it would be built in.
      It’s been a while since my coding years, and this wasn’t a language I used professionally, so I may be making incorrect assumptions.

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

      @@_just_looking_thank_you Because USB work on packets, the data is first set in the buffer and when the Host request the data then is sended (remember, the host controller is also listening your keyboard, mouse, etc), that is why you can't send one-by-one because can increase the delay to wait the next request when you have to send multiple notes. By using flush() declare the data is ready to send and then force that.

  • @AnteroJunior
    @AnteroJunior 11 місяців тому

    Mano, tô usando uma esp32, uma placa Touch e somente 10ms de delay no loop, mas parece mais quando conecto com o FL Studio mobile. O que vocês tem usado? Com USB tem menos delay?

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

    Wow sounds great. Do you think the library I can have midi out AND midi in on the Arduino ? So then if I connect it to a midi cable usb on the arduino side and a split midi in/out cable to an instrument then I can send a command to the arduino interactivelly ?

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

      It can. I do teach how to do this inside my course. With this Arduino it's tricky because you have to use the MIDIUSB lib for the USB and the MIDI libr for the midi din, so two libs at the same time.

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

    Hi.! Where do i find all the functions for the MidiUSB library? Total Noob here, but i am watching your videos everyday and learing a lot.! Your videos deserve a hell lot more of views!

    • @Hoptronics
      @Hoptronics Рік тому +1

      Documentation for the library. Also you can look at the code to see what is available.

    • @rootsnoir9164
      @rootsnoir9164 4 місяці тому

      Did you ever find a list, I've looked everywhere and can't find anything.

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

      @@rootsnoir9164 I used chatgpt and figured out 🤣🤣

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

    Will you be talking about multiplexing in this video?
    I would really like to make a midi controller with 64 buttons.

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

      In this video no, only about the MIDIUSB lib. Multiplexers I cover in my course: www.musiconerd.com/making-music-with-arduino/

  • @user-ql5pq8oz1j
    @user-ql5pq8oz1j Рік тому

    Hi, is it running on arduino uno pls ?

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

    I can't find any model "usb midi class compliant' with 16 analog inputs or more .....
    Must i go on a impossible to find teensy or use a multiplexor ? seems terrifying

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

      Yes. haha You already know the answer. Teensy is easy though. And I teach how to use multiplexers easily in my MMwA course: www.musiconerd.com/making-music-with-arduino/

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

    Does anyone know if there is a way to change the USB MIDI device name? By default it’s always ‘Arduino Leonardo’. Would be good to change that.

    • @NerdMusician
      @NerdMusician  Рік тому +2

      I'll prob cover this in a later video but this: github.com/mon/Arduino-USB-Rename

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

      @@NerdMusician thanks for that link. I haven’t been able to get that code to work so far. Have the header and cpp files in the same directory as the ino file, and have added the include etc to the code, as it says to do in the readme. No errors when compiling, but no name change. Hmmm.

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

    Hi, have you done midi + osc for wireless controllers ?

    • @NerdMusician
      @NerdMusician  Рік тому +1

      I Onloy have used OSC with my phone with the TouchOSC app. I know one can use OSC with the Arduino too, though! I'll have to give it a try.

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

      @@NerdMusician Yes, it's something I'm looking forward to trying too! It could open many doors... although it may create delay, it may be worth trying... midi+osc... I would like to create my own osc interface... I don't know how yet but will try it out! I love your work man, it's awesome !! You're a big inspiration !!

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

    how to download the sketch, and the schematic, please help me

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

      Have you tried the link in the description?

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

    how can implement encoders??? and how can add some buttons ?

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

      is not so hard, this code i use interupt, you can delete interupt, but you may miss some pulses specialy if you rotate to fast
      // Rotary Encoder Inputs
      #define CLK 2
      #define DT 3
      #include "MIDIUSB.h"
      int counter = 0;
      int currentStateCLK;
      int lastStateCLK;
      void setup() {
      // Set encoder pins as inputs
      pinMode(CLK, INPUT);
      pinMode(DT, INPUT);
      // Setup Serial Monitor
      Serial.begin(9600);
      // Read the initial state of CLK
      lastStateCLK = digitalRead(CLK);
      // Call updateEncoder() when any high/low changed seen
      // on interrupt 0 (pin 2), or interrupt 1 (pin 3)
      attachInterrupt(0, updateEncoder, CHANGE);
      attachInterrupt(1, updateEncoder, CHANGE);
      }
      void loop() {
      //Do some useful stuff here
      midiEventPacket_t rx = MidiUSB.read();
      switch (rx.header) {
      case 0:
      break; //No pending events
      case 0xB:
      updateEncoder(
      rx.byte1 & 0xF, //channel
      rx.byte2, //cc
      rx.byte3 //value
      );
      break;
      }
      }
      void updateEncoder(byte channel, byte number, byte velocity) {
      // Read the current state of CLK
      currentStateCLK = digitalRead(CLK);
      // If last and current state of CLK are different, then pulse occurred
      // React to only 1 state change to avoid double count
      if (currentStateCLK != lastStateCLK && currentStateCLK == 1) {
      // If the DT state is different than the CLK state then
      // the encoder is rotating CCW so decrement
      if (digitalRead(DT) != currentStateCLK) {

      controlChange(1, 25, 127); // (channel, CC number, CC value)
      MidiUSB.flush();

      } else {
      controlChange(1, 25, 1); // (channel, CC number, CC value)
      MidiUSB.flush();

      }
      }
      // Remember last CLK state
      lastStateCLK = currentStateCLK;
      }
      void controlChange(byte channel, byte control, byte value) {
      midiEventPacket_t event = {0x0B, 0xB0 | channel, control, value};
      MidiUSB.sendMIDI(event);
      }

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

      ua-cam.com/video/9_dGC5XdQWc/v-deo.html I teach buttons here. Encoders I teach inside the course: www.musiconerd.com/nerd-musician-pro/

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

    Eu tenho um Arduino Uno e um shield USB host. Serve?

    • @NerdMusician
      @NerdMusician  Рік тому +1

      Arduino Uno funciona, mas precisa de umas gambiaraas a mais, então não aconselho e nem ensino mais a usar o Uno, só o Leonardo, Pro Micro e a família Teensy.
      A menos que seja o novo Uno R4!

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

      @@NerdMusician Valeu. Eu consegui fazer funcionar aqui, trocando o firmware do controlador da USB.

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

    First 🥇🏆😍

  • @MejoradoLopezJonathan
    @MejoradoLopezJonathan 3 місяці тому +1

    The code of the course, it doesn't work for the arduino UNO, needs an updated, because the pages is deleted, how can i make the compliant for arduino UNO

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

      Dude, you have the listen. He said, it's for Arduinos mit ATMega32U4 controller.... 😂

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

      @@eDrumsInANutshell in the course that i bought of NerdMusician, i don't speak of the video, but i dont found a place where can i put my comments in the course, and the video is related to the course and the comunication of the ATMEGA328 and the computer, for that i put my comment, learn to read

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

      @MejoradoLopezJonathan Learn to write! How could I know that you did a paid course?
      Hopefully, when I do a paid course, I have another possibility to contact him, then a tiny comment.

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

      @@eDrumsInANutshell You don't need to know, because my comment was for the author of the course, who is the owner of the UA-cam channel, because he didn't answer the emails, my comment was for him, not for just anyone like You🤷

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

      @@MejoradoLopezJonathan Aha, might all be true. But still... Weired thoughts, dude.

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

    How do you send chords?

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

      One note after the other without a delay. It sends so fast that you don't notice that it's not exactly at the same time.

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

    This library dispenses the use of a middleware such as Hairless MIDISerial / ttymidi?

    • @NerdMusician
      @NerdMusician  Рік тому +1

      Yes!

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

      ​@@NerdMusician Thanks! Very nice as well. I have used this Pro Micro on another project, a gamepad, but since then its was unuseful. Previously, MIDI project only with Arduino Mega.