Arduino To Max/MSP (Tutorial)

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 103

  • @headfullofdreams6083
    @headfullofdreams6083 3 месяца назад +2

    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

    • @SoundSimulator
      @SoundSimulator  3 месяца назад +1

      Glad to hear that this video helped you and your friends!! :D

  • @mathijsvann
    @mathijsvann 2 года назад +5

    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

    • @SoundSimulator
      @SoundSimulator  2 года назад

      That's awesome to hear!!
      I would love to check out what you're building. Please feel free to share!

  • @EricBalcon
    @EricBalcon Год назад +1

    That's the best video on the web to understand serial connection from arduino to max MSP. Congrats

  • @sebve9399
    @sebve9399 Год назад +1

    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.

  • @brunoeugeniobelletieri7446
    @brunoeugeniobelletieri7446 Год назад +2

    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.

  • @StonedToDeliverance
    @StonedToDeliverance 3 года назад +3

    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

    • @SoundSimulator
      @SoundSimulator  3 года назад

      That's great to hear!! I'm glad that this video helped out. Have fun!!

  • @lysdexic
    @lysdexic 3 года назад +2

    Awesome! So many people struggle connecting Arduino to Max - awesome tute 👏 😎
    Neat sounds too 👾

    • @SoundSimulator
      @SoundSimulator  3 года назад

      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!

  • @studiospiraluniverse
    @studiospiraluniverse 3 года назад +1

    Even as a non Max user I enjoyed watching the video

    • @SoundSimulator
      @SoundSimulator  3 года назад +1

      Thank you so much! I'm glad you still enjoyed it!

  • @danielprietog
    @danielprietog 3 месяца назад +1

    So simple! Thank you.

  • @shangavatar
    @shangavatar Год назад +1

    Thank you for suggesting the book!

  • @ry-io
    @ry-io 10 месяцев назад +1

    the first argument to Serial.begin(), in this case 9600, is the baud rate of the serial connection, not a port number

  • @fisch723
    @fisch723 2 года назад +1

    Excellent work! Can't wait to start!

  • @nawmelwang3383
    @nawmelwang3383 5 месяцев назад +1

    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.

    • @SoundSimulator
      @SoundSimulator  5 месяцев назад

      You can smooth out sensor data! I actually made a video about that: ruclips.net/video/RCHgQOPaT08/видео.html

  • @TheRealPostpunker
    @TheRealPostpunker 2 года назад +1

    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
      @SoundSimulator  2 года назад +1

      It should still work with M4L. What Arduino are you using? If you're using the unofficial one, there's an extra step.

    • @TheRealPostpunker
      @TheRealPostpunker 2 года назад +1

      @@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. :)

    • @SoundSimulator
      @SoundSimulator  2 года назад +1

      @@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!

    • @TheRealPostpunker
      @TheRealPostpunker 2 года назад

      @@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.

  • @PivasRox
    @PivasRox Год назад +1

    Excuse me, sir. I was woundering... Is it possible to make a guitar loop pedal using arduino and Max?

    • @SoundSimulator
      @SoundSimulator  Год назад +1

      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.

  • @bernardogarciasound
    @bernardogarciasound Год назад +1

    Thank you!

  • @LuisTorres-qz5kr
    @LuisTorres-qz5kr 2 года назад +1

    Great Tutorial, thanks!

  • @ligiapacheco6268
    @ligiapacheco6268 3 года назад +3

    This exercise can also be done in pure data?
    I love your videos

    • @SoundSimulator
      @SoundSimulator  3 года назад +1

      Thank you! I actually have a Pure Data tutorial of the same topic! Enjoy!
      ruclips.net/video/eVW0FD9g_Sk/видео.html

  • @ayameskawi967
    @ayameskawi967 Год назад +1

    hello ! whats inside the subpatch compression&reverb ?

  • @dschkn
    @dschkn Год назад +2

    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!

    • @SoundSimulator
      @SoundSimulator  Год назад +1

      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.

  • @jaewonlee8074
    @jaewonlee8074 Год назад +1

    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?

    • @SoundSimulator
      @SoundSimulator  Год назад

      It should, I think!
      I do have a license but using this technique works with M4L.

  • @claraphilippzig8232
    @claraphilippzig8232 3 года назад +1

    My "print" object looks differently, it doesn't has a connection point at the bottom. Does somebody know why? Thaaank you already

    • @SoundSimulator
      @SoundSimulator  3 года назад +1

      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!!

    • @claraphilippzig8232
      @claraphilippzig8232 3 года назад +1

      @@SoundSimulator aaah i see! THANK YOU

  • @Monamona160
    @Monamona160 Год назад +1

    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!!!

    • @SoundSimulator
      @SoundSimulator  Год назад

      Those are just my cheating by using external compressor and reverb VSTs :)

  • @dschkn
    @dschkn Год назад

    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
      @SoundSimulator  Год назад +1

      It may not be grounded? I have a feeling that it's a hardware issue.
      I recommend testing one by one. Good luck!

    • @dschkn
      @dschkn Год назад

      @@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!

    • @SoundSimulator
      @SoundSimulator  Год назад

      @@dschkn Yeah, you should be able to connect that many components to USB powered Arduino.

  • @bernardogarciasound
    @bernardogarciasound Год назад

    Thank you so much for this. One question. How would you change this to use Arduino's digital INs?

  • @user-wl1ch5gh9o
    @user-wl1ch5gh9o 6 месяцев назад

    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 ?

    • @SoundSimulator
      @SoundSimulator  6 месяцев назад

      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!!

    • @afalcone4
      @afalcone4 3 месяца назад +1

      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 :)

  • @seancharity8524
    @seancharity8524 2 года назад +1

    thanks , this will help me allot.

  • @Reimitsuo
    @Reimitsuo 9 месяцев назад +1

    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??

    • @SoundSimulator
      @SoundSimulator  9 месяцев назад

      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 [*~].

    • @Reimitsuo
      @Reimitsuo 9 месяцев назад +1

      Thank you!! I tried with your program and I made it. Now I am making multiple analog sensor on Arduino. @@SoundSimulator

    • @SoundSimulator
      @SoundSimulator  9 месяцев назад

      @@Reimitsuo That's great! Have fun :)

  • @vidensmusic8035
    @vidensmusic8035 2 года назад

    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 ?

    • @SoundSimulator
      @SoundSimulator  2 года назад

      Which Arduino are you using? Did you buy an unofficial one?

  • @cuinmccann6894
    @cuinmccann6894 2 года назад +1

    Very helpful video. Do you know how I could change the code to work with 6 HC-SR04 ultrasonic sensors?

    • @SoundSimulator
      @SoundSimulator  2 года назад

      I recommend that you watch this video ruclips.net/video/1J6tLOGn0dw/видео.html
      There are example codes online for HC-SR04 that you can reference! Good luck!

  • @mdrvid
    @mdrvid 2 года назад +1

    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.

    • @SoundSimulator
      @SoundSimulator  2 года назад

      This tutorial is what you may be looking for!
      ruclips.net/video/VYWQaqf6yL0/видео.html

  • @johnlef9
    @johnlef9 3 года назад +1

    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

    • @SoundSimulator
      @SoundSimulator  3 года назад +1

      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?

    • @johnlef9
      @johnlef9 3 года назад +1

      @@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!

    • @SoundSimulator
      @SoundSimulator  3 года назад +1

      ​@@johnlef9 Best of luck with the course!!
      And I hope that code works!

  • @gracepark3243
    @gracepark3243 2 года назад

    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?

    • @SoundSimulator
      @SoundSimulator  2 года назад

      Hi Grace! I just saw your message with the screenshot of the code on Instagram earlier. I'll reply to you there!

  • @hellni79
    @hellni79 Год назад

    what if I have knobs and a proximity sensor (digital pin)? I'm gettin mad...

    • @SoundSimulator
      @SoundSimulator  Год назад

      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.

  • @danielmanz17
    @danielmanz17 10 месяцев назад

    Hey:) thanks for the vid, will this also work in M4L? Running into some issues

    • @SoundSimulator
      @SoundSimulator  10 месяцев назад

      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?

  • @3995hz
    @3995hz 2 года назад +1

    WOW !Genius 👍👍👍

    • @SoundSimulator
      @SoundSimulator  2 года назад

      Glad to you found the tutorial informative!!!

  • @Interspectral
    @Interspectral Год назад

    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].

    • @Interspectral
      @Interspectral Год назад

      ahh never mind, I used the 1st output of [sel 13 10] instead of the 3rd one lol

  • @frequencymanipulator
    @frequencymanipulator Год назад +1

    Sweeeeeeet, looking for a way to ditch Maxuinio. Thanks.

    • @SoundSimulator
      @SoundSimulator  Год назад

      Maxuinio always felt convoluted for beginners, so I'm glad to hear that!! This method is nice and simple.

    • @frequencymanipulator
      @frequencymanipulator Год назад +1

      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.

    • @frequencymanipulator
      @frequencymanipulator Год назад +1

      @@SoundSimulator I quadrupled the board rate on sketch/max to reduce the latency of the voltage reads. It worked really nicely.

  • @benkashani4866
    @benkashani4866 Год назад

    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?

    • @SoundSimulator
      @SoundSimulator  Год назад

      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.

    • @benkashani4866
      @benkashani4866 Год назад +1

      @@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!

  • @gregoralexander6202
    @gregoralexander6202 2 года назад

    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
      @gregoralexander6202 2 года назад

      i'm using an arduino nano type of controller but I wouldn't think that would be a problem?

    • @SoundSimulator
      @SoundSimulator  2 года назад

      Click on print to check which port your arduino is using.

    • @gregoralexander6202
      @gregoralexander6202 2 года назад

      @@SoundSimulator It shows it's using port f but comes up with 'error opening serial port'

    • @gregoralexander6202
      @gregoralexander6202 2 года назад

      okay now there's no error messages when I click on port f but it still doesn't change the value of the number

    • @SoundSimulator
      @SoundSimulator  2 года назад +1

      ​@@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.

  • @respawn.x
    @respawn.x 2 года назад

    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 :)

    • @SoundSimulator
      @SoundSimulator  2 года назад +1

      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!

    • @zgelt813
      @zgelt813 Год назад

      Hello ! I have the same problem right know did you find a solution ?

    • @respawn.x
      @respawn.x Год назад

      @@zgelt813 hey, no unfortunately. I have been change my Arduino clone to Arduino uno ✌️

    • @zgelt813
      @zgelt813 Год назад

      @@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..

    • @respawn.x
      @respawn.x Год назад

      @@zgelt813 youre welcome, i dont make arduino projects from long time ago, so i cant answer this problem sorry :(

  • @marcoc2449
    @marcoc2449 3 года назад +1

    Thank you!

  • @dansimpson1729
    @dansimpson1729 2 года назад +1

    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!