Forums > Javascript

simple "name game" javascript

February 28, 2013 | 8:43 am

I made a name game patch for my students using coll and a bunch of "nth" messages to store and retrieve names and 3 categories (hometown, favorite band and favorite food). In presentation mode the students would fill in these 4 text fields, press bang to store their information, and then another button would randomly pick a category and display a value and after guessing who’s name the value was tied to, you could flip the "flashcard" to reveal the name. I’ve just started learning js and would love to figure out how to simplify this patch with a simple core script that receives 4 item lists (name, hometown, band, food), stores them as individual objects, then has a generateRandomValue() function that spits out a 2 item list (name, value) out the outlet so I can route them to the gui as I had done in my first coll version.

Could anyone help me out with my function syntax? I know how to create a custom "object constructor" using the following syntax:

function createObject (name, hometown, band, food) {
this.name = name;
this.hometown = hometown;
this.band = band;
this.food = food;
}

var array = new createObject(arrayfromargs?)…

but I’m confused as to how to save every new list into a library of arrays (that must be numbered somehow so I can use Math.floor(Math.random()*library.length + 1) to pick a random array to send out the outlet).

Functionality I will also need to implement will be:
- clear library function that erases all the stored array var’s and lets us start over with fresh players
- a way to keep multi-word strings together (for example if someone enters their full name "john smith" instead of just "john" or their favorite band is two or more words "led zeppelin" or "pink floyd"… Maybe I need to worry about this on the Max side of things, and gurantee that I send lists with comma separation between the categories before they get to the js object.
- I’m sure there’s something else I’m overlooking, but hopefully someone can visualize what I am trying to accomplish and give me some hints to get me started

Thanks a bunch!
-G


February 28, 2013 | 6:04 pm

I would recommend you create a class object. Here is a template…

/////////////////////////////////////////////////////////////////
// Class someObj
function someObj(inParam1, inParam2) {

post("creating someObj");

this.publicVar = ‘public’;
var privateVar = ‘private’;
var internalData = Array();
var param1 = inParam1;
var param2 = inParam2;

this.init = function()
{
// do more initialization here
post(‘someMethod’);
}

this.someMethod = function()
{
post(‘someMethod’);
}

// put your initialization here
this.init();
}

Now you can create a list of arrays that contain your objects…

var obj = someObj(1, 2);
var array = new Array(obj, obj, obj);
var arrayList = new Array(array, array, array);


March 6, 2013 | 2:13 am

Thanks for the reply Anthony! I think I follow your thought process here, but those hints are still a little too broad for me to substantiate with functional code… Could you help me with some syntax questions? If I could clear these up, then I think I can fill in the rest;

1) function anything () will run when the js object receives ‘anything’ in its inlet, correct? why then does the function anything () not run when I give the js object the message grab to trigger the grab () function or clear to trigger the clear () function. does this mean anything () will run if and only iff the first word in the received message does not match any function names?

2) If I use an ‘object constructor’, and assign values to the parameters stored in each new object’s array using the "this.name = a[0]" syntax, then isn’t it true that in order to actually create one of these objects, you have to write in a new "var objectName (arrayfromargs) = new objectCreator" line… if you have to write that line in for every time you want a new object created, how do you make it create a new object each time a list is received in the inlet?

3) I need to create a ‘library’ variable that is a two-dimensional array containing all the new objects (each containing a 4 element array with the personal_bio data (name, hometown, band, food))… how do I clear this library of all its stored info when given the message ‘clear’ (how do I write this clear () function?)???

I think I could write this little applet as a standalone javascript script, but I think I am just confused at how javascript and max communicate, and how to handle the creation of new objects, and arrays of objects using only simple message inputs in max. Here is my patch so far, and I also copied the code from the js object in case it wasn’t already included in the compressed patch.

/*

save arrays and generate random output

*/

// inlet-outlet setup

outlets = 4;
setinletassist(0,"user info");
setoutletassist(0,"food");
setoutletassist(1,"band");
setoutletassist(2,"hometown");
setoutletassist(3,"name");

index = 0;

function anything()
{
post ("creating new personal_bio index");
var a = arrayfromargs(messagename, arguments);
//assign a number for the new array, that can be selected randomly in the grab function
this.index = index;
//take arguments and assign them to public variables for the new object
this.name = a[0];
this.hometown = a[1];
this.band = a[2];
this.food = a[3];

index ++;
// next time a list is received, make it the next

}

