Max/MSP example patches

by craig_fahner @ 4:27 pm November 28, 2011

Copy and paste these into new Max patches to use!

Review of Max/MSP objects:


----------begin_max5_patcher----------
4844.3oc6cs1Txirs9yuyuhb7CmYlRmX5aIc1UM0t3l.di6J5dN0ohP.BDRh
4BWbW6+6mNIff9JgnFgbbfYdELFfd8zq68Z08+9W9wQOXNS04Ht+A2+h6G+3
e+K+3GAWx+B+Xwu+iiFqLqithSvscTGywiUMbO5jv+lq5L2fq2UyVsiqlowI
bi0L35X5Y3xdoxrvWt79M7X+UcU2fOLvhK1yzv0Q6IU+qIyKr5VM8bWduBqc
uFJiCt2iJpZnNQY4mskhamAZF8+e8GIgzDQ.vKJfPBvS3DIDdLTVBKeBGfHx
9d3.ruMt+mEucstAellOL7OfG4eo+yu7K9+3jOIxLvbJCGLly8fhQeGN2AdN
b8Tr+m6KHAh7gDnDfAITvJHAKDEj.DnIInf42J42Soi5lfDfPhhI3ErIHzIb
RP5yXBD5CIPgMAIRIIjfRYPhvyPhHAGaHQLIgDXpERHLok3BIjjDR.oVHAKg
hMjfSRHwV0Q0koWUMzTip89RyJAtRjAth+fJEshUTRBFAP.mm0ocMmZr7upq
YnFZFlcKv8C5fIxqLECVwpvrJyPGDXSnShZKNWkqxV95Bbkaxk4xK+bRR3s.
OOzuiotocH0KvKIIh8s491uZEw+9PUjr3JAv0rbA7Y2XRfjMAqfjDV8bT4T3
90wpt1l+JG6KfM93bM4bTM5x9C9N9vo3xYq12SWwlSyWHchhtSph+TF9L+4K
zty3UifAUVNIARWy980U4LMN0rWu8jZLLF+LPrtNcQZTpwj+PtG9fmqqoQjD
5KIokWM7RtysTCGzG4yiczyCr2hrPus9GnPTlpj+Pt3MV0wQou5OM8J7lTJ7
cLktQ5+nOnBDBTXU3.qYzBA4IrYaoM.KeHeZXjxCwv5bTZcgax+E3l.FMewr
Wye7NkHDWoZPjtBiHA5XQnMfQeHKWFpSYu421rtpMm.6+jeSDj7N3hvaArV9
O+e8ihYLSOqh7dU7CRnH0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gmp2
0SbVWOsXSZtebUVW.Uui2QUoOSpdSrG0cBZSNSOahYMA0IuInMYeuso7B+6S
+ePSnnbJ
-----------end_max5_patcher-----------

Code for getting Max/MSP to talk to Processing over OSC. Drop the following into your motion tracking patch:


----------begin_max5_patcher----------
514.3ocyVtsbaBCDF9Z3oPiFtzknifUtqOGYxzAaTSTqQvXjabRl7tWIA1kz
5K.aNzAFVzpUZ+0Gqk06gAvMkGk0Pv8fG.AAuGFD3c4bDz1N.Vjcb6trZeXP
s7kxM+.tpoKi7nw6dubqT8KInN4TWeuTapUuIcciIwnV25CEJ8NowOacbVdv
bxKtyLnyJ7y.7q6UY6NM2UYlsOqzO8MaZMMpmIn1b.vnTmIg6dRPwHvisioI
AlWqjMC.BO2kJ2mB655K30PmuOBCcOVMRPguTPwmiaGJoSATXKDTnzwAJISA
TnKDTHb7n.E9T.ExBAEb53.E1T.E7BAEAZTXB8ZXRgrtN6I4+.k6rqqMx8.T
r6FmFut8UT7PnDYDKcv9RGRqA0rky5gyIzHV6Tk8yyb4p.TxnWFw7FFgbk0Q
honLJBChHfHJHhAh3fnKdlFwjWCIZ18Ik4MXg2vGLhHiXEzg7pZoN2VfX+4u
8BaeCgPCfO3KxGz0yGRSIDF2b9uzN7oCD9zVv9.f6T5+9nu9j37+YxTWdX+1
SLt8Thq.+IO4xZiRmYTk5NAIrwvOGyyp7bot6ZsPkWUpzlVM.d7hel5sjR6o
jXymjR5ojnymj38TRj4SRrdJI77IIZOkDZ1jDoGJx9ekChRXDJlaGgP3LTD8
bqaTrhdHVx+c3icCJx13iveCgaWsYC
-----------end_max5_patcher-----------

