From Stefan-Tiedje at addcom.de Sun Feb 3 09:27:47 2008 From: Stefan-Tiedje at addcom.de (Stefan Tiedje) Date: Sun Feb 3 09:27:52 2008 Subject: [javascript-dev] Send a list to a named bpatcher Message-ID: <47A5EB83.9000009@addcom.de> Hi list, I am stuck with a seemingly simple problem, which isn't explained clearly enough in archives/docs/examples for me. I want to send a list to a named bpatcher in my patch. How do I have to notate it. I tried the following: var Editor = this.patcher.getnamed("Editor"); function list() { var a = arrayfromargs(arguments); Editor.message("list",a); } Throws a "patcher doesn't understand "list"" error in the Max window I guess its talking to the bpatcher object instead of my patcher loaded into the bpatcher. How do I access my bpatcher correctly? Stefan -- Stefan Tiedje------------x------- --_____-----------|-------------- --(_|_ ----|\-----|-----()------- -- _|_)----|-----()-------------- ----------()--------www.ccmix.com From adamjmurray at gmail.com Fri Feb 15 19:53:29 2008 From: adamjmurray at gmail.com (Adam Murray) Date: Fri Feb 15 19:53:31 2008 Subject: [javascript-dev] Re: Send a list to a named bpatcher In-Reply-To: <47A5EB83.9000009@addcom.de> Message-ID: <1f955.47b65029@www.cycling74.com> Did you ever figure this out? I don't see a way either. I remember a recent forum thread where someone else was complaining they couldn't script a bpatcher properly. Maybe this isn't supported in Max 4? I'd work around it by adding another named object that can be scripted properly, and connect that to the bpatcher. -- Adam Murray compusition.com From cjlacke at ilstu.edu Sun Feb 17 18:59:10 2008 From: cjlacke at ilstu.edu (Seejay James) Date: Sun Feb 17 18:59:12 2008 Subject: [javascript-dev] Re: gl orientation and "moving forward" In-Reply-To: <1eb8c.47846bfe@www.cycling74.com> Message-ID: <1fa5b.47b8e66d@www.cycling74.com> It's nice to experiment with the js so you can determine the commands that are possible, and be able to do just what you want. That said, you should also look at jit.gl.sketch and its cousins (gridshape is another good one) since there's a lot taken care of already, and may be better optimized (?). I did a lot of stuff within jsui, and while I don't regret the time spent fiddling, there was a lot ready-to-go in the jit.gl.sketch that I should have explored first, which can readily take advantage of simple max messages (i.e., "color 1. 0. 0. 0.5" for red at 50% alpha, formatted thru a swatch and a slider). Not only that, but you can then attach a jit.gl.handle to your Render object, so you can accomplish lots of perspective changing intuitively. Most of the commands to jit.gl.sketch also work for jit.gl.render, so stuff like "rotatexyz" will work on an object-by-object basis for the jit.gl.sketch parts, and a scene basis for the jit.gl.render part (with multiple streams going at once if you want). Controlling things like color / alpha, blend modes, line width or point size, etc., is easy and gives you a lot of options.... textures are also readily available to apply to whatever shapes you have. For more crazy fun check out jit.gl.model and use a 3D program to generate some .obj models, then use them in your sketch scene... great stuff! --CJ From cjlacke at ilstu.edu Sun Feb 17 23:28:45 2008 From: cjlacke at ilstu.edu (Seejay James) Date: Sun Feb 17 23:28:49 2008 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <5501F927-6B70-4585-9F5F-B4815FACE9F1@lowfrequency.org> Message-ID: <1fa79.47b9259b@www.cycling74.com> Personally I find javascript very useful --- easy to get things rolling with its connection to Max, especially for list work and some other tasks that come up. Yes, the speed is bad for jsui, but that's only one small part of the roles js can play in Max. There's more than enough ways to create fast, lower-CPU interface objects through jitter and the gl.sketch stuff, and they can look truly amazing (though actual moving textures slow things down, if you get that fancy). I especially like gridshape, as you can set to solid / wire / points and customize the appearance so readily (not to mention "auto-dimensionalizing", if that's a word). Of course you have to map out the interaction with the mouse or whatever you're using, but that's the case with jsui too. Using something like gridshape allows you to skip the js altogether, if you want to. Interesting thread, glad to see it stayed productive. Performance issues like this will fairly soon be non-issues, at least for most applications. And language integration will of course evolve for more and more functionality and development options. --CJ From gary.nelson at oberlin.edu Thu Feb 21 13:10:45 2008 From: gary.nelson at oberlin.edu (Gary Lee Nelson) Date: Thu Feb 21 13:10:51 2008 Subject: [javascript-dev] Global variables in .js Message-ID: I am getting into java scripting finally and have a very basic question. My first project is to cast my random objects into java via mxj. All of my objects share a single random seed so I am wondering if multiple instances of "gln.rand.js" can share a variable that holds the global seed. Cheers Gary Lee Nelson Oberlin College www.timara.oberlin.edu/GaryLeeNelson From c74-mailinglists at e--j.com Thu Feb 21 13:17:41 2008 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Thu Feb 21 13:17:46 2008 Subject: [javascript-dev] Global variables in .js In-Reply-To: References: Message-ID: <7A51D85C-AF02-4E9C-B7CD-058501FD180B@e--j.com> On 21 f?vr. 08, at 21:10, Gary Lee Nelson wrote: > I am getting into java scripting finally and have a very basic > question. My > first project is to cast my random objects into java via mxj. All > of my > objects share a single random seed so I am wondering if multiple > instances > of "gln.rand.js" can share a variable that holds the global seed. Have a look to the Global object (in JavaScriptInMax.pdf). ej From cycling74forum at opuslocus.net Thu Feb 21 13:51:27 2008 From: cycling74forum at opuslocus.net (John Pitcairn) Date: Thu Feb 21 13:51:29 2008 Subject: [javascript-dev] Re: Global variables in .js In-Reply-To: <7A51D85C-AF02-4E9C-B7CD-058501FD180B@e--j.com> Message-ID: <1fddc.47bde44e@www.cycling74.com> Also, from memory, if you declare a top-level variable without "var" in a .js file, it becomes global to all js objects loading that file, ie: gvar = "check1"; // global to all instances var avar = "check2" // local to this instance From gary.nelson at oberlin.edu Thu Feb 21 14:13:31 2008 From: gary.nelson at oberlin.edu (Gary Lee Nelson) Date: Thu Feb 21 14:13:57 2008 Subject: [javascript-dev] Re: Global variables in .js In-Reply-To: <1fddc.47bde44e@www.cycling74.com> Message-ID: Yes, that seems to be correct although somewhere I think the documentation says that variable can be know by ALL .js objects in the patch and not just instances of a particular file. Is this true? Can you declare a global variable without giving it an initial value or initialize only when the first instance is loaded? Cheers Gary Lee Nelson Oberlin College www.timara.oberlin.edu/GaryLeeNelson On 2/21/08 3:51 PM, "John Pitcairn" wrote: > > Also, from memory, if you declare a top-level variable without "var" in a .js > file, it becomes global to all js objects loading that file, ie: > > gvar = "check1"; // global to all instances > var avar = "check2" // local to this instance > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev From cycling74forum at opuslocus.net Thu Feb 21 16:27:11 2008 From: cycling74forum at opuslocus.net (John Pitcairn) Date: Thu Feb 21 16:27:18 2008 Subject: [javascript-dev] Re: Re: Global variables in .js In-Reply-To: Message-ID: <1fe02.47be08ce@www.cycling74.com> Quote: Gary Lee Nelson wrote on Fri, 22 February 2008 10:13 ---------------------------------------------------- > Yes, that seems to be correct although somewhere I think the documentation says that variable can be know by ALL .js objects in the patch and not just instances of a particular file. Is this true? I think that's referring to a global Object created with "new Global()". I remember the global var behaviour I'm referring to being somewhat obscure and undocumented except on this list. I could be wrong on that though. > Can you declare a global variable without giving it an initial value or initialize only when the first instance is loaded? Not with the var syntax. But using the object, something like this(?): var myglobal = new Global('globalname'); // access/create a shared named global object, store locally as "myglobal" if(!myglobal.myvalue && myglobal.myvalue !== 0 && myglobal.myvalue !== false) myglobal.myvalue = "inited"; // test for existence of global object's "myvalue" property, init if required, note strict type test for false and 0 is required if those might be inited values From JLubow at alumnae.mills.edu Fri Feb 22 00:44:06 2008 From: JLubow at alumnae.mills.edu (jLubow) Date: Fri Feb 22 00:44:08 2008 Subject: [javascript-dev] Re: gl orientation and "moving forward" In-Reply-To: <1fa5b.47b8e66d@www.cycling74.com> Message-ID: <1fe23.47be7d44@www.cycling74.com> Yes, it's fun to work with jit.gl.sketch w/ js. But when you don't have jitter on a given machine, it's always nice to have a backup. :) I don't mind spending the time if I can port the code over in some fashion... cheers, jl From gary.nelson at oberlin.edu Fri Feb 22 06:04:54 2008 From: gary.nelson at oberlin.edu (Gary Lee Nelson) Date: Fri Feb 22 06:04:57 2008 Subject: [javascript-dev] Global variables in .js In-Reply-To: <7A51D85C-AF02-4E9C-B7CD-058501FD180B@e--j.com> Message-ID: And all is revealed! Thanks EJ. On 2/21/08 3:17 PM, "Emmanuel Jourdan" wrote: > Have a look to the Global object (in JavaScriptInMax.pdf). > > ej Cheers Gary Lee Nelson Oberlin College www.timara.oberlin.edu/GaryLeeNelson