MIDI for the Arduino - Reading MIDI CC Messages
HTML-код
- Опубликовано: 3 июл 2024
- Learn how to read MIDI CC messages with your Arduino then build a MIDI controlled light show as a demonstration!
Like my videos? Please consider supporting Notes and Volts on Patreon / notesandvolts
Visit Notes and Volts for downloads, program files, and more! www.notesandvolts.com/2015/09/... Хобби
less than 700 views?!?! these MIDI videos are the most concise and easy to understand that I've seen on the topic. Thank you!
I love that you go in details in how the things actually work
Brilliantly delivered information. Thank you!
Great series...! Very instructional, easy to follow...and great video finish here...!
+Jakob Hovman Thanks Jakob!
thanks for those precious learning, thanks for your code and channel..very useful for beginner like me, THANKS !
thank u so much for this!! just what i needed
EXACTLY what i needed. thank you
Thanks Nova!
Always top shelf. Thanks for sharing this.
Glad you enjoyed it
Thanks , just in time for what I was looking for !!!
Great videos !
+Omar Nelson Thanks Omar!
Any ideas on how to get this setup to work via USB ?
Omar Nelson For USB we will look at the Teensy. It's much better at USB than the Uno. I'm going to look at it after the MIDI for the Arduino series is finished.
Awesome !
Looking forward to seeing what's next, subscribed ...
Excellent !
great video!
Thanks Jason!
GREAT!!!
Great Video! I'm still getting to grips with the Arduino code, is there a way to keep the byte number the same, eg (22) but use the byte value to change from led to led?
So useful for me. Thanks man.
Thanks Ben!
Hi Dave, I'm just starting out with all this and I wondered if you could help me with a problem.
I've built the interface and I'm receiving MIDI from my DAW just fine. I'm using it to control LEDs in an RGB LED strip using the FastLED library.
My plan is to use one CC channel to control the LED strip's Red brightness, one CC to control the Blue, and one to control the Green.
I've got this working for up to two colours - with 2 CCs being automated in tracks the DAW. But as soon as I add a third CC track, the LEDs don't respond as I want them to. One of the colours won't change.
The only thing I can think of is that the processor isn't fast enough to receive 3 different CC instructions and send them to the LEDs in time before the next CC change information comes in. Does this sound right? Or would you expect the chip to easily respond to this in time?
If it is a speed issue can you suggest a solution? If you don't have time to write an exact reply, if could just give me a rough idea of what to google that would be super helpful. As I say, I'm very new to this.
Thanks so much again for these tutorials Dave, really appreciate it.
Ben
Just an update - I've been doing some debugging and I've found that if I nudge the each controller channel in my DAW very slightly it seems to respond much better. The issue seems to be if the exact midi cc message is transmitted from the same channel at the same time. I'm guessing that's too much information hitting the serial port at the same time. Does this sound right?
If you have any suggestions on how to combat that I'd be very interested... Thanks again.
Hi Ben. Are you using a Midi Library for your Midi code or are you reading the serial port directly?
I'm using the Midi library.
Hi Dave! Awesome video!!! I tried to build that circuit... and everything is fine when my DAW sends MIDI data, but the leds don't light up
Is there a way to read MIDI clock signals as well?
Great tutorial! Can you do a video to explain how to send/ receive midi SysEx with arduino? thanks
Hey There!
I'm looking at creating my own controller for Live Lighting for my band.
How would I go about controller RGB LEDs ?
If you have any material on this, that'd be sweet!
--Craig
Love the videos and the closest thing to what im looking for and i hope you know how i can do it. I need to control a machine with a squencer as its the best way to write the data for the machine. I can send a midi signal to control the machine but i need to get a clock signal into the sequencer so they are in sync. In midi I think there are 24 clock messages for each quarter note (“beat”) so if you send 48 tick messages each second that corresponds to 120bpm. I have no idea how to set this up in an arduino... The pulse signal from the machine can only be a open and close circuit. Can you help?
Hi! Your Videos are so cool!!! Can you make video about midi splitter? what should i do if i want to plug few midi devices into my sound card) ?
Nice! Maybe you should use Midi notes (witch LED) and velocity values (brightness) to control the LEDs. So you could play them via Keyboard. :-)
Great video!!! I have been working on trying to convert midi note data to led's. No conversion or drawing would be required. Simply play the tracks from finished songs and have easy light shows for every single track/song already finished.You are very close to this in the code you have written for this project. Would it just require a substitution of CC for note on? And separating by track #? Any chance you already have this code?
Great video!! My laptop does not have a MIDI port, so can I connect the MIDI input jack on the breadboard to my laptop using MIDI to USB cable?
Just a few questions, can this project be applied in boss GT-100 controlling a Laney IRT Studio amp? I'm planning to build an amp channel switcher using the midi functions of the Boss GT-100 for amp switching of the Laney IRT Studio :)
Great tutorial! I'm trying to implement this same sort of thing but I want to read MIDI notes and map them to some relays I have attached to digital pins on my Arduino. I've set the code up like this:
void MyHandleNoteOn(byte channel, byte pitch, byte velocity) {
switch (pitch){
case 60:
digitalWrite(R1,LOW); //Turn R1 on
break;
case 62:
digitalWrite(R2,LOW); //Turn R2 on
break;
case 64:
digitalWrite(R3,LOW); //Turn R3 on
break;
case 65:
digitalWrite(R4,LOW); //Turn R4 on
break;
case 67:
digitalWrite(R5,LOW); //Turn R5 on
break;
case 69:
digitalWrite(R6,LOW); //Turn R6 on
break;
case 71:
digitalWrite(R7,LOW); //Turn R7 on
break;
case 72:
digitalWrite(R8,LOW); //Turn R8 on
break;
}
}
// MyHandleNoteOFF is the function that will be called by the Midi Library
// when a MIDI NOTE OFF message is received.
// * A NOTE ON message with Velocity = 0 will be treated as a NOTE OFF message *
// It will be passed bytes for Channel, Pitch, and Velocity
void MyHandleNoteOff(byte channel, byte pitch, byte velocity) {
switch (pitch){
case 60:
digitalWrite(R1,HIGH); //Turn R1 off
break;
case 62:
digitalWrite(R2,HIGH); //Turn R2 off
break;
case 64:
digitalWrite(R3,HIGH); //Turn R3 off
break;
case 65:
digitalWrite(R4,HIGH); //Turn R4 off
break;
case 67:
digitalWrite(R5,HIGH); //Turn R5 off
break;
case 69:
digitalWrite(R6,HIGH); //Turn R6 off
break;
case 71:
digitalWrite(R7,HIGH); //Turn R7 off
break;
case 72:
digitalWrite(R8,HIGH); //Turn R8 off
break;
}
}
For some reason, the only pitch that triggers a relay is 60 (middle C). Any ideas what I'm missing?
THANKS!!
+Aaron Griffin Hi Aaron. I don't see anything obviously wrong with your code. As a test, you may want to set the first case to 62 for R1 and the second to 60 for R2.
If a 'D' note now triggers R1 you know that the keys are being read correctly and the problem may be in the other relays.
On the other hand, if a 'C' note now triggers R2 you will know that the incoming midi is at fault.
Good luck!
hi, did you find the solution? i have the same problem, only that i am using servos.
obrigado...
Very Nice work... It was cooller if you can convert the cde to a Esp8266 and have the capacity of read the midi files from a file. :)
Thank's for this great series but I have a question, how can I export the logic pro midi cc track to a midi file? I'm trying to do the same thing using my android smart phone and bluetooth.
+Sungho Her Hi Sungho. This is something I haven't tried but you can export Format 0 Midi files from logic which should include all data. How your software on the phone will treat the data is something you will need to explore. support.apple.com/kb/PH12960?locale=en_US
Hi, love all of your videos
Is there a way to have more PWM outputs on a single Arduino Uno
also can you do some LED Rotary encoders like the ones at Mayhew Labs?
Thanks Luna! There may be a way to turn a regular digital output into PWM via software - but this is something I haven't tried myself. You could also move to an Arduino Mega which has 15 PWM pins I believe.
Hey, with this set-up, is it possible to send midi note values from a DAW to the arduino? (I.e. is it possible to assign an LED to a note value so a pattern could be recorded on a piano roll? Great content, keep it up!
Hi Deus. Yes this is possible. You just need to change from Midi CC to Midi note reading. Check out this video for the basic idea ruclips.net/video/Twx0kzxXvp4/видео.html
can we use usb midi converter cable as usb midi interface?
2:22 I would not use MIDI to control stage lighting. It has its own serial control protocol - DMX512 (Digital Multiplex). See en.m.wikipedia.org/wiki/DMX512
Hi. Awesome project! Is this possible to make this LED fading effect using a expression pedal from a MIDI foot controller (ie. Voodoo Lab GCPro) with Arduino?
Thanx!
Thanks William! If the GCPro can output MIDI CC messages from the pedal it should work with no problem. You just need to find out the controller number that the pedal uses and program that into the arduino software.
Your videos are excellent. Please make a video about rotary encoder sending MIDI CC the Arduino to the PC ( for use in programs such as Traktor for example). Please help me.
Thanks MArd! It's on my to do list.
estoy esperando tambien el que nos enseñes un video sobre el codificador rotatorio para usarlo con arduino enviando mensajes midi para usarlo con traktor o virtual dj .... :D
Hey....im waiting.....lol...
@@geraldoribeiro9779 Here is the info for rotary.. Works fine for me in Traktor.
tttapa.github.io/Arduino/MIDI/Chap04-MIDI-Controller.html
Explicas muy bien. Muy buen ingles, entiendo todo lo que dices.
Is it possible do the same but with midi thought the usb?
by the way... the tx led on the arduino board blinks when DAW sends MIDI data, is that ok?
Maybe you know what potentiometers/knobs should be used to read midi input and set current position automatically? It's like APC40, Behringer BCR or any modern controller where is the light indication around the knob.
Hi Laimis. Those controllers use Rotary Encoders. Those are not supported by this code currently.
how to make midi DIN to usb adapter using arduino nano
or how to make a usb midi keyboard with velocity using arduino mega and old keyboard
i have a 49 key keyboard with a 15 pin midi DIN and i wanna found a solution to convert it to usb keyboard.
for the midi interfaces are not cheap in my country. the midi keyboards too. plz make a tutorial explaining how could i make this project
Thank's for this great series but I have a question, how can I use a push button like an arcade button to be my input and have as an output a midi note that can be played in a DAW, I want my arcade buttons to be like the keys from a midi controller.
+Daniel Tevi (Jizzy) Hi Daniel. The next videos in this series will cover constructing midi controllers.
Notes and Volts Awesome! Just in time, my parts are coming this week :D
Hello, very good project ,,, could you help me with a project of a midi hit hat pedal, the code is the original arduino mididrums example, but I want to install this sensor ultrasonic for the hit hat, thank you very much.
Can you use PWM to affect the samples used in MIDI playback?
no
Is it possible to display midi codes on a simple 16x2 LCD monitor and without using laptop display or any software there ??
What about doing this with RGB leds ?
I know this is an old video, but is it possible to send the MIDI data to the arduino over USB?
Nice Work! Thnx for the info on how to build and program. Started my project already :) Can it work with midi shield?
Thanks Paul. I haven't tested but it should work with a Midi shield.
@@NotesAndVolts I managed to read the midi cc trough USB using hairless.
Now my problem is as follow:
I want to run my dc motor (has an pot for position read)
I use the: www.amazon.de/Stereo-Potentiometer-2-Fach-Motorpotentiometer-Widerstand/dp/B07B41CYH8/ref=sr_1_3?s=ce-de&ie=UTF8&qid=1541074007&sr=1-3&keywords=motor+potentiometer
to go to desired (cc) value but the motor only "chokes".
I think its because the "byte value" does not have a "int" and when i tried to declare it it wont work :/
Any Ideas?
MY code:
#include
#include
#include
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(3);
MIDI_CREATE_DEFAULT_INSTANCE();
//static const unsigned ledPin = 13; // LED pin on Arduino Uno
int citaj = 0;
int controlerWert = 0;
void setup()
{
AFMS.begin();
myMotor->setSpeed(255);// Motor speed 0(stop) 255 (fast)
pinMode(13, OUTPUT);
MIDI.begin(MIDI_CHANNEL_OMNI); // Launch MIDI and listen to channel
MIDI.setHandleControlChange(MyCCFunction);
pinMode(A0, INPUT);
Serial.begin(9600);
}
void loop()
{
citaj = analogRead(A0); // reads the pot
controlerWert = map(citaj,0,1023,0,127);
if (MIDI.read()); // If we have received a message
}
void MyCCFunction(byte channel, byte number, byte value) {
switch (number) {
case 21:{
controlerWert > value, myMotor->run(BACKWARD);
//
}
}
}
ok. I managed to Control the motor from daw and daw from pot, only thing is that i can only control the motor in 1 step. when i fix this its almost complete :)
What if you wanted to do this with 30 leds
saludos! congratulations great video! could you sell me what´s the software program´s name you user in this video with lights midi arduino je! sorry i speak little english
+Alex Contek Hi Alex. The music software in the video is Logic Pro 9.
thanks! I´m like yours videos! como no los vi a antes I make yours proyects!
Hi Dave I tried via patreon this question : is this possible to multiplexe led like button and apply this method but with mux...? I don't have enough knowledge in code for the moment to figure out how to adapt this code to mux...
Hi, I need the same
Works perfectly on Arduino Uno !!! But nothing happens in Arduino Mega. Why ? I realign the outputs in your software for Arduino Mega (#define LEDPWM1 2, ....). But I got no result. Could you help-me please ? Thanks
fuckin siiick!!!
Thanks Mac!
I know you're a music guy but the background music is really distracting. You should lower the volume and use something a little less thumpy.
You're content is great, nothing else like it that I can find. So I suffer through. But it would be nice to not be distracted.
"First you'll need to watch my video on building a MIDI input circuit. To go there, click on the video or check the link in the description."
This is no working.
the playlist
ruclips.net/video/0L7WAMFWSgY/видео.html
can you shorten your logo video? please ? like seriously so unnecessary
If there's one thing people love to complain about, it's free content. Have you not seen the red line below the video that lets you skip the parts you don't want to see?