How to send data between Ableton and Arduino/Teensy/ESP32 via USB

  Переглядів 9,187

MoThunderz

MoThunderz

3 роки тому

In this tutorial I show how to create a MIDI-like data link between Ableton (with Max for Live) and Arduino-compatible hardware (Arduino, Teensy, ESP32, etc). In the example an 8-bit control and a 16-bit value is sent from Ableton to the Arduino and then echoed back. This code can be used for controlling Ableton from an Arduino or vice versa.
Setup:
Ableton 10
Max for Live 8 (M4L - Cycling74)
Arduino Due
Code: github.com/mo-thunderz/Arduin...
The interface is part of the ADSR+LFO solution used in my previous demonstration:
• Arduino based LFO+ADSR...
See as well my other videos:
Tutorial Max for Live to Arduino communication: • Max for Live (Ableton)...
Arduino-based ADSR: • How to create an ADSR ...
Arduino-based LFO: • How to create a low fr...

КОМЕНТАРІ: 42
@Belquer
@Belquer Рік тому
Man, congrats! Really well throughout, nicely paced and clear. Thank you!!!
@mothunderz
@mothunderz Рік тому
Glad it helped!
@killman007
@killman007 3 роки тому
keep them going man! these videos are the best I found in 3 months of research about the subjects you treat ! thanks a lot !!
@mothunderz
@mothunderz 3 роки тому
Thanks a lot, will do!
@maxbursell3513
@maxbursell3513 3 роки тому
agree. Content of this topic is very very limited on youtube witch makes it a bit harder to figure out, an learn. Thank you mo_thunderz for doing this!
@BrooseWayniac
@BrooseWayniac Рік тому
so great! just commenting for your channel to grow! I luv it!
@mothunderz
@mothunderz Рік тому
Thank you so much!!
@C4Par1
@C4Par1 3 роки тому
Great video, thank you!
@mothunderz
@mothunderz 3 роки тому
Glad you liked it!
@ethancohnmusic
@ethancohnmusic 9 днів тому
Hi, thank for the video! I'm trying to implement this with an MPU 6050 accelerometer, sending data from an ESP32 through serial to ableton, which is then mapped to audio effects. What would you recommend changing in your code? I'm having trouble understanding how to communicate directly from arduino to ableton, rather than vice versa.
@bencolemanart
@bencolemanart 3 роки тому
Hello there, thanks for making this code and tutorials available! I'm a beginner here, and thought this might be useful for anyone else trying to compile the sketch for an ESP32 module- you have to define the built-in LED (in this case, I included #define LED_BUILTIN 2 in my code).
@mothunderz
@mothunderz 3 роки тому
Thank you very much for this addition! I have added it in the example code online.
@ceciliefangjensen9258
@ceciliefangjensen9258 Рік тому
Thank you for such a nice video! Do you know if it is also possible to connect a water sensor to the whole thing? Im new to both Arduino and ableton
@mothunderz
@mothunderz Рік тому
Thank you for your feedback. Yes, of course you can connect a water sensor, or any other sensor, to the Arduino and interface with that. Just make the water sensor work first with just the arduino and after that send information from the sensor through the interface to Ableton
@Enoltra
@Enoltra 2 роки тому
Hey, thank you for teaching us awesome things! I have a problem doing this with my ESP32. The only thing that I see hapening is the built in led flashing when I turn the send value knob, but I see nothing in receive. I made sure the baud rate is the same for both things and tried both serial a and b in MAX. Do you have any idea why this is hapening? I wrote a small program to control a filter in ableton- the max patch alone works and the arduino code has erros, but I can't connect the 2 things together (code and music).
@mothunderz
@mothunderz 2 роки тому
It is a bit tricky debugging like this, but the one common mistake is that the serial port is already "taken" on your PC. If you load the M4L plugin in Ableton, make sure you dont connect that one to the serial port if you want to open the M4L editor. Then in the M4L editor you should be able to connect to the ESP32. Did you try to run the final code I shared on Github? That should work... Good luck with your project!
@Enoltra
@Enoltra 2 роки тому
@@mothunderz hey! In the meantime I figured it out and managed to build my own custom patch for automation with sensors, it works :)
@wirl940
@wirl940 11 місяців тому
amazing project. i've successfully connected a teensy and i've been returning values to an lcd screen. it works mostly well however it keeps bouncing to the highest possible value (65535) unless the ableton value knob is actively moving. any ideas why? thanks!
@mothunderz
@mothunderz 11 місяців тому
That sounds to me like a "Max-for-live" problem. There are many ways to solve it. You can for instance only send a new value when the value changes and keep that value locally in your Teensy to show on the LCD screen. If you want to solve the problem in max-for-live, I recommend using the "print" function a lot to see where the highest value comes from. My bet would be that the knob in ableton needs to be triggered to give the current value with a ping or something like that. However, that is a bit tricky to say without seeing the code. Hope you can figure it out!
@olamideabatan9579
@olamideabatan9579 Рік тому
quick question , does this also work for ableton intro ? or strictly suite?
@mothunderz
@mothunderz Рік тому
I have not tried with Ableton Intro, but as long as it includes Max for Live you should be fine.
@erich1394
@erich1394 6 місяців тому
Can we do audio rate modulation? I'm considering asynchronous CV via arduino.
@mothunderz
@mothunderz 3 місяці тому
I have not checked lately, but the Ableton Arduino interface that I use here was not fast enough for passing audio. I have not checked though what additions were added since about a year.
@maukaman
@maukaman Рік тому
Hello! I have been dreaming of a project that would allow for a synth sound to be played and the pitch be changed with an analog signal. What I want to do is to add custom sounds to my electric motorcycle that will change to match the throttle signal, making it sound like a cool futuristic machine as well increasing safety when riding near cars and pedestrians. I am still a bit of a noob when it comes to programming but this seems like it could potentially be a good beginner’s project. I have a couple ESP32 boards and was hoping these will work for my project, I’m just having trouble finding the right direction. If I had MIDI files of the sound I want to play would this be the best way to go? I’m really hoping I can get some help to at least get pointed in the right direction, hopefully I described my idea in a way that is understandable. Any suggestions?
@mothunderz
@mothunderz Рік тому
Sounds like a fun project to me. First of all: a MIDI file itself does not contain a sound. A MIDI file only has the information of which note is played when. For your project there are many ways to realize it, it really depends on what kind of sound you want to have. Here some options: 1) you can make a VCO (voltage controlled oscillator). This is basically what old Synths are based on. The tone goes up with higher voltage. However, just a VCO might not be too pleasant to listen to in the long run. The sound of just the VCO can be quite dominant. 2) you can create a sound from the ESP32 directly. However, this also will be just a simple sine, square wave or so. Also this might not be too pleasant to listen to 3) you could use a sampler and upload a .WAV file to it. Then you can play that sample at different speeds -> different tones. The best platform to do this on is Teensy, not ESP32, but I googled a bit and it is possible to do it on the ESP as well: ukposts.info/have/v-deo/mWlkaq2FnqqUs3U.html Hope this helps. Good luck with your project!
@maukaman
@maukaman Рік тому
@@mothunderz thank you for the reply! I have considered the option of using a sampler with a wav file and using a pitch bend, that might create the effect similar to what I’m looking for and would allow for testing lots of different sounds I would LOVE to be able to replicate the wonderful synthesized motor sounds I found in a really awesome app called OTOTETSU, which synthesizes different types of real and imaginary sinusoidal motors (definitely worth checking out). My idea with using MIDI was that I could feed my favorite motor sound from that app into a program that would map it into a series of Midi notes, then I thought I could play through that “scale” with the throttle signal on the bike. I imagine all this would take some work though. Still not 100% sure if the ESP32 would be able to play those MIDI files as sounds, seems possible though? I already emailed the developer of OTOTETSU, and while they said they really enjoyed the idea, they weren’t able to provide any sound files or MIDI files, which is why I considered feeding the sound into a program to map the sound into a series of MIDI notes.
@mothunderz
@mothunderz Рік тому
I dont fully understand the setup you want to create. But yes, the ESP32 can of course create MIDI notes. The easiest platform for midi is Teensy IMO, but ESP works as well. Pls post a video if you manage to make this device :-)
@10to4
@10to4 Рік тому
Hi, thanks for this video. Does it work on ableton 11 too??
@mothunderz
@mothunderz Рік тому
Yes it does, I use Ableton 11 myself as well in the meantime.
@10to4
@10to4 Рік тому
@@mothunderz Oh! Thank you !! ;)
@maxbursell3513
@maxbursell3513 3 роки тому
Hi mo_thunderz. Im doing a projekt with an arduino. the only thing i want is the arduino to receive a square-wave replated to the tempo in ableton. a have build a electronic circit with lights. How can i do this in the most easiest way? Thanks a lot
@mothunderz
@mothunderz 3 роки тому
Hi Max, you could in essence use the code of my ADSR+LFO below. ukposts.info/have/v-deo/gJxoopWGmX1kqKM.html Github: github.com/mo-thunderz/ArduinoAbletonLfoAdsr This is synced to Ableton and by either using the sync output or setting the ADSR to block shape you can directly control your LEDs. However, the code as is is written for the DUE as I was using its DACs. For LEDs you definitely dont need to use DACs and you can just use any PWM port. The adaption to standard PWM ports is relatively easy: // Code optimized for Arduino Due as it has a built-in DAC // For use on other boards just reduce the DACSIZE, // remove the analogWriteResolution(12) statement and write // to a different port for all analogWrite statements. But the code is a bit of an overkill as you wont need all these features. Let me have a look and I'll post some code focused on controlling LEDs soon.
@mothunderz
@mothunderz 3 роки тому
Made it easy for you, here is the code for just LED control: github.com/mo-thunderz/ArduinoAbletonLed/ Will add a UKposts video for explanation as well next week.
@maxbursell3513
@maxbursell3513 3 роки тому
@@mothunderz WOW! thank you so much. you put some much time into this. What i have done is. i have made a M4L device with toggle buttons. each buttons is sending there state via serial every time it changes state. And the state of the buttoms is controled with creating a square-wave in automation in the timeline. Ableton is hooked op to an UNO that read all the serial data. and sendes a pulse to an EPS32 equal to the square-wave cooming from the serialport. The ESP32 is then controling a LED strip configered in a matrix. the matrix will draw things based on, where ableton is in the timeline. and i can follow ableton because it is reading a pulse from the UNO that is created from the M4L device and send to the UNO via serial. The onlt problem im having is that, the EPS32 dont know where in the timeline ableton unless. The timeline in ableton and the ESP32 have been reset exatly at the same time. does it make sense? Maybe there is a smarter way to do it. i just havent figured it out yet. sorry for bad english. And thanks a lot for your help and advice.
@maxbursell3513
@maxbursell3513 3 роки тому
Is there a way to make the M4L device send out a number that is porpotinal to the timeline? e.g. (bar 1, beat 1) = 1, (bar 1, beat 2) = 65, (bar 2, beat 1) = 257 and so on. does it make sens?
@mothunderz
@mothunderz 3 роки тому
Why would you put an Arduino in series with an ESP32 and not communicate to the ESP32 directly? You can of course send information from Ableton with a push-button as well, but pls have a look at the LED control code I posted. In the M4L device you can see that I am sending the bar count and beat count to the serial port. Thus in my Arduino/ESP32 I get the exact location where Ableton is and use that to control some output ports. I hope you understand what I mean, but in case not, pls give me a few days, will upload a description video of the LED code.
@erende44
@erende44 2 роки тому
hi, what would you do to send more parameters from ableton via serial?
@mothunderz
@mothunderz 2 роки тому
@Soundprayer: hi, there are various ways to implement that, but the easiest way is to just send them sequentially. Please see this video in which I send various parameters from Ableton to the ESP32: ukposts.info/have/v-deo/jXN8ipufboSBqZc.html Another code example where I send very many parameters at the same time is here: ukposts.info/have/v-deo/gJxoopWGmX1kqKM.html Cheers, Sander
@erende44
@erende44 2 роки тому
@@mothunderz thank you, ill try
@erende44
@erende44 2 роки тому
@@mothunderz I did it - every value with different control bit. But - when playing automation from ableton, sometimes lights "jump" to different values for short time and blink. It happens in places they shouldn't. Had you same experience?
@mothunderz
@mothunderz 2 роки тому
@Soundprayer, from my experience, especially the Max For Live (MFL) part can be tricky to work with. If you see lights jump does MFL send out a comment to the Arduino or not? If it does then you know you have to debug the MFL code, if it does not, then it is the Arduino code you need to look into. There is one bug in MFL that you also need to take care off. This bug I describe in the video below from 11:22 through 17:40. Especially when you are changing many parameters at the same time, this is essential. ukposts.info/have/v-deo/gJxoopWGmX1kqKM.html So, pls carefully observe what MFL sends out to the Arduino at the time of the glitches and make sure you dont overload the serial interface with gating (as shown in the video). Hopefully you will be able to find the problem. Good luck!
Building a MIDI Controller Using Arduino
15:41
Switch & Lever
Переглядів 619 тис.
Teenagers Show Kindness by Repairing Grandmother's Old Fence #shorts
00:37
Fabiosa Best Lifehacks
Переглядів 33 млн
Мама забыла взять трубочку для колы
00:25
Даша Боровик
Переглядів 482 тис.
顔面水槽がブサイク過ぎるwwwww
00:58
はじめしゃちょー(hajime)
Переглядів 77 млн
Control Ableton Live with an Arduino Uno
11:44
Nathan Villicaña-Shaw
Переглядів 18 тис.
Making A $2000 Synth For $99
8:31
Edward Wang
Переглядів 243 тис.
What Is Arduino? What Can You Do With It? Explained
14:12
MakeUseOf
Переглядів 19 тис.
How to Make an Arduino MIDI Footswitch
24:05
Hacker Shack
Переглядів 64 тис.
Dupont Connectors - Quickly and easily make your own
4:48
DIY Machines
Переглядів 228 тис.
Max for Live (Ableton) with Arduino programming Tutorial - Part 1
38:59
How to use a Rotary Encoder with an Arduino - CODE EXPLAINED!
21:11
MoThunderz
Переглядів 28 тис.
The 5 BEST ARDUINOS for Building a MIDI CONTROLLER
9:26
Nerd Musician
Переглядів 77 тис.
Best OS for programming? Mac vs Windows vs Linux debate settled
8:40
OpenAI "SHOCKED" Everyone! Voice, Vision, & Free?!
8:58
Theoretically Media
Переглядів 10 тис.