Forums > MaxMSP

I am having trouble with getting MaxMsp to read arduino – bike to video project

January 6, 2010 | 4:49 pm

I have been trying to use maxmsp and arduino to use the rpm of a stationary bike to control video. I have pretty much everything working except the connection to the arduino from max seems a bit erratic. I have a method to get it working but it a bit complex and I would like to lesson the steps. Any suggestions would be most appreciated:)

Here are the startup instructions.

1. take out the usb connecting the computer to the arduino.
2. turn on the imac.
3. open the maxmsp file.
4. plugin the usb.
6. press start button.

Sometime this sequence does not work and when i press the reset it works again.

I think the major problem within this sequence of events is getting the Maxmsp to receive arduino values without having to unplug or plugin arduino in a particular sequence of events and also the nessecity of pressing the rest button.

here is the maxmsp file

————–

{
"patcher" : {
"fileversion" : 1,
"rect" : [ 0.0, 46.0, 1440.0, 798.0 ],
"bglocked" : 0,
"defrect" : [ 0.0, 46.0, 1440.0, 798.0 ],
"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
"openinpresentation" : 0,
"default_fontsize" : 11.595187,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"boxes" : [ {
"box" : {
"maxclass" : "comment",
"text" : "SPEED",
"fontname" : "Arial",
"id" : "obj-101",
"textcolor" : [ 0.592157, 0.192157, 0.192157, 1.0 ],
"fontface" : 1,
"fontsize" : 16.0,
"patching_rect" : [ 548.740723, 975.943909, 83.0, 25.0 ],
"numinlets" : 1,
"frgb" : [ 0.592157, 0.192157, 0.192157, 1.0 ],
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "FULL SCREEN",
"fontname" : "Arial",
"id" : "obj-98",
"textcolor" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"fontface" : 1,
"fontsize" : 20.0,
"patching_rect" : [ 51.0, 564.0, 260.0, 29.0 ],
"numinlets" : 1,
"frgb" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "SPEED COMPILER",
"fontname" : "Arial",
"id" : "obj-96",
"textcolor" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"fontface" : 1,
"fontsize" : 20.0,
"patching_rect" : [ 380.0, 682.0, 260.0, 29.0 ],
"numinlets" : 1,
"frgb" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "VOLTAGE REGULATOR",
"fontname" : "Arial",
"id" : "obj-73",
"textcolor" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"fontface" : 1,
"fontsize" : 20.0,
"patching_rect" : [ 1063.0, 726.0, 260.0, 29.0 ],
"numinlets" : 1,
"frgb" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "ARDUINO READER",
"fontname" : "Arial",
"id" : "obj-72",
"textcolor" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"fontface" : 1,
"fontsize" : 20.0,
"patching_rect" : [ 1128.0, 71.0, 260.0, 29.0 ],
"numinlets" : 1,
"frgb" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "VIDEO OPTIMIZATION",
"fontname" : "Arial",
"id" : "obj-71",
"textcolor" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"fontface" : 1,
"fontsize" : 20.0,
"patching_rect" : [ 573.0, 24.0, 260.0, 29.0 ],
"numinlets" : 1,
"frgb" : [ 0.117647, 0.05098, 0.05098, 1.0 ],
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "VIDEO OPTIMIZATION",
"fontname" : "Arial",
"id" : "obj-36",
"textcolor" : [ 0.058824, 0.058824, 0.058824, 1.0 ],
"fontface" : 1,
"fontsize" : 20.0,
"patching_rect" : [ 134.0, 84.0, 260.0, 29.0 ],
"numinlets" : 1,
"frgb" : [ 0.058824, 0.058824, 0.058824, 1.0 ],
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "START BIKE PROGRAM",
"fontname" : "Arial",
"id" : "obj-30",
"textcolor" : [ 0.905882, 0.003922, 0.003922, 1.0 ],
"fontface" : 1,
"fontsize" : 20.0,
"patching_rect" : [ 110.0, 18.0, 260.0, 29.0 ],
"numinlets" : 1,
"frgb" : [ 0.905882, 0.003922, 0.003922, 1.0 ],
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "toggle",
"outlettype" : [ "int" ],
"id" : "obj-29",
"patching_rect" : [ 32.0, 7.0, 56.0, 56.0 ],
"numinlets" : 1,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-2",
"fontsize" : 11.595187,
"patching_rect" : [ 1197.0, 575.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-179",
"fontsize" : 11.595187,
"patching_rect" : [ 588.0, 943.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "fullscreen $1",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-174",
"fontsize" : 11.595187,
"patching_rect" : [ 51.0, 672.0, 76.0, 18.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "toggle",
"outlettype" : [ "int" ],
"id" : "obj-175",
"patching_rect" : [ 51.0, 650.0, 20.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.window Optimized @size 720 480",
"fontname" : "Arial",
"outlettype" : [ "bang", "" ],
"id" : "obj-176",
"fontsize" : 11.595187,
"patching_rect" : [ 51.0, 692.0, 197.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sel 27",
"fontname" : "Arial",
"outlettype" : [ "bang", "" ],
"id" : "obj-177",
"fontsize" : 11.595187,
"patching_rect" : [ 51.0, 628.0, 41.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "key",
"fontname" : "Arial",
"outlettype" : [ "int", "int", "int", "int" ],
"id" : "obj-178",
"fontsize" : 11.595187,
"patching_rect" : [ 51.0, 606.0, 46.0, 20.0 ],
"numinlets" : 0,
"numoutlets" : 4
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "* 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-172",
"fontsize" : 11.595187,
"patching_rect" : [ 493.0, 896.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-171",
"fontsize" : 11.595187,
"patching_rect" : [ 994.0, 576.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-170",
"fontsize" : 11.595187,
"patching_rect" : [ 897.0, 566.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-169",
"fontsize" : 11.595187,
"patching_rect" : [ 812.0, 558.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-168",
"fontsize" : 11.595187,
"patching_rect" : [ 713.0, 562.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "flonum",
"maximum" : 2.0,
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-166",
"bgcolor" : [ 0.933333, 0.090196, 0.090196, 1.0 ],
"fontsize" : 11.595187,
"patching_rect" : [ 489.0, 977.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-165",
"fontsize" : 11.595187,
"patching_rect" : [ 409.0, 807.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-164",
"fontsize" : 11.595187,
"patching_rect" : [ 604.0, 824.0, 50.0, 20.0 ],
"numinlets" : 1,
"minimum" : 0.5,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "/ 21.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-161",
"fontsize" : 11.595187,
"patching_rect" : [ 412.0, 766.0, 33.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "/ 40.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-159",
"fontsize" : 11.595187,
"patching_rect" : [ 606.0, 778.0, 33.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "- 25.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-158",
"fontsize" : 11.595187,
"patching_rect" : [ 606.0, 724.0, 34.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 5000",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-157",
"fontsize" : 12.0,
"patching_rect" : [ 888.0, 517.0, 63.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 7500",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-155",
"fontsize" : 12.0,
"patching_rect" : [ 810.0, 516.0, 63.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10000",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-153",
"fontsize" : 12.0,
"patching_rect" : [ 711.0, 518.0, 70.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "flonum",
"fontname" : "Arial",
"outlettype" : [ "float", "bang" ],
"id" : "obj-145",
"fontsize" : 11.595187,
"patching_rect" : [ 412.0, 724.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "/ 24",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"id" : "obj-144",
"fontsize" : 11.595187,
"patching_rect" : [ 770.0, 989.0, 31.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-142",
"fontsize" : 11.595187,
"patching_rect" : [ 1050.0, 1085.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-103",
"fontsize" : 11.595187,
"patching_rect" : [ 1319.0, 1052.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-104",
"fontsize" : 11.595187,
"patching_rect" : [ 1353.0, 1017.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-105",
"fontsize" : 11.595187,
"patching_rect" : [ 1338.0, 1002.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-106",
"fontsize" : 11.595187,
"patching_rect" : [ 1467.0, 1016.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-108",
"fontsize" : 11.595187,
"patching_rect" : [ 1501.0, 981.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-109",
"fontsize" : 11.595187,
"patching_rect" : [ 1486.0, 966.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-110",
"fontsize" : 11.595187,
"patching_rect" : [ 1426.0, 969.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-112",
"fontsize" : 11.595187,
"patching_rect" : [ 1460.0, 934.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-115",
"fontsize" : 11.595187,
"patching_rect" : [ 1445.0, 919.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-117",
"fontsize" : 11.595187,
"patching_rect" : [ 1380.0, 922.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-118",
"fontsize" : 11.595187,
"patching_rect" : [ 1414.0, 887.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-119",
"fontsize" : 11.595187,
"patching_rect" : [ 1399.0, 872.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-120",
"fontsize" : 11.595187,
"patching_rect" : [ 1347.0, 875.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-121",
"fontsize" : 11.595187,
"patching_rect" : [ 1381.0, 840.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-123",
"fontsize" : 11.595187,
"patching_rect" : [ 1366.0, 825.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-126",
"fontsize" : 12.0,
"patching_rect" : [ 1660.0, 999.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-127",
"fontsize" : 12.0,
"patching_rect" : [ 1645.0, 984.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-128",
"fontsize" : 12.0,
"patching_rect" : [ 1626.0, 968.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-129",
"fontsize" : 12.0,
"patching_rect" : [ 1611.0, 953.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-130",
"fontsize" : 12.0,
"patching_rect" : [ 1594.0, 936.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-131",
"fontsize" : 12.0,
"patching_rect" : [ 1579.0, 921.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-132",
"fontsize" : 12.0,
"patching_rect" : [ 1560.0, 905.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-133",
"fontsize" : 12.0,
"patching_rect" : [ 1545.0, 890.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-134",
"fontsize" : 12.0,
"patching_rect" : [ 1522.0, 877.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-135",
"fontsize" : 12.0,
"patching_rect" : [ 1507.0, 862.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-136",
"fontsize" : 12.0,
"patching_rect" : [ 1488.0, 846.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-137",
"fontsize" : 12.0,
"patching_rect" : [ 1473.0, 831.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-138",
"fontsize" : 12.0,
"patching_rect" : [ 1456.0, 814.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-139",
"fontsize" : 12.0,
"patching_rect" : [ 1441.0, 799.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-140",
"fontsize" : 12.0,
"patching_rect" : [ 1422.0, 783.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-141",
"fontsize" : 12.0,
"patching_rect" : [ 1407.0, 768.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-88",
"fontsize" : 11.595187,
"patching_rect" : [ 924.0, 1054.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-92",
"fontsize" : 11.595187,
"patching_rect" : [ 958.0, 1019.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-93",
"fontsize" : 11.595187,
"patching_rect" : [ 943.0, 1004.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-85",
"fontsize" : 11.595187,
"patching_rect" : [ 1072.0, 1018.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-86",
"fontsize" : 11.595187,
"patching_rect" : [ 1106.0, 983.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-87",
"fontsize" : 11.595187,
"patching_rect" : [ 1091.0, 968.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-80",
"fontsize" : 11.595187,
"patching_rect" : [ 1031.0, 971.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-81",
"fontsize" : 11.595187,
"patching_rect" : [ 1065.0, 936.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-83",
"fontsize" : 11.595187,
"patching_rect" : [ 1050.0, 921.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-77",
"fontsize" : 11.595187,
"patching_rect" : [ 985.0, 924.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-78",
"fontsize" : 11.595187,
"patching_rect" : [ 1019.0, 889.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-79",
"fontsize" : 11.595187,
"patching_rect" : [ 1004.0, 874.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-74",
"fontsize" : 11.595187,
"patching_rect" : [ 952.0, 877.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-68",
"fontsize" : 11.595187,
"patching_rect" : [ 986.0, 842.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 0.",
"fontname" : "Arial",
"outlettype" : [ "float" ],
"id" : "obj-66",
"fontsize" : 11.595187,
"patching_rect" : [ 971.0, 827.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-55",
"fontsize" : 12.0,
"patching_rect" : [ 1265.0, 1001.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-57",
"fontsize" : 12.0,
"patching_rect" : [ 1250.0, 986.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-58",
"fontsize" : 12.0,
"patching_rect" : [ 1231.0, 970.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-59",
"fontsize" : 12.0,
"patching_rect" : [ 1216.0, 955.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-60",
"fontsize" : 12.0,
"patching_rect" : [ 1199.0, 938.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-62",
"fontsize" : 12.0,
"patching_rect" : [ 1184.0, 923.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-63",
"fontsize" : 12.0,
"patching_rect" : [ 1165.0, 907.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-64",
"fontsize" : 12.0,
"patching_rect" : [ 1150.0, 892.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-40",
"fontsize" : 12.0,
"patching_rect" : [ 1127.0, 879.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-41",
"fontsize" : 12.0,
"patching_rect" : [ 1112.0, 864.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-46",
"fontsize" : 12.0,
"patching_rect" : [ 1093.0, 848.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-53",
"fontsize" : 12.0,
"patching_rect" : [ 1078.0, 833.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-38",
"fontsize" : 12.0,
"patching_rect" : [ 1061.0, 816.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-39",
"fontsize" : 12.0,
"patching_rect" : [ 1046.0, 801.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-37",
"fontsize" : 12.0,
"patching_rect" : [ 1027.0, 785.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pipe 10",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-27",
"fontsize" : 12.0,
"patching_rect" : [ 1012.0, 770.0, 50.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "ROTATION TO VOLTAGE READER",
"linecount" : 3,
"fontname" : "Arial",
"id" : "obj-22",
"fontsize" : 12.584248,
"patching_rect" : [ 1177.740723, 604.943909, 96.0, 50.0 ],
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "RPM",
"fontname" : "Arial",
"id" : "obj-21",
"fontsize" : 12.584248,
"patching_rect" : [ 630.740723, 349.943909, 66.435883, 21.0 ],
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "TENSION LEVEL",
"linecount" : 2,
"fontname" : "Arial",
"id" : "obj-18",
"fontsize" : 12.584248,
"patching_rect" : [ 1314.740723, 610.943909, 71.0, 35.0 ],
"numinlets" : 1,
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "/ 4",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"id" : "obj-25",
"fontsize" : 12.0,
"patching_rect" : [ 1312.0, 547.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "/ 4",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"id" : "obj-3",
"fontsize" : 12.0,
"patching_rect" : [ 1262.0, 547.0, 32.5, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "select 0 1",
"fontname" : "Arial",
"outlettype" : [ "bang", "bang", "" ],
"id" : "obj-42",
"fontsize" : 12.0,
"patching_rect" : [ 1236.0, 170.0, 62.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 3
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "close",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-43",
"fontsize" : 12.0,
"patching_rect" : [ 1236.0, 321.0, 39.0, 18.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "port a",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-44",
"fontsize" : 12.0,
"patching_rect" : [ 1258.0, 295.0, 41.0, 18.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "fromsymbol",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-47",
"color" : [ 1.0, 0.890196, 0.090196, 1.0 ],
"fontsize" : 12.0,
"patching_rect" : [ 1211.0, 468.0, 74.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "itoa",
"fontname" : "Arial",
"outlettype" : [ "int" ],
"id" : "obj-48",
"color" : [ 1.0, 0.890196, 0.090196, 1.0 ],
"fontsize" : 12.0,
"patching_rect" : [ 1211.0, 445.0, 46.0, 20.0 ],
"numinlets" : 3,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "zl group",
"fontname" : "Arial",
"outlettype" : [ "", "" ],
"id" : "obj-49",
"fontsize" : 12.0,
"patching_rect" : [ 1211.0, 422.0, 53.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "select 10 13",
"fontname" : "Arial",
"outlettype" : [ "bang", "bang", "" ],
"id" : "obj-51",
"fontsize" : 12.0,
"patching_rect" : [ 1153.0, 371.0, 77.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 3
}

}
, {
"box" : {
"maxclass" : "toggle",
"outlettype" : [ "int" ],
"id" : "obj-52",
"patching_rect" : [ 1153.0, 133.0, 15.0, 15.0 ],
"numinlets" : 1,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "qmetro 10",
"fontname" : "Arial",
"outlettype" : [ "bang" ],
"id" : "obj-54",
"fontsize" : 12.0,
"patching_rect" : [ 1153.0, 170.0, 65.0, 20.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "print",
"fontname" : "Arial",
"outlettype" : [ "" ],
"id" : "obj-56",
"fontsize" : 12.0,
"patching_rect" : [ 1278.0, 269.0, 36.0, 18.0 ],
"numinlets" : 2,
"numoutlets" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "serial a 9600",
"fontname" : "Arial",
"outlettype" : [ "int", "" ],
"id" : "obj-61",
"fontsize" : 12.0,
"patching_rect" : [ 1153.0, 345.0, 84.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "unpack 0 0 0 0 0",
"fontname" : "Verdana",
"outlettype" : [ "int", "int", "int", "int", "int" ],
"id" : "obj-65",
"fontsize" : 10.0,
"patching_rect" : [ 1211.0, 515.0, 119.0, 19.0 ],
"numinlets" : 1,
"numoutlets" : 5
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Verdana",
"outlettype" : [ "int", "b


January 6, 2010 | 6:07 pm

I am not quite sure on this particular problem but if your not already, I find using maxuino to make sure the arduino is working properly and seeing how sensitive ur sensors are useful.

If you don’t already know maxuino is a max version of the arduino board so you should be able to use maxuino as the brain if you load FIRMATA to the arduino.

Just a suggestion – but you may want to think about using a different arduino board? communication does take a bit of time between the comp and arduino so it may be that your putting in too much power for the arduino to cope with? – don’t quote me on that though..

I’m trying to get an FSR to be an on off switch for audio – still havn’t figured it out – if you have any ideas here then i’d be grateful :).

Hope this helps you in the right direction at least.

A.


January 6, 2010 | 7:54 pm

"I’m trying to get an FSR to be an on off switch for audio – still havn’t figured it out – if you have any ideas here then i’d be grateful"

how about initialising a variable called threshold, setting it to a certain number and connecting the fsr to one of the arduino’s analogue inputs and querying (for example):

pinFive = FSRinput
threshold = 20

if(FSRinput > threshold){
Serial.print(1)
}

else{
Serial.print(0)
}

you probably dont need to send this serial.print of 0 on a reading under the threshold. you should get a byte sent over serial of 1 when you detect a value over your threshold, so a little logic in max can sort the two logical states.

this would be a momentary switch.. to create a toggle i suppose you could add in some modifications.. here goes.

pinFive = FSRinput
threshold = 20
boolean toggle = 0
debounce = 100

if(FSRinput > threshold){
toggle = !toggle // invert toggle value
Serial.print(toggle)
delay(debounce) // ‘x’ms delay for switch debouncing
}

i guess you could then work on establishing two way communication so you could modify the threshold and debounce values from within max using a slider

some of my code is probably somewhat pseudocode, would need to check the actual syntax ;)


January 6, 2010 | 9:05 pm

Heya

Thanks, sounds promising :),

I’m assuming that’s max jargon ur talking about?

A.


January 6, 2010 | 9:42 pm

What board are you using? With some of them (Lilypad, off the top of my head) there is a weird trick to get the computer to recognize it. This is all documented on the Arduino forum: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225061547/0#0. It’s pretty annoying.

Btw, like your idea with the bike. I was considering doing something similar at one point myself.


January 7, 2010 | 12:00 am

"I’m assuming that’s max jargon ur talking about?"

that would be the sketch (program) you would upload to the arduino from the arduino programmer sofware.. then you’d just make a [serial] object in max to get serial data from the arduino


January 7, 2010 | 11:17 pm

ok, got that to work fine, still clueless as to how to get it linked to a toggle/audio player. :(

Thanks for the pointers so far really useful :)


January 8, 2010 | 11:54 pm

look into the max/msp tutorials for audio playback. you can use a signal of 1 or 0 to start and stop a buffer~ of audio playing using groove~.


Viewing 8 posts - 1 through 8 (of 8 total)