I wasn't getting anything in max so I tried a few things. First I found out that the Arduino editor has to be closed because serial can only talk to one app at a time. Then I had to use Serial.write instead of Serial.Println. That fixed it 👉🏻👉🏻
Many thanks for this and your other great tutorials. I wonder if you could advise as to how I could go about relaying info from a PIR sensor hooked on the Arduino into Max
+Javier Alvarez thanks Javier! I'm not sure I have an infrared sensor in my kit. I'll throw something together for you though. Please email me at hello@michaelmckellar.co.uk and I'll take a look :)
+Darcy C you're right. They essentially have identical functionality. The main difference is Print turns the bytes to ascii which I find is much easier to deal with in terms of identifying packages in max. For normal Arduino usage write is always preferable!
thank you very much for the tutorial! Any chance you can make a video to show how to trigger a video from Arduino? or just replay? Thank you so much, I subscribed : )
+Shay Silver Hi Shay, Thanks for watching. Im currently travelling for work quite a bit so I'm not really making many videos. You can check out my other Arduino video (streaming data) that gives you some ideas on using the data when you get it into max. Alternatively you could combine the "my first video player" with the end of this video and make a system that plays a video when the button is pressed.
+Michael Mckellar thank you! I'm was just posting a comment on the other video... I finished communicating from the max to arduino... now I'll try on the same patch to get values back from the arduion. thanks again for the replay! your videos really help!
+Michael Mckellar THANKS TO YOU, I finally established a very good communication between the arduino and the Max! Arduino using sensors, sending info, and triggers videos, audio and info on the TV screen! I love it.
Michael, I just found your video. Thank you so much. However, I am having a problem which I'm hoping you might be able to address -- (I am using Arduino 101). The code works as expected in the Arduino serial monitor. However, when I try and use the serial object in max, I can't get it to receive any information. (One clue, is that when I change the port on the serial object to the correct port, the object will not reliably set the baud rate. Instead it defaults to something weird.) Maybe this is something with the 101 board that I don't understand. Or maybe it has something to do with Max not interfacing properly. Any ideas? Thanks, Pauline
+owlytv Do you know ableton? I'm no expert but quickest way to get started is to funnel the values into a Midiout object. Then you simply use the midi mapper in ableton to assign the values to whatever dial, object, controller you want!
Thanks so much! I'll give it a whirl! Sorry am totally new to all of this! :) So are you using Max for Live or Max? Thanks for the tutorial it is one of the most straight forward I've seen in a while :)
Just Max - it can act as a standalone midi device. I've only really ever build one or two commercial objects using max for live. Check out: ask.audio/articles/diy-motion-sensing-device-controller-for-ableton-live-using-arduino-max Someone I know wrote about exactly what you were asking just yesterday!
Hey Michael, I have been following yr instructions and so far so good. But once i got to the scale step my console kept reporting scale: doesn't understand "analog" im using an arduino connected to a photoresistor...i want to use light to control sound in Ableton. I've been searching everywhere but I can't figure out what i need to do...some kind of conversion i imagine.. help? - jesse
Sorry just to clarify: I've set up everything correctly (its a photocell circuit talking to my arduino talking to Max For Live). I can get tthe analog readings to show up coming out of the "itoa" but then when i try to put that thru the "fromsymbol" it doesn't change the data and keeps it the same (i.e. "analog") which the slider cannot read. What am i not getting here?? Thanks!
Hi Michael, firstly thank you for such a wonderful tutorial :) I am new to Arduino and have hit a little snag... When I change the code to create two 'random' numbers... Each "space" seems to create a new line on my serial monitor instead of just having a gap between the numbers? I am wondering if someone can tell me why this might be happening and how to fix it? Many Thanks - Tasha /Users/npri210/Desktop/Screen Shot 2017-04-03 at 3.15.03 PM.png
I cant seen that screenshot, but.... As a quick guess, im going to presume in your arduino code you're using serial.println("whatever")... the 'LN' at the end of the print command is significant as this instructs arduino to use a carriage return after posting the message. Try something like this: Serial.print("variable 1") Serial.print(" ") Serial.println("variable 2") This will put a message onto the serial port that looks like: tldl: remove the LN from the print command in arduino
Hi Michael, I'm wondering if the Serial protocol requires any setup? I have got to the point where I expect to see the serial object outputting ASCII code, but no number is appearing in the box. I have tried following the Cycling 74 Serial object tutorial, but the same is happening, no data from the serial object at all.
+Jack Laidlaw sorry: the origin of the data, is it arduino? Does data appear on the serial monitor in arduino correctly? What happens you pass a print message into the serial port? Does port b match with the com port your arduino board is connected too?
Ahh I see. Yes the data is coming from Arduino, I am using the sketch that you show in this video. The data appears correctly in the Arduino Serial Monitor, new random values upon the release of the button. Yep, port b matches exactly with the com port to which the Arduino is connected. I was using a USB hub to connect the Arduino to the Mac, but I have connected to a direct USB port to rule that out, still nothing.
+Jack Laidlaw it's hard to say,all I can suggest would be - close max, close the serial monitor - open a new max put a the serial output into a message, or print it to max port without any filtering to see the raw data. You can also put a print on the right hand port of serial to see the number packages being received. If those match as expected then you can move onto doing things with the data. Everything sounds like it's right - might just be a little error in your patch throwing you off!
Hi, thank you for preparing a very easy-to-follow tutorial. I'm a beginner in MAX/MSP and Arduino, and this tutorial really helps to get started. However I encountered some issues. I followed the exact same setup and code, but: (1) the arduino just keep generating random values without the button's pressed, and only stop when the button's pressed. (2) my MAX/MSP doesn't receive any random values from the arduino. I don't know what's happening here. Is it MAX/MSP problem? Please help.
Have you wired the button correctly, and used the correct resistor in series? If you have the serial monitor open in Arduino, it will not be able to send to maxmsp. Close the serial monitor and then re-open max and make sure the serial port is set correctly!
@@Programmingforpeople oh, thank you! yes. MAX/MSP received the data once I closed the serial monitor. I've rewired the button and used the right resister (10k) but Arduino still generated random number on its own. Anyway, I'll try it again. But thank you again! It's very helpful. :)
@@Programmingforpeople oh, the button works now after I unplugged and replugged a wire. Now it produced number only when I pressed the button. But in MAX/MSP it generated 5 numbers. Is that a problem in MAX/MSP?
Max Serial object and Arduino Software should not talk to arduino board at same time. If You use Max , quit Arduino Software , Plug the Board, start Max.
Thanks! I was banging my head so much on why the serial wasn't working
Youve just saved my degree
Glad I could help! Feel free to send me a message if you need anymore of a point in the right direction, I try to work on max most nights!
same
you sir, are awesome. Probably saved my degree as well!
Thank you very much!! it was really helpfull!
wonderful! many thanks!!!
I wasn't getting anything in max so I tried a few things. First I found out that the Arduino editor has to be closed because serial can only talk to one app at a time. Then I had to use Serial.write instead of Serial.Println. That fixed it 👉🏻👉🏻
Wow that is just great man
Thank you!!
Thank you kind sir.
Many thanks for this and your other great tutorials. I wonder if you could advise as to how I could go about relaying info from a PIR sensor hooked on the Arduino into Max
+Javier Alvarez thanks Javier! I'm not sure I have an infrared sensor in my kit. I'll throw something together for you though. Please email me at hello@michaelmckellar.co.uk and I'll take a look :)
Thanks :)
What can i do if im using 2 distance sensors and want to send both into different paths from arduino to max?
guys you can basically use serial.Write instead of serial.Print and the numbers will be the same :)
+Darcy C you're right. They essentially have identical functionality. The main difference is Print turns the bytes to ascii which I find is much easier to deal with in terms of identifying packages in max. For normal Arduino usage write is always preferable!
Michael Mckellar ah i see thanks for the tutorial still :)
can you make video on multiplexers...if possible
do you know how to seve analog data to csv(Excel) ?
thank you very much for the tutorial!
Any chance you can make a video to show how to trigger a video from Arduino? or just replay?
Thank you so much, I subscribed : )
+Shay Silver Hi Shay, Thanks for watching. Im currently travelling for work quite a bit so I'm not really making many videos. You can check out my other Arduino video (streaming data) that gives you some ideas on using the data when you get it into max. Alternatively you could combine the "my first video player" with the end of this video and make a system that plays a video when the button is pressed.
+Michael Mckellar thank you! I'm was just posting a comment on the other video... I finished communicating from the max to arduino... now I'll try on the same patch to get values back from the arduion. thanks again for the replay! your videos really help!
+Michael Mckellar THANKS TO YOU, I finally established a very good communication between the arduino and the Max! Arduino using sensors, sending info, and triggers videos, audio and info on the TV screen! I love it.
Michael, I just found your video. Thank you so much. However, I am having a problem which I'm hoping you might be able to address -- (I am using Arduino 101). The code works as expected in the Arduino serial monitor.
However, when I try and use the serial object in max, I can't get it to receive any information. (One clue, is that when I change the port on the serial object to the correct port, the object will not reliably set the baud rate. Instead it defaults to something weird.) Maybe this is something with the 101 board that I don't understand. Or maybe it has something to do with Max not interfacing properly. Any ideas?
Thanks,
Pauline
facing this same issue. this comment is 3 years old. so you must have finally fixed it perhaps?
@@vatsalguruvayurappan9724 Have you fixed this Vatsal?
hi thanks so much for recording this! I was wondering how you then use those values in ableton? sorry I'm totally new to this...
+owlytv Do you know ableton? I'm no expert but quickest way to get started is to funnel the values into a Midiout object. Then you simply use the midi mapper in ableton to assign the values to whatever dial, object, controller you want!
Michael Mckellar thank you! still totally green to this.. does this approach mean you don't need to use maxuino?
Thanks so much! I'll give it a whirl! Sorry am totally new to all of this! :) So are you using Max for Live or Max?
Thanks for the tutorial it is one of the most straight forward I've seen in a while :)
Just Max - it can act as a standalone midi device. I've only really ever build one or two commercial objects using max for live.
Check out: ask.audio/articles/diy-motion-sensing-device-controller-for-ableton-live-using-arduino-max
Someone I know wrote about exactly what you were asking just yesterday!
How do you get the print button to have outlets? Whenever I create one it only has an inlet
He wrote "print" in a message box - not an object box. Because it was highlighted it made it harder to tell that box has rounded corners.
Hey Michael,
I have been following yr instructions and so far so good. But once i got to the scale step my console kept reporting scale: doesn't understand "analog"
im using an arduino connected to a photoresistor...i want to use light to control sound in Ableton.
I've been searching everywhere but I can't figure out what i need to do...some kind of conversion i imagine..
help?
- jesse
Sorry just to clarify: I've set up everything correctly (its a photocell circuit talking to my arduino talking to Max For Live). I can get tthe analog readings to show up coming out of the "itoa" but then when i try to put that thru the "fromsymbol" it doesn't change the data and keeps it the same (i.e. "analog") which the slider cannot read. What am i not getting here??
Thanks!
Hi Michael, firstly thank you for such a wonderful tutorial :) I am new to Arduino and have hit a little snag... When I change the code to create two 'random' numbers... Each "space" seems to create a new line on my serial monitor instead of just having a gap between the numbers? I am wondering if someone can tell me why this might be happening and how to fix it? Many Thanks - Tasha
/Users/npri210/Desktop/Screen Shot 2017-04-03 at 3.15.03 PM.png
I cant seen that screenshot, but....
As a quick guess, im going to presume in your arduino code you're using serial.println("whatever")... the 'LN' at the end of the print command is significant as this instructs arduino to use a carriage return after posting the message.
Try something like this:
Serial.print("variable 1")
Serial.print(" ")
Serial.println("variable 2")
This will put a message onto the serial port that looks like:
tldl: remove the LN from the print command in arduino
Thank u for the quick responce :) ill try that first thing tomorrow, thanks again, T
hello. How to know the name of the serial
I think I need stronger glasses for this...
My bad - imgur.com/CusSeVS
Hi Michael, I'm wondering if the Serial protocol requires any setup? I have got to the point where I expect to see the serial object outputting ASCII code, but no number is appearing in the box. I have tried following the Cycling 74 Serial object tutorial, but the same is happening, no data from the serial object at all.
+Jack Laidlaw where is your serial data coming from?
In the Max Serial object I have set to port b
+Jack Laidlaw sorry: the origin of the data, is it arduino? Does data appear on the serial monitor in arduino correctly?
What happens you pass a print message into the serial port? Does port b match with the com port your arduino board is connected too?
Ahh I see. Yes the data is coming from Arduino, I am using the sketch that you show in this video. The data appears correctly in the Arduino Serial Monitor, new random values upon the release of the button. Yep, port b matches exactly with the com port to which the Arduino is connected. I was using a USB hub to connect the Arduino to the Mac, but I have connected to a direct USB port to rule that out, still nothing.
+Jack Laidlaw it's hard to say,all I can suggest would be - close max, close the serial monitor - open a new max put a the serial output into a message, or print it to max port without any filtering to see the raw data.
You can also put a print on the right hand port of serial to see the number packages being received.
If those match as expected then you can move onto doing things with the data.
Everything sounds like it's right - might just be a little error in your patch throwing you off!
Hi, thank you for preparing a very easy-to-follow tutorial. I'm a beginner in MAX/MSP and Arduino, and this tutorial really helps to get started. However I encountered some issues.
I followed the exact same setup and code, but:
(1) the arduino just keep generating random values without the button's pressed, and only stop when the button's pressed.
(2) my MAX/MSP doesn't receive any random values from the arduino. I don't know what's happening here. Is it MAX/MSP problem?
Please help.
Have you wired the button correctly, and used the correct resistor in series?
If you have the serial monitor open in Arduino, it will not be able to send to maxmsp. Close the serial monitor and then re-open max and make sure the serial port is set correctly!
@@Programmingforpeople oh, thank you! yes. MAX/MSP received the data once I closed the serial monitor.
I've rewired the button and used the right resister (10k) but Arduino still generated random number on its own. Anyway, I'll try it again.
But thank you again! It's very helpful. :)
@@Programmingforpeople oh, the button works now after I unplugged and replugged a wire. Now it produced number only when I pressed the button. But in MAX/MSP it generated 5 numbers. Is that a problem in MAX/MSP?
Max Serial object and Arduino Software should not talk to arduino board at same time.
If You use Max , quit Arduino Software , Plug the Board, start Max.
THANK YOU
So helpful! Thank you