I case somebody hasn't pointed it out: 1. You can use the open and close messages instead of switching the port symbol. It'll prevent error messages. 2. The zl group object gets initialized with a list length of 255, so the 100 argument is superfluous and constraining. 3. While 9600 is an ok baud rate for most applications, I'd recommend going higher, as the transmission speed will prevent latency when dealing with several data streams (sensors) or longer messages. Explanation: A message of 5 characters long (4 digits and the new line character) is 50 bits long. At a baud rate of 9600 bits per second, it takes 5.2ms to send 50 bits. So imagine you have 10 sensors, you take 52ms to send the whole data. Plus if you introduce spaces, index numbers or labels to route sensor data streams, it adds up pretty quickly. Depending on the application (triggering percussive sounds for example) 52ms or more will be very noticeable. At 115200 bps, the same 50-bit message will be sent within 0.434ms. My recommendation is to go to a higher baud rate (115200 or 230400 or even higher) from the start, to make latency as low as possible. The apparent "simplicity" of teaching people to use 9600 bps as a baud rate is not a sufficient argument in my opinion. One should favour low latency and scalability instead.
Amazing my dude! Been fiddling for a few weeks now and had major gaps in figuring out this very set of codes on max recieving communication from arduino., You've explain shiz pretty nicely! And the multiple sensor part, damn that is so cool! :) Thank you! now off to try this out
FM synth forever!! Yeah, a resource like this didn't really exist online back when I wanted to learn this stuff for the very first time. Everything I found felt convoluted. Btw, I followed you back on Instagram! I've been wanting to get into gen~ more so I'll check out your vids!! Your generative patches are amazing too!
Hi, Thank you so much for your video. I am trying to dynamically modulate the sound volume with the code you are showing in the video but I am not sure how to do it. Could you tell me how to do it if you can??
hello!; I'm testing the arduino connection with max for live, as shown in the video, but I can't enter max, it tells me: opening serial port error. I am using the arduino uno made in italy. with driver 2.0 I do not understand what the problem is.
Hey! Great tutorial! I wanted to ask how much do you know about other objects that can be connected to arduino and output values to max? I'm interested in simple mechanical buttons, switches and lcd display... thank in advance!
For button and switches, I made a video on it. For LCD display, that's mostly going to be dealt with in the Arduino IDE code. You could send values from Max to Arduino IDE and control the display and such. I made a video on how to send data from Arduino IDE to Max and back and forth.
Hey, amazing video, thank you so much!! Also wanted to ask, when you're working with FM Synth, how do I make the object of "p compression&reverb to connect with another object? thank you!!!
Hi, this is really great! Thanks so much for making this tutorial. I just have a quick question - will this work with the 'Max for Live' version of Max that comes with Ableton Live? Or do I need the standalone version of Max/MSP?
dud do you have a vid that stores pre-designed audio from Max/MSP onto an SD card so that there will be no need for a laptop when opperating like make the device independent, I would really love to see a vid of how to make that, and great vid btw
Hi ! So cool! Thanks for the time and effort. I'm wondering tho how to communicate multiple values from max to Arduino. To control multiple digital pins to light up LEDs.
Can I ask why the maximum value after fromsymbol object can not reach 1023? (And it will change like 1018 - 1022) Some unstable reasons? How to make it more stable.
Yes! You can map a footswitch (that's connected to an Arduino) to the toggle object in Max for example. And from there, you can just use [groove~], [record~] (?), and etc.
I recommend that you watch this video ua-cam.com/video/1J6tLOGn0dw/v-deo.html There are example codes online for HC-SR04 that you can reference! Good luck!
hey there! amazing video, very thorough! I've been trying to do the exact same thing with my arduino nano 33 ble sense but everytime i try to upload the code it's not correct. any chance you might know what steps i need to take with my nano to achieve this? i've noticed that the arduino i have is not on the avr boards list but on the Mbed OS boards (and the Mbed OS nano boards). Does the code need alterations? Sorry I am a beginner and all that stuff is really new for me. thanks
Hi John! Thank you for watching!! From what I gathered, BLE cannot do standard serial communication. There is a code by mhamilt on GitHub called "maxmsp-ble" that may work, but I don't have BLE to test this. Hope it works! I think buying the standard Nano may make your life easier. Were you thinking about doing wireless communication?
@@SoundSimulator Whoa that was fast! Thank you so much for your reply. Actually, I'm on a masters course of sonic arts and audio technologies and the whole class was instructed to buy this particular version because it's supposed to have everything we might need to make our projects without buying extra sensors. Also I was thinking about doing a project using the proximity sensor of my nano and transfer data from the sensor to max msp and control sound with proximity so i thought wireless was the way to go. In retrospect (and after realizing that most tutorials/code etc are using uno) i think i should have bought a standard one or a simple humble uno. I'm gonna go try the code you mentioned and see if it works. Again, thank you very much for your quick response. Keep up the good work!
Hi I'm really struggling with MAX/MSP, my print has no bottom connector to join up to the rest and Max has no recognition of the port functions. Has the "Port" command changed since the tutorial? Any help would be greatly appreciated!
Hi! Problem. I connected eight potentiometers and they constantly give out some random values to integer object in max msp, while I do not turn them. What is the problem? Thank you for your answer!!
@@SoundSimulator thank you for your answer. I’ll try it. Other questions: Is additional power required to connect eight potentiometers and 10 switch-buttons? May I contact you in any other messenger to consider my case separately? would be very grateful!
Hi ! I'm having trouble receiving data in Max/MSP, although my Arduino code and my patcher are the same as those you show in the video. The Arduino is sending data no problem to the serial console and plotter and I can see the right port in Max, I just dont receive anything. (Also, I can upload code to my Arduino with the toggle of the patcher still on, which you said was not possible.) What am I doing wrong ?
If you can upload the code while the toggle is on indicates that the connection between Arduino and Max is not happening. Please make sure that you're not missing any steps. It might be good to take some time away and then come back with a fresher mind as you might notice what you have been overlooking. Good luck!!
You have to make sure the IDE is closed. You can only have one serial monitor open at one time. Upload your code, before you toggle. close IDE, then toggle, you should see number in numbers object :)
Hey Great video, I cant seem to get max to read the knob value. the value is working on the serial monitor in IDE so I know the code and electronics are correct. the max patch is exactly like the one in the video, although I notices even when the max patch is toggled ON I could still upload code onto arduino uno without getting an error. any ideas why the number object isn't updating with the knob value?
First thing that I ask is: what Arduino are you using? If it's a clone, serial communication gets iffy. If not, make sure the right port is being used.
Hi Clara! That is a message object with the word 'print' typed in. Same goes for the 'port z' and 'port' message objects. Please feel free to let me know if you have any further questions! Have fun!!
Hello First , thank you for your video. Your video helped me a lot. But I have a problem. An error message shows in Arduino sketch stage. Error message is knobValue was not declared in this scope. What should I do?
Thanks for the tutorial! some problems: My max patch only connects to the serial port when I close arduino IDE, otherwise there will be an error saying "serial: error openning serial port". Although the code works well in Arduino (shows normally in Arduino's serial monitor), I can't receive any data in max, the value is always 10 (which is filtered by [sel 13 10].
Hey, thanks for tutorial. I have a problem: My port name is COM5. I have "specified port not available" attention and i changed the port name COM5 but still i dont see my port name on available list. I m trying to port z>port COM5 or print>port COM5 > port z. In Arduino my code is okay, analog is okay i havent error, port okay, too. And I m using to Arduino Uno Clone CH340. I dont think it can be driver problems because i can see in Arduino,i dont know.All is okay but i couldnt solved this port problems. Thank you. I m beginner, i hope i could explain my question im so sorry for my bad english :)
From what I remember of the Arduino clone, you have to download and install a driver in order to do serial communication with Max. It's been a while and I don't have one around to test. And Windows complicated things further. Did you install the driver yet? Sparkfun has tutorial on their website that looks good. Clone is cheaper but it does comes with a price like this unfortunately. Best of luck! Please feel free to ask questions any time!
@@respawn.x Thanks for the answer ! i'm actually using an official one (rp2040) but it seems that my computer doesn't allow access to my COM3 port via the serial object, i have tried with a pure data patch and have the same issu..
Hi there, great vid. When I press the toggle button I get an error message popping up saying "specified serial port not available" in the MAX console, just wondering if you have any ideas? Thanks
@@gregoralexander6202 Making progress! Are you using the official Arduino? And are you seeing the sensor value in Arduino IDE itself? You can DM me on Instagram btw. It's hard to debug here.
I did it all from watching your video, I need to combine some digital inputs, and also report back some LED flashes from the system. I think I saw you do more videos on these topics (Arduino Max). Thanks again.
Hi, I followed your tutorial but the number isn't showing anything. My serial on Arduino IDE shows the value and I changed the Port to my fitting port. Don't know what I am doing wrong. Using MAX For Live at the moment but unsure if that's the problem...
@@SoundSimulator Ah, yes using a knock-off Nano with an ATMega328P (Old Bootloader). Thank you for the quick response and a very well explained video. :)
@@TheRealPostpunker Gotcha! If you got it from Amazon, check out the reviews and see if they mention something about installing a driver. You most likely need to install a CH340 driver. Somebody had the same issue few days ago but installing the driver made it work!
@@SoundSimulator Got the new MacOS so it was not recommended. On the other hand I found out that M4L only outputs sound inside of Ableton which is unfortunate but makes sense. So now I gotta figure out how to get sound out of your patch inside Ableton. Unfortunately its not the ezdac~ object but a plugin and plugout combination.
Thank you so much, my friend and I were doing homework and the teacher's documents were not clear AT ALL. You're a lifesaver
Glad to hear that this video helped you and your friends!! :D
Thank you so much! Amazing and clear video! Now building my own synth and this is by far the most valuable Max/Pd tutorial I've ever watched
That's awesome to hear!!
I would love to check out what you're building. Please feel free to share!
That's the best video on the web to understand serial connection from arduino to max MSP. Congrats
Glad to hear it! Thank you, Eric!!
I case somebody hasn't pointed it out:
1. You can use the open and close messages instead of switching the port symbol. It'll prevent error messages.
2. The zl group object gets initialized with a list length of 255, so the 100 argument is superfluous and constraining.
3. While 9600 is an ok baud rate for most applications, I'd recommend going higher, as the transmission speed will prevent latency when dealing with several data streams (sensors) or longer messages.
Explanation: A message of 5 characters long (4 digits and the new line character) is 50 bits long. At a baud rate of 9600 bits per second, it takes 5.2ms to send 50 bits. So imagine you have 10 sensors, you take 52ms to send the whole data. Plus if you introduce spaces, index numbers or labels to route sensor data streams, it adds up pretty quickly. Depending on the application (triggering percussive sounds for example) 52ms or more will be very noticeable. At 115200 bps, the same 50-bit message will be sent within 0.434ms.
My recommendation is to go to a higher baud rate (115200 or 230400 or even higher) from the start, to make latency as low as possible. The apparent "simplicity" of teaching people to use 9600 bps as a baud rate is not a sufficient argument in my opinion. One should favour low latency and scalability instead.
Amazing my dude! Been fiddling for a few weeks now and had major gaps in figuring out this very set of codes on max recieving communication from arduino., You've explain shiz pretty nicely! And the multiple sensor part, damn that is so cool! :)
Thank you! now off to try this out
That's great to hear!! I'm glad that this video helped out. Have fun!!
Awesome! So many people struggle connecting Arduino to Max - awesome tute 👏 😎
Neat sounds too 👾
FM synth forever!!
Yeah, a resource like this didn't really exist online back when I wanted to learn this stuff for the very first time. Everything I found felt convoluted.
Btw, I followed you back on Instagram! I've been wanting to get into gen~ more so I'll check out your vids!! Your generative patches are amazing too!
the first argument to Serial.begin(), in this case 9600, is the baud rate of the serial connection, not a port number
Oops, you're right! My mistake.
Excellent work! Can't wait to start!
Have fun!!
Thank you for suggesting the book!
Hi, Thank you so much for your video. I am trying to dynamically modulate the sound volume with the code you are showing in the video but I am not sure how to do it. Could you tell me how to do it if you can??
You certainly can! Once the sensor value is in Max from Arduino, you can scale it (with [scale 0 1023 0.0 1.0]) and connect to [*~].
Thank you!! I tried with your program and I made it. Now I am making multiple analog sensor on Arduino. @@SoundSimulator
@@Reimitsuo That's great! Have fun :)
hello!; I'm testing the arduino connection with max for live, as shown in the video, but I can't enter max, it tells me: opening serial port error.
I am using the arduino uno made in italy. with driver 2.0
I do not understand what the problem is.
Hi I have the same problem, did you managed to solve it ?
Even as a non Max user I enjoyed watching the video
Thank you so much! I'm glad you still enjoyed it!
This exercise can also be done in pure data?
I love your videos
Thank you! I actually have a Pure Data tutorial of the same topic! Enjoy!
ua-cam.com/video/eVW0FD9g_Sk/v-deo.html
Hey! Great tutorial! I wanted to ask how much do you know about other objects that can be connected to arduino and output values to max? I'm interested in simple mechanical buttons, switches and lcd display... thank in advance!
For button and switches, I made a video on it. For LCD display, that's mostly going to be dealt with in the Arduino IDE code. You could send values from Max to Arduino IDE and control the display and such. I made a video on how to send data from Arduino IDE to Max and back and forth.
Hey, amazing video, thank you so much!! Also wanted to ask, when you're working with FM Synth, how do I make the object of "p compression&reverb to connect with another object? thank you!!!
Those are just my cheating by using external compressor and reverb VSTs :)
Hi, this is really great! Thanks so much for making this tutorial. I just have a quick question - will this work with the 'Max for Live' version of Max that comes with Ableton Live? Or do I need the standalone version of Max/MSP?
It should, I think!
I do have a license but using this technique works with M4L.
dud do you have a vid that stores pre-designed audio from Max/MSP onto an SD card so that there will be no need for a laptop when opperating like make the device independent, I would really love to see a vid of how to make that, and great vid btw
Hi ! So cool! Thanks for the time and effort. I'm wondering tho how to communicate multiple values from max to Arduino. To control multiple digital pins to light up LEDs.
This tutorial is what you may be looking for!
ua-cam.com/video/VYWQaqf6yL0/v-deo.html
hello ! whats inside the subpatch compression&reverb ?
hi!
those are external VSTs :)
Thank you so much for this. One question. How would you change this to use Arduino's digital INs?
Can I ask why the maximum value after fromsymbol object can not reach 1023? (And it will change like 1018 - 1022) Some unstable reasons? How to make it more stable.
You can smooth out sensor data! I actually made a video about that: ua-cam.com/video/RCHgQOPaT08/v-deo.html
Excuse me, sir. I was woundering... Is it possible to make a guitar loop pedal using arduino and Max?
Yes! You can map a footswitch (that's connected to an Arduino) to the toggle object in Max for example. And from there, you can just use [groove~], [record~] (?), and etc.
So simple! Thank you.
Of course :)
Very helpful video. Do you know how I could change the code to work with 6 HC-SR04 ultrasonic sensors?
I recommend that you watch this video ua-cam.com/video/1J6tLOGn0dw/v-deo.html
There are example codes online for HC-SR04 that you can reference! Good luck!
Great Tutorial, thanks!
Thank you for watching, Luis!
hey there! amazing video, very thorough! I've been trying to do the exact same thing with my arduino nano 33 ble sense but everytime i try to upload the code it's not correct. any chance you might know what steps i need to take with my nano to achieve this? i've noticed that the arduino i have is not on the avr boards list but on the Mbed OS boards (and the Mbed OS nano boards). Does the code need alterations? Sorry I am a beginner and all that stuff is really new for me. thanks
Hi John! Thank you for watching!!
From what I gathered, BLE cannot do standard serial communication. There is a code by mhamilt on GitHub called "maxmsp-ble" that may work, but I don't have BLE to test this.
Hope it works!
I think buying the standard Nano may make your life easier. Were you thinking about doing wireless communication?
@@SoundSimulator Whoa that was fast! Thank you so much for your reply.
Actually, I'm on a masters course of sonic arts and audio technologies and the whole class was instructed to buy this particular version because it's supposed to have everything we might need to make our projects without buying extra sensors.
Also I was thinking about doing a project using the proximity sensor of my nano and transfer data from the sensor to max msp and control sound with proximity so i thought wireless was the way to go.
In retrospect (and after realizing that most tutorials/code etc are using uno) i think i should have bought a standard one or a simple humble uno.
I'm gonna go try the code you mentioned and see if it works.
Again, thank you very much for your quick response. Keep up the good work!
@@johnlef9 Best of luck with the course!!
And I hope that code works!
Hi I'm really struggling with MAX/MSP, my print has no bottom connector to join up to the rest and Max has no recognition of the port functions. Has the "Port" command changed since the tutorial? Any help would be greatly appreciated!
Those are message objects!
Hey:) thanks for the vid, will this also work in M4L? Running into some issues
I have used similar technique with M4L a long time ago. I remember it being a bit unstable but it should be better now.
What's the issue?
Hello, I did all you said. My serial object in Max does not work. Not even the serial help file, nor the tutorial. What can Do ?
Which Arduino are you using? Did you buy an unofficial one?
Hi! Problem. I connected eight potentiometers and they constantly give out some random values to integer object in max msp, while I do not turn them. What is the problem? Thank you for your answer!!
It may not be grounded? I have a feeling that it's a hardware issue.
I recommend testing one by one. Good luck!
@@SoundSimulator thank you for your answer. I’ll try it. Other questions: Is additional power required to connect eight potentiometers and 10 switch-buttons? May I contact you in any other messenger to consider my case separately? would be very grateful!
@@dschkn Yeah, you should be able to connect that many components to USB powered Arduino.
Hi ! I'm having trouble receiving data in Max/MSP, although my Arduino code and my patcher are the same as those you show in the video. The Arduino is sending data no problem to the serial console and plotter and I can see the right port in Max, I just dont receive anything. (Also, I can upload code to my Arduino with the toggle of the patcher still on, which you said was not possible.)
What am I doing wrong ?
If you can upload the code while the toggle is on indicates that the connection between Arduino and Max is not happening. Please make sure that you're not missing any steps. It might be good to take some time away and then come back with a fresher mind as you might notice what you have been overlooking. Good luck!!
You have to make sure the IDE is closed. You can only have one serial monitor open at one time. Upload your code, before you toggle. close IDE, then toggle, you should see number in numbers object :)
Hey Great video, I cant seem to get max to read the knob value. the value is working on the serial monitor in IDE so I know the code and electronics are correct. the max patch is exactly like the one in the video, although I notices even when the max patch is toggled ON I could still upload code onto arduino uno without getting an error. any ideas why the number object isn't updating with the knob value?
First thing that I ask is: what Arduino are you using? If it's a clone, serial communication gets iffy.
If not, make sure the right port is being used.
@@SoundSimulator I am using an arduino uno, turns out I just had to quit the arduino IDE app and as soon as i did it started working. Thanks!
My "print" object looks differently, it doesn't has a connection point at the bottom. Does somebody know why? Thaaank you already
Hi Clara!
That is a message object with the word 'print' typed in. Same goes for the 'port z' and 'port' message objects.
Please feel free to let me know if you have any further questions! Have fun!!
@@SoundSimulator aaah i see! THANK YOU
Hello First , thank you for your video. Your video helped me a lot. But I have a problem. An error message shows in Arduino sketch stage. Error message is knobValue was not declared in this scope. What should I do?
Hi Grace! I just saw your message with the screenshot of the code on Instagram earlier. I'll reply to you there!
Thanks for the tutorial! some problems: My max patch only connects to the serial port when I close arduino IDE, otherwise there will be an error saying "serial: error openning serial port". Although the code works well in Arduino (shows normally in Arduino's serial monitor), I can't receive any data in max, the value is always 10 (which is filtered by [sel 13 10].
ahh never mind, I used the 1st output of [sel 13 10] instead of the 3rd one lol
Hey, thanks for tutorial. I have a problem: My port name is COM5. I have "specified port not available" attention and i changed the port name COM5 but still i dont see my port name on available list. I m trying to port z>port COM5 or print>port COM5 > port z. In Arduino my code is okay, analog is okay i havent error, port okay, too. And I m using to Arduino Uno Clone CH340. I dont think it can be driver problems because i can see in Arduino,i dont know.All is okay but i couldnt solved this port problems. Thank you. I m beginner, i hope i could explain my question im so sorry for my bad english :)
From what I remember of the Arduino clone, you have to download and install a driver in order to do serial communication with Max. It's been a while and I don't have one around to test. And Windows complicated things further. Did you install the driver yet? Sparkfun has tutorial on their website that looks good.
Clone is cheaper but it does comes with a price like this unfortunately. Best of luck! Please feel free to ask questions any time!
Hello ! I have the same problem right know did you find a solution ?
@@zgelt813 hey, no unfortunately. I have been change my Arduino clone to Arduino uno ✌️
@@respawn.x Thanks for the answer ! i'm actually using an official one (rp2040) but it seems that my computer doesn't allow access to my COM3 port via the serial object, i have tried with a pure data patch and have the same issu..
@@zgelt813 youre welcome, i dont make arduino projects from long time ago, so i cant answer this problem sorry :(
Hi there, great vid. When I press the toggle button I get an error message popping up saying "specified serial port not available" in the MAX console, just wondering if you have any ideas? Thanks
i'm using an arduino nano type of controller but I wouldn't think that would be a problem?
Click on print to check which port your arduino is using.
@@SoundSimulator It shows it's using port f but comes up with 'error opening serial port'
okay now there's no error messages when I click on port f but it still doesn't change the value of the number
@@gregoralexander6202
Making progress!
Are you using the official Arduino?
And are you seeing the sensor value in Arduino IDE itself? You can DM me on Instagram btw. It's hard to debug here.
Thank you!
Thank you for watching, Marco!!
thanks , this will help me allot.
You're welcome!!
Sweeeeeeet, looking for a way to ditch Maxuinio. Thanks.
Maxuinio always felt convoluted for beginners, so I'm glad to hear that!! This method is nice and simple.
I did it all from watching your video, I need to combine some digital inputs, and also report back some LED flashes from the system. I think I saw you do more videos on these topics (Arduino Max). Thanks again.
@@SoundSimulator I quadrupled the board rate on sketch/max to reduce the latency of the voltage reads. It worked really nicely.
what if I have knobs and a proximity sensor (digital pin)? I'm gettin mad...
Don't be mad! I have a video on how to use buttons and that'll give you a good idea as to how to also use analog sensors.
WOW !Genius 👍👍👍
Glad to you found the tutorial informative!!!
Hi,
I followed your tutorial but the number isn't showing anything. My serial on Arduino IDE shows the value and I changed the Port to my fitting port.
Don't know what I am doing wrong. Using MAX For Live at the moment but unsure if that's the problem...
It should still work with M4L. What Arduino are you using? If you're using the unofficial one, there's an extra step.
@@SoundSimulator Ah, yes using a knock-off Nano with an ATMega328P (Old Bootloader). Thank you for the quick response and a very well explained video. :)
@@TheRealPostpunker Gotcha! If you got it from Amazon, check out the reviews and see if they mention something about installing a driver.
You most likely need to install a CH340 driver. Somebody had the same issue few days ago but installing the driver made it work!
@@SoundSimulator Got the new MacOS so it was not recommended.
On the other hand I found out that M4L only outputs sound inside of Ableton which is unfortunate but makes sense. So now I gotta figure out how to get sound out of your patch inside Ableton. Unfortunately its not the ezdac~ object but a plugin and plugout combination.
Thank you!