//create a library (array of all new arrays) of each user’s bio information
newObjectsArray = new array();

function grab ()
{

index = Math.floor(Math.random() x newObjectsArray.length);
return anything.index;

outlet (3, this.a[3]);
outlet (2, this.a[2]);
outlet (1, this.a[1]);
outlet (0, this.a[0]);
}

function clear ()

{
index = 0;

//is this how do you delete all objects?
newObjectsArray = "";

}

{
"boxes" : [ {
"box" : {
"maxclass" : "message",
"text" : "bingo a b c",
"fontname" : "Arial",
"presentation_rect" : [ 793.0, 250.0, 0.0, 0.0 ],
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 527.0, 260.0, 69.0, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-14"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "n// Class someObjnfunction newArray (arrayfromargs) {nnpost("creating someObj");nnthis.name = ‘name’;nvar privateVar = ‘private’;nvar internalData = Array();nvar param1 = inParam1;nvar param2 = inParam2;nnthis.index = function()n{n// do more initialization herenpost(‘someMethod’);n}nnthis.someMethod = function()n{npost(‘someMethod’);n}nn// put your initialization herenthis.init();n}nnNow you can create a list of arrays that contain your objects…nnvar obj = someObj(1, 2);nvar array = new Array(obj, obj, obj);nvar arrayList = new Array(array, array, array); n",
"linecount" : 32,
"fontname" : "Arial",
"presentation_rect" : [ 1161.0, -60.0, 0.0, 0.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 1172.0, -25.0, 353.0, 448.0 ],
"fontsize" : 12.0,
"id" : "obj-13"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "Za",
"fontname" : "Arial",
"presentation_rect" : [ 575.0, 338.0, 0.0, 0.0 ],
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 575.0, 338.0, 50.0, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-10"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "Sly",
"fontname" : "Arial",
"presentation_rect" : [ 500.0, 338.0, 0.0, 0.0 ],
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 500.0, 338.0, 50.0, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-9"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "War",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 427.0, 338.0, 50.0, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-6"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "grab",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 626.0, 273.0, 35.0, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-7"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "// set up inlets/outlets/assist stringsnoutlets = 4;nsetinletassist(0,"bio info as 4 element list");nsetoutletassist(3,"name");nsetoutletassist(2,"hometown");nsetoutletassist(1,"band");nsetoutletassist(0,"food");nnfunction list(name, hometown, band, food) {n this.name = name;n this.hometown = hometown;n this.band = band;n this.food = food;n} nnn/*nnfunction bang()n{noutlet (0, ‘name’);n}nnfunction list()n{n// save incoming list to new array with number identification (base 1)nn// global variables and codenvar info = new Global("my_global_repository");nvar myname = jsarguments[1];nnfunction setname(n)n{n myname = n;n}nnfunction setvalue()n{n var i;n var a = new Array();n n for (i=0;i
"linecount" : 74,
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 1539.0, -19.0, 159.0, 1028.0 ],
"fontsize" : 12.0,
"id" : "obj-4"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Save each list into a numbered array",
"linecount" : 2,
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 211.0, 290.0, 150.0, 34.0 ],
"fontsize" : 12.0,
"id" : "obj-48"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "unpack s s s s",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 4,
"patching_rect" : [ 334.0, 358.0, 87.0, 20.0 ],
"fontsize" : 12.0,
"outlettype" : [ "", "", "", "" ],
"id" : "obj-46"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Pick a random list to print",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 208.0, 242.0, 150.0, 20.0 ],
"fontsize" : 12.0,
"id" : "obj-43"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "clear",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 453.0, -11.0, 37.0, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-41"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "delay 5",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 454.0, -35.0, 49.0, 20.0 ],
"fontsize" : 12.0,
"outlettype" : [ "bang" ],
"id" : "obj-38"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route text",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 2,
"patching_rect" : [ 845.0, 169.0, 61.0, 20.0 ],
"fontsize" : 12.0,
"outlettype" : [ "", "" ],
"id" : "obj-32"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route text",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 2,
"patching_rect" : [ 827.0, 132.0, 61.0, 20.0 ],
"fontsize" : 12.0,
"outlettype" : [ "", "" ],
"id" : "obj-31"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route text",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 2,
"patching_rect" : [ 808.0, 98.0, 61.0, 20.0 ],
"fontsize" : 12.0,
"outlettype" : [ "", "" ],
"id" : "obj-30"
}

}
, {
"box" : {
"maxclass" : "button",
"presentation_rect" : [ 329.0, 48.0, 20.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 385.0, -59.0, 20.0, 20.0 ],
"presentation" : 1,
"outlettype" : [ "bang" ],
"id" : "obj-29"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pack s s s s",
"fontname" : "Arial",
"numinlets" : 4,
"numoutlets" : 1,
"patching_rect" : [ 791.0, 203.0, 73.0, 20.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-27"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "Grove War Sly Za",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 525.0, 238.0, 105.0, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-26"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route text",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 2,
"patching_rect" : [ 790.0, 68.0, 61.0, 20.0 ],
"fontsize" : 12.0,
"outlettype" : [ "", "" ],
"id" : "obj-24"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Fav Food",
"fontname" : "Arial",
"presentation_rect" : [ 86.0, 189.0, 96.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 371.0, 139.0, 96.0, 20.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"id" : "obj-16"
}

}
, {
"box" : {
"maxclass" : "textedit",
"fontname" : "Arial",
"presentation_rect" : [ 190.0, 188.0, 210.0, 25.0 ],
"numinlets" : 1,
"numoutlets" : 4,
"patching_rect" : [ 475.0, 138.0, 210.0, 25.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"outlettype" : [ "", "int", "", "" ],
"id" : "obj-17"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Fav Band",
"fontname" : "Arial",
"presentation_rect" : [ 86.0, 155.0, 96.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 371.0, 105.0, 96.0, 20.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"id" : "obj-18"
}

}
, {
"box" : {
"maxclass" : "textedit",
"fontname" : "Arial",
"presentation_rect" : [ 190.0, 154.0, 210.0, 25.0 ],
"numinlets" : 1,
"numoutlets" : 4,
"patching_rect" : [ 475.0, 104.0, 210.0, 25.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"outlettype" : [ "", "int", "", "" ],
"id" : "obj-21"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Hometown",
"fontname" : "Arial",
"presentation_rect" : [ 85.0, 118.0, 96.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 370.0, 68.0, 96.0, 20.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"id" : "obj-12"
}

}
, {
"box" : {
"maxclass" : "textedit",
"fontname" : "Arial",
"presentation_rect" : [ 189.0, 117.0, 210.0, 25.0 ],
"numinlets" : 1,
"numoutlets" : 4,
"patching_rect" : [ 474.0, 67.0, 210.0, 25.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"outlettype" : [ "", "int", "", "" ],
"id" : "obj-15"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Name",
"fontname" : "Arial",
"presentation_rect" : [ 85.0, 85.0, 96.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 370.0, 34.0, 96.0, 20.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"id" : "obj-11"
}

}
, {
"box" : {
"maxclass" : "textedit",
"fontname" : "Arial",
"presentation_rect" : [ 189.0, 83.0, 210.0, 25.0 ],
"numinlets" : 1,
"numoutlets" : 4,
"patching_rect" : [ 474.0, 33.0, 210.0, 25.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"outlettype" : [ "", "int", "", "" ],
"id" : "obj-8"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "Grove",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 334.0, 330.0, 51.5, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-5"
}

}
, {
"box" : {
"maxclass" : "button",
"presentation_rect" : [ 593.0, 82.0, 20.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 368.0, 242.0, 20.0, 20.0 ],
"presentation" : 1,
"outlettype" : [ "bang" ],
"id" : "obj-3"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "js bio",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 4,
"patching_rect" : [ 368.0, 300.0, 293.0, 20.0 ],
"fontsize" : 12.0,
"outlettype" : [ "", "", "", "" ],
"id" : "obj-1"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Reveal the Identity",
"fontname" : "Arial",
"presentation_rect" : [ 461.0, 140.0, 112.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 4.0, 202.0, 150.0, 20.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"id" : "obj-127"
}

}
, {
"box" : {
"maxclass" : "panel",
"presentation_rect" : [ 484.0, 170.0, 119.0, 63.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"shadow" : 9,
"patching_rect" : [ 860.0, 449.0, 119.0, 63.0 ],
"bgcolor" : [ 0.0, 0.0, 0.0, 0.0 ],
"presentation" : 1,
"border" : 4,
"rounded" : 20,
"id" : "obj-114",
"bordercolor" : [ 1.0, 0.64, 0.0, 1.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Enter Your Information,nThen Press the button",
"linecount" : 2,
"presentation_linecount" : 2,
"fontname" : "Arial",
"presentation_rect" : [ 151.0, 41.0, 150.0, 34.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 9.0, 158.0, 150.0, 34.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"id" : "obj-124"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Pick a random list",
"fontname" : "Arial",
"presentation_rect" : [ 476.0, 83.0, 140.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 10.0, 129.0, 150.0, 20.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"id" : "obj-122"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 947.0, 298.0, 32.5, 18.0 ],
"fontsize" : 12.0,
"outlettype" : [ "" ],
"id" : "obj-120"
}

}
, {
"box" : {
"maxclass" : "toggle",
"presentation_rect" : [ 590.0, 140.0, 20.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 996.0, 358.0, 20.0, 20.0 ],
"presentation" : 1,
"outlettype" : [ "int" ],
"id" : "obj-118"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "pak 0. 0. 0. 1.",
"fontname" : "Arial",
"numinlets" : 4,
"numoutlets" : 1,
"patching_rect" : [ 860.0, 389.0, 154.0, 20.0 ],
"fontsize" : 11.595187,
"outlettype" : [ "" ],
"id" : "obj-47"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "prepend bgcolor",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 1,
"patching_rect" : [ 860.0, 417.0, 92.0, 20.0 ],
"fontsize" : 11.595187,
"outlettype" : [ "" ],
"id" : "obj-49"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "Grove",
"fontname" : "Arial",
"presentation_rect" : [ 521.0, 191.0, 50.0, 18.0 ],
"numinlets" : 2,
"numoutlets" : 1,
"patching_rect" : [ 894.0, 472.0, 50.0, 18.0 ],
"fontsize" : 12.0,
"presentation" : 1,
"outlettype" : [ "" ],
"id" : "obj-82"
}

}
, {
"box" : {
"maxclass" : "panel",
"presentation_rect" : [ 37.0, 23.0, 616.0, 232.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ -20.0, 410.0, 128.0, 128.0 ],
"bgcolor" : [ 0.941176, 0.447059, 0.039216, 1.0 ],
"presentation" : 1,
"id" : "obj-126"
}

}
, {
"box" : {
"maxclass" : "panel",
"presentation_rect" : [ 0.0, -1.0, 696.0, 293.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ -7.0, 487.0, 128.0, 128.0 ],
"bgcolor" : [ 0.0, 0.0, 0.0, 1.0 ],
"presentation" : 1,
"id" : "obj-125"
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-14", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-1", 3 ],
"destination" : [ "obj-10", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-1", 2 ],
"destination" : [ "obj-9", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-1", 1 ],
"destination" : [ "obj-6", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-46", 0 ],
"destination" : [ "obj-82", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-46", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-26", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-41", 0 ],
"destination" : [ "obj-17", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-41", 0 ],
"destination" : [ "obj-21", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-41", 0 ],
"destination" : [ "obj-15", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-41", 0 ],
"destination" : [ "obj-8", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-38", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-38", 0 ],
"destination" : [ "obj-41", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-17", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-21", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-15", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-17", 0 ],
"destination" : [ "obj-32", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-21", 0 ],
"destination" : [ "obj-31", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-15", 0 ],
"destination" : [ "obj-30", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-32", 0 ],
"destination" : [ "obj-27", 3 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-31", 0 ],
"destination" : [ "obj-27", 2 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-30", 0 ],
"destination" : [ "obj-27", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-8", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-27", 0 ],
"destination" : [ "obj-26", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-24", 0 ],
"destination" : [ "obj-27", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-24", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-5", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-120", 0 ],
"destination" : [ "obj-118", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-118", 0 ],
"destination" : [ "obj-47", 3 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-47", 0 ],
"destination" : [ "obj-49", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-49", 0 ],
"destination" : [ "obj-114", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-1", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
]
}


March 6, 2013 | 2:15 am

my bad, here’s the compressed version of my patch…

– Pasted Max Patch, click to expand. –

March 6, 2013 | 10:12 pm

In regards to point 1, the anything function "will run if no specific function is found to match the message symbol", so yes, you’re correct in assuming it won’t run when functions you have specifically defined are called.


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