Processing code (dumps motion tracking regions into float variables (float0, float1, etc):

/**
 * oscP5parsing by andreas schlegel
 * example shows how to parse incoming osc messages "by hand".
 * it is recommended to take a look at oscP5plug for an
 * alternative and more convenient way to parse messages.
 * oscP5 website at http://www.sojamo.de/oscP5
 */
 
import oscP5.*;
import netP5.*;
 
float float0;
float float1;
float float2;
float float3;
float float4;
float float5;
 
OscP5 oscP5;
NetAddress myRemoteLocation;
 
void setup() {
  size(400,400);
  frameRate(25);
  /* start oscP5, listening for incoming messages at port 12000 */
  oscP5 = new OscP5(this,12000);
 
  /* myRemoteLocation is a NetAddress. a NetAddress takes 2 parameters,
   * an ip address and a port number. myRemoteLocation is used as parameter in
   * oscP5.send() when sending osc packets to another computer, device, 
   * application. usage see below. for testing purposes the listening port
   * and the port of the remote location address are the same, hence you will
   * send messages back to this sketch.
   */
  myRemoteLocation = new NetAddress("127.0.0.1",12000);
}
 
void draw() {
  background(0);  
}
 
void oscEvent(OscMessage theOscMessage) {
  /* check if theOscMessage has the address pattern we are looking for. */
 
  if(theOscMessage.checkAddrPattern("/number")==true) {
    /* check if the typetag is the right one. */
    if(theOscMessage.checkTypetag("ffffff")) {
      /* parse theOscMessage and extract the values from the osc message arguments. */
 
      float0 = theOscMessage.get(0).floatValue();
      float1 = theOscMessage.get(1).floatValue();
      float2 = theOscMessage.get(2).floatValue();
      float3 = theOscMessage.get(3).floatValue();
      float4 = theOscMessage.get(4).floatValue();
      float5 = theOscMessage.get(5).floatValue();
      println(" values: "+float0+", "+float1+", "+float2+", "+float3+", "+float4+", "+float5);
      return;
    }  
  } 
  println("### received an osc message. with address pattern "+theOscMessage.addrPattern());
}

Communicate between Max/MSP and Arduino:


----------begin_max5_patcher----------
1459.3oc6Z00biaBE8YmeELd5Csy3XCnu6ac5yc1G1911cxfsHNrqD3QBmjc
2Y+uW.I4HairIVNxsS7CVe.WgO2C26AjfebynwyEOSKGC9cvm.iF8iaFMxTj
tfQ02OZbN44EYjRiYimuhHW7.sX7jpJejTvI4TScemjuJq3ViEM0upPHExus
htwpUrmyZpc9xbQpoXTcIVaroJHntn4o3qyY7LpzfnfWJTrV1TZSywRMMlX9
WtE073jhk0tL3y0EU8jZXVUw3uvj2kSjELEWzXjAJL9x6JnKjU1E4EMENAfC
vlSQP8ITf+TH3y5G5m2bi9vDGIWoX4xLpU2D4paF5OtKmhwkGzavHi2fPHi2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Hqu2PCjKDoZa22DF1CR8Xi15
44kDlnX0P+2NVU8JUoyI7ki6qVuM0NuSmcLXxg7bHZpp6M.1KcuUDN8kcfzl
2M.sYOIsULURTneDZh0qZGSU0PaGNF.Sh01iShgdIS.U3tq.Q2mMh2AF6DCq
nJbMIYhih2ce8YPfY7+c1CklVTW91DXoXcwhldq58jH3E+HkVJYbyaozxl3s
r4AVZJk21kxYoqDLtby1wxZmoqHJ1IHAGdLgNBlzebzgFS3igofgGSdGCS9C
Ol7OFl7FdLEbLLgGVLgcIuCMnXxL+mil3YFPukUGEUX0qvEn2zzUav3H7zX0
n1w90EcV.MzIP+JnR8ae1Bz3.CnMS03b.5cfSGfdm9i8A8VCbBUiVhw5wKCq
FBEs6.m64is7pXyGB1CVuyc25NbPUOWU+HNn29uuycYuh3rn5drj8CyR5Mhw
dN.4WoTaMfwnoQpysuqufE4bzEz0nqXTPXr4cC1+pCDiMHIJwCq1cnKgu3AV
6F5RW9+8lZ41Sg40AI0M+7l+EPhg5aC
-----------end_max5_patcher-----------

»

TrackBack URI

Leave a comment

You must be logged in to post a comment.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2017 CMU Electronic Media Studio II, Fall 2011, Section A | powered by WordPress with Barecity