Tutorial: Programming In MAX/MSP

  1. darkback2's Avatar
    darkback2 darkback2 is offline Mech Warfare Veteran
    Category
    How To, DIY
    Views
    27,893
    Replies
    6
     

    Programming In MAX/MSP

    Difficulty
    easier than most...
    Estimated Time
    an hour if you already have MAX/MSP several to build an arm
    Skills Required
    • follow directions
    • Don't get bored easily
    • enjoy using MAX/MSP
    Parts Required
    • Lynxmotion SES robotic arm
    • I made my own using parts found at Trossen Robotics
    • 2 phidget 4 servo controllers
    Tools Required
    • MAX/MSP www.cycling74.com
    I added an arm to Vivian. In this series of videos you can see how I use MAX/MSP to program the arm. I know there are those out there who feel that it using software isn't as good as coding from scratch, but I feel that I have a lot of capability using MAX/MSP...Especially given the library of phidget objects that are supported.

    DB
    [youtube]fdZ7PE_yjdo[/youtube]
    [youtube]nMyNPDjZ8yQ[/youtube]
    [youtube]fKz4DdmiD_U[/youtube]

    The above software works to control 2 phidgetservo controllers. There are memory states so that the arm will either move horizontally or vertically in response to the mouse. Using a program like wiiremote you can then control the arm using a wiicontroller.

    I'll try to post close up pictures of the arm in the next few days. If you want a copy of this MAX patch as an application, send me your serial numbers and I'll post the patch when I have time.

    [ame="http://www.youtube.com/watch?v=fdZ7PE_yjdo"]http://www.youtube.com/watch?v=fdZ7PE_yjdo[/ame]
    [ame="http://www.youtube.com/watch?v=nMyNPDjZ8yQ"]http://www.youtube.com/watch?v=nMyNPDjZ8yQ[/ame]
    [ame="http://www.youtube.com/watch?v=fKz4DdmiD_U"]http://www.youtube.com/watch?v=fKz4DdmiD_U[/ame]


Replies to Tutorial: Programming In MAX/MSP
  1. Re: Programming In MAX/MSP

    Excellent work!
        

  2. Join Date
    Sep 2006
    Location
    Carol Stream, Illinois
    Posts
    1,695

    Re: Programming In MAX/MSP

    Awesome tutorial db! I've always wondered how people program in MAX/MSP.

    I'm making my way through the videos and had a few questions. Sorry, I have no experience whatsoever in MAX/MSP, so my apologies ahead of time if these are totally newbie questions

    I missed how you add the Phidget library in MAX/MSP? When you install the Phidget library on your Mac, does it automatically show up in MAX/MSP? If so, then does the Phidget objects show up under your object box menu that pops up?

    In the first video towards the end, you are using a message box to connect to the PhidgetServo object. At the end of the message, you have "0" and "$1". I didn't quite catch what these are both for. Maybe I did though... Is the "0" the servo port number and the "$1" a placeholder that gets a value from the number box?

    I'm checking out your other two videos now

    �In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed�
    - Charles Darwin
        

  3. Join Date
    Sep 2006
    Location
    Carol Stream, Illinois
    Posts
    1,695

    Re: Programming In MAX/MSP

    I just finished the other two videos, great stuff! You really broke it down so people can understand it.

    I had no clue that MAX/MSP was available for Windows though. I thought it was only for Mac. When I get back from RoboGames and get a little caught up, I am sooo going to check out MAX/MSP

    thanks DB!

    �In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed�
    - Charles Darwin
        

  4. Join Date
    Dec 2007
    Location
    Whidbey Island, WA
    Posts
    1,718

    Re: Programming In MAX/MSP

    I missed how you add the Phidget library in MAX/MSP? When you install the Phidget library on your Mac, does it automatically show up in MAX/MSP? If so, then does the Phidget objects show up under your object box menu that pops up?
    I should probably make a tutorial on this subject. When you install MAX/MSP on either a PC or a Mac, it installs a folder on your harddrive. On a PC the folder is called "cycling74", and on a Mac I believe it is called "MAX". inside of this folder there is another folder called "externals". Any patch that is inside of the externals folder is loaded when MAX starts up. When you download the phidgets library you simply have to copy the patches from your download folder into the externals folder. There is also a folder labeled "help". Most patches come with a help file that shows you how to use them. When you select "get help on "blah"" it opens the help file in the help folder if there is one.
    In the first video towards the end, you are using a message box to connect to the PhidgetServo object. At the end of the message, you have "0" and "$1". I didn't quite catch what these are both for. Maybe I did though... Is the "0" the servo port number and the "$1" a placeholder that gets a value from the number box?
    message boxes in max are pretty cool. You can pack numbers into streams, the $ means input and the 1 means the first integer that comes into the message box. sending a number to the input triggers the message to output its contents. so if you have a message box that says, "setMotorPosition 0 $1", and input the number 3, that triggers the message box to output "setMotorPosition 0 3". The phidgetservo object then tells the phiget 4/0/0 to set the 1st servo to the position 3...or I think 3 degrees from absolute left.

    I have been using MAX for about 15 or so years now. Its pretty much all that works for me because I'm dyslexic as all get up and can't keep line after line of code straight.

    DB
        

  5. Join Date
    Sep 2006
    Location
    Carol Stream, Illinois
    Posts
    1,695

    Re: Programming In MAX/MSP

    thanks for clearing everything up!

    Any patch that is inside of the externals folder is loaded when MAX starts up. When you download the phidgets library you simply have to copy the patches from your download folder into the externals folder. There is also a folder labeled "help". Most patches come with a help file that shows you how to use them. When you select "get help on "blah"" it opens the help file in the help folder if there is one.
    Man, now I know what so many people love MAX

    �In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed�
    - Charles Darwin
        

  6. expatinchina Guest

    Re: Programming In MAX/MSP

    Hello,

    you may be able to solve my problem...: when I plug the Phidgetservo onto the Imac i have, the whole thing is well recognized, and the test screens are perfectly working.
    When moving the sliders, the servos are moving well.

    but when trying to get anything done in Max/Msp, then nothing happens.

    My library is linked, the Patcher correct, not error message in the Max window... but nothing happening onto the servos...

    any idea ?

Closed Tutorial