From c74-mailinglists at e--j.com Mon Oct 1 04:41:21 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Mon Oct 1 04:41:41 2007 Subject: [javascript-dev] [ANN] MaxMSP Developer workshop at Ircam (Novemeber 10 & 11) Message-ID: <257118EC-2836-4F92-A832-F4F8E41FD599@e--j.com> Sorry for crost posting? ej > => Information and registration forms can be found on the IRCAM > website: http://www.ircam.fr/673.html?event=611&L=1 > > > MAX/MSP DEVELOPER WORKSHOP > SATURDAY 10 AND SUNDAY 11, NOVEMBER - IRCAM > > For experienced computer programmers only, this workshop will cover > developing Max/MSP, Jitter and FTM objects in Javascript, C and C+ > +. This workshop will be taught in English by IRCAM and Cycling?74 > staff members, however questions and answers in French are possible. > Participants must already master Max/MSP, the Javascript, C and C++ > and development environments XCode (Mac) and Visual Studio (PC). > Limited to 20 participants. > Fee 250 ? (-50% for Forum members). > Contact : Florence.Quilliard@ircam.fr > > > Planning : > > Saturday, November 10 > 9h30 ? Welcome > 10h00-13h00 : Writing objects in Javascript > Emmanuel Jourdan (IRCAM and Cycling '74) > 13h00-14h30 : lunch > 14h30-17h30 : Writing external objects in C > Jeremy Bernstein (Cycling '74) > > Sunday, November 11 > 10h00-13h00 : Writing external objects for Jitter. > Joshua Kit Clayton (Cycling '74) > 13h00-14h30 : lunch > 14h30-17h30 : Writing external objects for FTM. > Norbert Schnell and Diemo Schwarz (IRCAM). From cycling at editions-ihs.com Wed Oct 3 08:09:59 2007 From: cycling at editions-ihs.com (Salvator) Date: Wed Oct 3 08:10:01 2007 Subject: [javascript-dev] JSUI : question about Array index/value Message-ID: <1c90b.4703a2b5@www.cycling74.com> Hi, I'm working on a JSUI knob meant for a compressor knee. SO I've setted an Array with my knee settings : var Ratio = ["1:1", "2:1", "3:1","4:1", "6:1", "10:1", "]; My goal is to be able to control this jsui knob by sending message of the knee settings (ex:10:1), rather than float or int (i.e. NOT by sending the array index). Thus my question : Is it possible to send a "value" to an Array, so it check if it match the content, and if positive retrieve the array index for that "value" ? ie. for var Ratio = ["1:1", "2:1", "3:1","4:1", "6:1", "10:1"]; // index's are 0 1 2 3 4 5 I send the message "3:1" and I get back the index of this value wich is "2". I've tried with vregexp.exec(Ratio) etc... but I lack skill in java and I have no good results. So far, I'm doing like this : function ratio(input) { switch (input) { case "1:1": msg_float(0) ;break; case "2:1": msg_float(1) ;break; case "3:1": msg_float(2) ;break; case "4:1": msg_float(3) ;break; case "6:1": msg_float(4) ;break; case "10:1": msg_float(5) ;break; case "20:1": msg_float(6) ;break; case "NUKE": msg_float(7) ;break; } } This works, but I want to use this code on much bigger arrays(like for a fixed frequency knob with dozen of frequency), and it'll be hard to manage all those cases lines. Especially if I make change in the array order and number etc... Second question : Actually I have to pass a message with a prefix "ratio 3:1" , to enter the function ratio(input). Is there anyway to make it work just by sending a single symbol "3:1" ? Is is possible at all to send single symbol message to jsui ? Thanks for any help or advice ! Salvator From lists at simonadcock.co.uk Wed Oct 3 08:38:20 2007 From: lists at simonadcock.co.uk (lists@simonadcock.co.uk) Date: Wed Oct 3 08:38:23 2007 Subject: [javascript-dev] JSUI : question about Array index/value In-Reply-To: <1c90b.4703a2b5@www.cycling74.com> Message-ID: <000a01c805cb$0b367f40$150ba8c0@simonslaptop> I'm no expert either, but I'd have thought something along the lines of this would be work: var Ratio = ["1:1", "2:1", "3:1","4:1", "6:1", "10:1"]; function ratio(a) { for(i=0; i Message-ID: <1c910.4703ab53@www.cycling74.com> That's odd. Just incase you're looking at the forum view not the email list here's the js code again with out the bits missing... ?! var Ratio = ["1:1", "2:1", "3:1","4:1", "6:1", "10:1"]; function ratio(a) { for(i=0; i References: <1c910.4703ab53@www.cycling74.com> Message-ID: On 3 oct. 07, at 16:46, simon adcock wrote: > That's odd. Just incase you're looking at the forum view not the > email list here's the js code again with out the bits missing... ?! > > var Ratio = ["1:1", "2:1", "3:1","4:1", "6:1", "10:1"]; > > function ratio(a) > { > for(i=0; i { > if(Ratio[i] == a) > { > outlet(0, i); > } > } > } One small thing, don't forget to declare the "i" variable with the var keyword, otherwise it becomes global. ej From cycling at editions-ihs.com Thu Oct 4 01:18:46 2007 From: cycling at editions-ihs.com (Salvator) Date: Thu Oct 4 01:18:49 2007 Subject: [javascript-dev] Re: JSUI : question about Array index/value In-Reply-To: <1c90b.4703a2b5@www.cycling74.com> Message-ID: <1c981.470493d6@www.cycling74.com> Thanks, It works !! Emmanuel, I'm nt sure to understand ... You mean just adding "var i=0" inside the function ? Any idea about my question #2 : Actually I have to pass a message with a prefix "ratio 3:1" , to enter the function ratio(input). Is there anyway to make it work just by sending a single symbol "3:1" ? Is it possible at all to send single symbol message to jsui ? Salvator From c74-mailinglists at e--j.com Thu Oct 4 02:08:59 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Thu Oct 4 02:09:09 2007 Subject: [javascript-dev] Re: JSUI : question about Array index/value In-Reply-To: <1c981.470493d6@www.cycling74.com> References: <1c981.470493d6@www.cycling74.com> Message-ID: <2AE26657-9C9E-4AF9-89CA-02B663633406@e--j.com> On 4 oct. 07, at 09:18, Salvator wrote: > Thanks, It works !! > > Emmanuel, > I'm nt sure to understand ... You mean just adding "var i=0" inside > the function ? if you don't use the var keyword, the variable is automatically declared as global (in the JavaScript meaning, not the Global object). And it's usually very hard to figure out the problem (for example, if you have 2 jsui running at the same time, they will share the i variable, which is really not what we want in such situation). > Any idea about my question #2 : > Actually I have to pass a message with a prefix "ratio 3:1" , to > enter the function ratio(input). > > Is there anyway to make it work just by sending a single symbol > "3:1" ? Is it possible at all to send single symbol message to jsui ? Have a look to the anythinng() method. The message name property should have the symbol "3:1". Although I didn't test, the following should work: var Ratio = ["1:1", "2:1", "3:1","4:1", "6:1", "10:1"]; function anything() { var i; // this is really important ;-) for(i = 0; i < Ratio.length; i++) { if(Ratio[i] == messagename) outlet(0, i); } } ej From cycling at editions-ihs.com Thu Oct 4 03:40:08 2007 From: cycling at editions-ihs.com (Salvator) Date: Thu Oct 4 03:40:09 2007 Subject: [javascript-dev] Re: JSUI : question about Array index/value In-Reply-To: <1c90b.4703a2b5@www.cycling74.com> Message-ID: <1c989.4704b4f8@www.cycling74.com> It Works ! Your help is much much apprectiated : Thanks again ! Salvator From mattijs at smadsteck.nl Thu Oct 4 04:11:07 2007 From: mattijs at smadsteck.nl (Mattijs Kneppers) Date: Thu Oct 4 04:11:09 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: <1c988.4704b351@www.cycling74.com> Message-ID: <1c98c.4704bc3b@www.cycling74.com> Btw I moved this topic to the javascript forum, mailing list users please reply to the javascript list. -- SmadSteck - http://www.smadsteck.nl Hard- and software for interactive audiovisual sampling From thijskoerselman at gmail.com Thu Oct 4 07:33:53 2007 From: thijskoerselman at gmail.com (Thijs Koerselman) Date: Thu Oct 4 07:33:55 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: Message-ID: <1c9a8.4704ebc0@www.cycling74.com> On 10/4/07, joshua goldberg wrote: > what about using jit.gl.lua in a jit.pwindow? It works, but an integrated solution would be much nicer imo. 2 issues with this workaround that come to mind: - you can't know when to update your window, so you're always updating even though your pwindow might not be visible at the time. - there is no equivalent to jitter listener in jit.gl.lua. afaik. You have to manually connect the mouse events of the window to jit.gl.lua I totally agree with Invect. I've tried to do serious UI design in both JSUI and JS+gl.sketch+pwindow. The latter being an order of magnitude faster obviously. In my last attempt (multilayer sequencer and curve editor) I wasted a lot of time only to end up with an unscalable and slow 3000+ lines Javascript file that is now useless to me. If I could go back I'd now probably do the whole thing in C++ but that kind of defeats the idea of using Max for me. I'd end up with something more like a standalone app rather than dynamic and reusable Max components. Since the arrival of Lua support in Max I've been investigating several ways to design a UI library to be used with jit.gl.lua, but I fear I might not have the time or the experience to come up with a sustainable solution on my own. If Lua ever will be fully integrated with Max, similar to Javascript is now (UI design + Pattr support), I'd be an extremely happy person. My 2 cents, Thijs From radarsat1 at gmail.com Thu Oct 4 08:33:05 2007 From: radarsat1 at gmail.com (Stephen Sinclair) Date: Thu Oct 4 08:33:08 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: <1c9a8.4704ebc0@www.cycling74.com> References: <1c9a8.4704ebc0@www.cycling74.com> Message-ID: <9b3e2dc20710040733q104376d3j64ee1262719e0334@mail.gmail.com> > In my last attempt (multilayer sequencer and curve editor) I wasted a lot of time only to end up with an unscalable and slow 3000+ lines Javascript file that is now useless to me. I've been down a similar road. (Though not 3000 lines.. ;-) I integrated a semi-complicated data structure visualization with JSUI. It looked really nice, but as you said was quite slow. Also, the visualization in question was intended to go inside a bpatcher, and it turns out JSUI doesn't play very well with this, often drawing outside the bpatcher boundaries. I'm actually at the moment creating an LCD-based alternative, which is working fine, though not as pretty. We're still using Javascript for other tasks. I never figured out if it's the javascript itself or just the JSUI stuff that is slow. I get the impression is the latter, but would need to find some way to test it. Steve From jkc at musork.com Thu Oct 4 11:52:11 2007 From: jkc at musork.com (Joshua Kit Clayton) Date: Thu Oct 4 11:52:21 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: <9b3e2dc20710040733q104376d3j64ee1262719e0334@mail.gmail.com> References: <1c9a8.4704ebc0@www.cycling74.com> <9b3e2dc20710040733q104376d3j64ee1262719e0334@mail.gmail.com> Message-ID: <45E1CF7A-1AE8-49A0-9C1C-F5800D660D5B@musork.com> On Oct 4, 2007, at 7:33 AM, Stephen Sinclair wrote: > I'm actually at the moment creating an LCD-based alternative, which is > working fine, though not as pretty. We're still using Javascript for > other tasks. > > I never figured out if it's the javascript itself or just the JSUI > stuff that is slow. I get the impression is the latter, but would > need to find some way to test it. Btw, if you disable FSAA (full scene anti-aliasing), JSUI drawing code is 2-4x faster. Lua's a great language and we're looking at easier ways for anyone to make language bindings. So, no need to ditch JS. Btw, the Tamarin VM which is slated for the next version of the SpiderMonkey JS implementation is significantly faster. Personally, if speed/memory is the utmost concern, I'd drop down to C. -Joshua From looseonthestreet at gmail.com Thu Oct 4 12:09:44 2007 From: looseonthestreet at gmail.com (Zola) Date: Thu Oct 4 12:09:45 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <45E1CF7A-1AE8-49A0-9C1C-F5800D660D5B@musork.com> Message-ID: <1c9ce.47052c68@www.cycling74.com> The one thing I was hoping not to bring into this thread is another post from JKC about disabling antialiasing on JSUI. JKC, You've already said it on this forum 20 times. We know. Today while doing research, I read the standard "jkc-antialiasing-signature" at least 10 times. Come on. From looseonthestreet at gmail.com Thu Oct 4 12:13:04 2007 From: looseonthestreet at gmail.com (Zola) Date: Thu Oct 4 12:13:06 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <1c9ce.47052c68@www.cycling74.com> Message-ID: <1c9cf.47052d30@www.cycling74.com> I am so sick of seeing you reply to every single person about disabling antialiasing for "2 to 4x" speed benefit. It's as if it somehow allows you to slink away from the issue. EVERY TIME. From wesley.hoke at gmail.com Thu Oct 4 12:17:52 2007 From: wesley.hoke at gmail.com (Wesley Smith) Date: Thu Oct 4 12:17:56 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: <1c9a8.4704ebc0@www.cycling74.com> References: <1c9a8.4704ebc0@www.cycling74.com> Message-ID: <1079b050710041117t7259437bx712cdcaccfda12af@mail.gmail.com> > - there is no equivalent to jitter listener in jit.gl.lua. afaik. You have to manually connect the mouse events of the window to jit.gl.lua Not true! listener = jit.listener(this.drawto, callbackfunc); wes From jkc at musork.com Thu Oct 4 13:22:28 2007 From: jkc at musork.com (Joshua Kit Clayton) Date: Thu Oct 4 13:22:53 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <1c9cf.47052d30@www.cycling74.com> References: <1c9cf.47052d30@www.cycling74.com> Message-ID: <9ACC74AC-D63D-4EA0-87CD-88C41D41BBA0@musork.com> On Oct 4, 2007, at 11:13 AM, Zola wrote: > > I am so sick of seeing you reply to every single person about > disabling antialiasing for "2 to 4x" speed benefit. > It's as if it somehow allows you to slink away from the issue. > EVERY TIME. Sorry, but some people don't read the archives, and/or forget this fact. The reason that JSUI is slow is that it uses a software based OpenGL renderer, and uses 4x multi-sampling if fsaa is enabled (which it is by default). Switching to lua with this same means of rendering will not make much performance difference as the bottleneck is in the drawing. In this case it's not a language perf issue. If you want to make things faster, use js+jit.gl.sketch, or jit.gl.lua with jit.pwindow, which is HW accelerated. As for Lua vs. JS VM performance comparisons. Of course you're right. There are a number of reasons why JS was chosen, and why we're committed to it as a supported scripting language in Max. With Tamarin, the VM performance discrepancy between Lua and JS will not be such an issue. I appreciate your frustration, but there is nothing preventing you or other people from integrating Lua into Max. In fact two people, have already have done this. There's no need to be impolite. Thanks, Joshua From looseonthestreet at gmail.com Thu Oct 4 13:50:19 2007 From: looseonthestreet at gmail.com (Zola) Date: Thu Oct 4 13:50:21 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <9ACC74AC-D63D-4EA0-87CD-88C41D41BBA0@musork.com> Message-ID: <1c9d7.470543f9@www.cycling74.com> Joshua, Yes, making a lua extern takes just a few hours of work with luabind. I've done so. But the key issue here is something else. Sketch is great. jit.gl.sketch + jit.gl.pwindow works well in the mostly-monolithic scenario. While I have no issues pushing towards eight sketches, it doesn't work out for atomic. With Sketch, I would not create a whole set of building block UI components to use everywhere and love. I use Sketch for centerpiece UI's. Not for lego-bricks. Atomicity is what JSUI is supposed to be able to do. And that's where it fails too. It's too slow for that. So really, there is no use-case for JSUI: We don't want it for atomic, (watch everything freeze up completely.)(hear your music die) And we don't want it for what Sketch does. I am driving at a stronger point here. A powerful, fast, take-it-for-granted-that-it-just-works-fundamental-essential-building-block-of-the-whole-entire-MAX-idea, A way of building UI components to go inside of Max, Perfectly. As a core-feature of Max, is so important. It's the basics, man. It baffles me how Cycling has placed such little importance on getting this right, and allows JSUI to remain a failure. The need is so obvious. - Invect From wesley.hoke at gmail.com Thu Oct 4 13:58:33 2007 From: wesley.hoke at gmail.com (Wesley Smith) Date: Thu Oct 4 13:58:37 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <1c9d7.470543f9@www.cycling74.com> References: <9ACC74AC-D63D-4EA0-87CD-88C41D41BBA0@musork.com> <1c9d7.470543f9@www.cycling74.com> Message-ID: <1079b050710041258uc92a541gd8ae55bcc60b409d@mail.gmail.com> Zola full of lightning? On 10/4/07, Zola wrote: > > Joshua, > > Yes, making a lua extern takes just a few hours of work with luabind. I've done so. But the key issue here is something else. > > Sketch is great. jit.gl.sketch + jit.gl.pwindow works well in the mostly-monolithic scenario. While I have no issues pushing towards eight sketches, it doesn't work out for atomic. > > With Sketch, I would not create a whole set of building block UI components to use everywhere and love. I use Sketch for centerpiece UI's. Not for lego-bricks. > > Atomicity is what JSUI is supposed to be able to do. > And that's where it fails too. > It's too slow for that. > > So really, there is no use-case for JSUI: > We don't want it for atomic, (watch everything freeze up completely.)(hear your music die) > And we don't want it for what Sketch does. > > I am driving at a stronger point here. > A powerful, fast, take-it-for-granted-that-it-just-works-fundamental-essential-building-block-of-the-whole-entire-MAX-idea, > A way of building UI components to go inside of Max, > Perfectly. As a core-feature of Max, > is so important. > It's the basics, man. > It baffles me how Cycling has placed such little importance on getting this right, > and allows JSUI to remain a failure. > The need is so obvious. > > - Invect > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev > From looseonthestreet at gmail.com Thu Oct 4 14:01:25 2007 From: looseonthestreet at gmail.com (Zola) Date: Thu Oct 4 14:01:27 2007 Subject: [javascript-dev] Re: Re: Re: Re: jsui was a mistake. In-Reply-To: <1079b050710041258uc92a541gd8ae55bcc60b409d@mail.gmail.com> Message-ID: <1c9d9.47054695@www.cycling74.com> Quote: wesley.hoke@gmail.com wrote on Thu, 04 October 2007 13:58 ---------------------------------------------------- > Zola full of lightning? > Ack. I can never edit my posts. jit.pwindow From jkc at musork.com Thu Oct 4 14:01:22 2007 From: jkc at musork.com (Joshua Kit Clayton) Date: Thu Oct 4 14:01:27 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <1c9d7.470543f9@www.cycling74.com> References: <1c9d7.470543f9@www.cycling74.com> Message-ID: On Oct 4, 2007, at 12:50 PM, Zola wrote: > Sketch is great. jit.gl.sketch + jit.gl.pwindow works well in the > mostly-monolithic scenario. While I have no issues pushing towards > eight sketches, it doesn't work out for atomic. You might find jitter-gui-sliderexample.pat useful for your purposes. Similar strategies could be used in jit.gl.lua, and are also expose with the Java Jitter binding. -Joshua From jkc at musork.com Thu Oct 4 14:01:56 2007 From: jkc at musork.com (Joshua Kit Clayton) Date: Thu Oct 4 14:02:01 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <1079b050710041258uc92a541gd8ae55bcc60b409d@mail.gmail.com> References: <9ACC74AC-D63D-4EA0-87CD-88C41D41BBA0@musork.com> <1c9d7.470543f9@www.cycling74.com> <1079b050710041258uc92a541gd8ae55bcc60b409d@mail.gmail.com> Message-ID: <286438FA-00C9-4A7E-9FE1-D34FFB508C20@musork.com> On Oct 4, 2007, at 12:58 PM, Wesley Smith wrote: > Zola full of lightning? Completely :) -Joshua From mzed at cnmat.berkeley.edu Thu Oct 4 14:13:46 2007 From: mzed at cnmat.berkeley.edu (mzed) Date: Thu Oct 4 14:14:08 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: <1c988.4704b351@www.cycling74.com> Message-ID: <1c9de.4705497a@www.cycling74.com> Quote: Zola wrote on Thu, 04 October 2007 02:33 ---------------------------------------------------- > Javascript for the UI was a big mistake and nothing can be done about it, short of: > Cut your losses. > LUA is completely superior. > ---------------------------------------------------- If for no other reason than the Lua sibling of jsui could be called lui-lui. mz -- || michael f. zbyszynski -- molecular gastronimist || http://www.cnmat.berkeley.edu/ || http://www.mikezed.com/ From looseonthestreet at gmail.com Thu Oct 4 14:45:58 2007 From: looseonthestreet at gmail.com (Zola) Date: Thu Oct 4 14:46:00 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <45E1CF7A-1AE8-49A0-9C1C-F5800D660D5B@musork.com> Message-ID: <1c9df.47055105@www.cycling74.com> Joshua, > Lua's a great language and we're looking at easier ways for anyone to > make language bindings. So, no need to ditch JS. Btw, the Tamarin VM > which is slated for the next version of the SpiderMonkey JS > implementation is significantly faster. Personally, if speed/memory Tamarin will not be fast. We already know that. The deal is done. If you are reserving some future hope that Tamarin will come in and save the day, No chance. If you would like proof of that fact, Your proof will only come when you read-back on my forum posting in 3 years from now, and Tamarin has solved nothing. Fundamentally it is impossible for Tamarin to ever be fast. Please check here: http://ejohn.org/apps/js-speed/results/ Notice how Tamarin is ~20% faster than SpiderMonkey. 20% is not significantly faster. It's not an order of magnitude faster like Lua, or using 150 times less memory, like Lua. LuaJIT can be 10 to 40 times faster. Tamarin is a big bloated piece of Junk with a huge codebase. Major KLOCage goes into concerns WEB SECURITY ISSUES. It's complete bullshit for Max/Msp. >From wikipedia: " __What Tamarin is not__ Adobe contributed code for its virtual machine and the JIT compiler. The JavaScript compiler (the program generating bytecode from JavaScript source code) was not contributed as part of Tamarin. The contributed code will be integrated with SpiderMonkey to produce a complete JavaScript engine. Tamarin is not the same as Adobe's Flash player, which remains closed source. The virtual machine is only a part of the Flash player, and will be a part of future versions of Mozilla/Firefox. " It's not a micro-VM like Lua is. And that's what something like Max needs. Javascript is worth giving up on. Let's see Max/Msp become amazing. Remove the things which stand in your way. - Invect From jkc at musork.com Thu Oct 4 14:53:07 2007 From: jkc at musork.com (Joshua Kit Clayton) Date: Thu Oct 4 14:53:11 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <1c9df.47055105@www.cycling74.com> References: <1c9df.47055105@www.cycling74.com> Message-ID: <239AB3B5-59F2-45A0-B1C1-2285B3B77A5E@musork.com> On Oct 4, 2007, at 1:45 PM, Zola wrote: > It's not a micro-VM like Lua is. > And that's what something like Max needs. No argument. > Javascript is worth giving up on. Won't happen. It's not an either or question. -Joshua From radarsat1 at gmail.com Thu Oct 4 15:52:36 2007 From: radarsat1 at gmail.com (Stephen Sinclair) Date: Thu Oct 4 15:52:43 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <9ACC74AC-D63D-4EA0-87CD-88C41D41BBA0@musork.com> References: <1c9cf.47052d30@www.cycling74.com> <9ACC74AC-D63D-4EA0-87CD-88C41D41BBA0@musork.com> Message-ID: <9b3e2dc20710041452q48e083f1p22d7f0dd92e67d42@mail.gmail.com> > The reason that JSUI is slow is that it uses a software based > OpenGL renderer Aha! *NOW* i understand why JSUI is slow. ;-) It has nothing to do with the FSAA per-say.. this software-based rendering is of course going to be slow. Surely it might be eventually possible to drop-in a more efficient renderer that takes advantage of the operating system facilities for OpenGL? (Maybe this is planned, sorry I haven't read about the upcoming version yet..) By the way I don't share Zola's opinion here. I think JavaScript is actually quite a decent language. As for speed of execution, I pretty much always expect interpreted languages to be slow and never expect to use them in time-critical tasks. This is what C is for. I never did understand why the JSUI stuff seemed slower than need be, but I didn't realized it was completely software rendered... (thus.. defeating the purpose of using OpenGL?? Though I'm sure it made it easier to implement.) Steve From thijskoerselman at gmail.com Thu Oct 4 16:22:27 2007 From: thijskoerselman at gmail.com (Thijs Koerselman) Date: Thu Oct 4 16:22:29 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <1079b050710041117t7259437bx712cdcaccfda12af@mail.gmail.com> Message-ID: <1c9e6.470567a2@www.cycling74.com> >> - there is no equivalent to jitter listener in jit.gl.lua. afaik. You have to manually connect the mouse events of the window to jit.gl.lua > Not true! > listener = jit.listener(this.drawto, callbackfunc); Oops my bad! Don't know how I missed that one... Thijs From wesley.hoke at gmail.com Thu Oct 4 16:30:09 2007 From: wesley.hoke at gmail.com (Wesley Smith) Date: Thu Oct 4 16:30:11 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <1c9e6.470567a2@www.cycling74.com> References: <1079b050710041117t7259437bx712cdcaccfda12af@mail.gmail.com> <1c9e6.470567a2@www.cycling74.com> Message-ID: <1079b050710041530p75f39dffp3933fa10e05965ad@mail.gmail.com> There's an example in the jit.gl.lua download for listener stuff. It currently takes a string argument. I've been meaning to change this to take an actual lua function but haven't got around to it. wes On 10/4/07, Thijs Koerselman wrote: > > >> - there is no equivalent to jitter listener in jit.gl.lua. afaik. You have to manually connect the mouse events of the window to jit.gl.lua > > > Not true! > > > listener = jit.listener(this.drawto, callbackfunc); > > Oops my bad! Don't know how I missed that one... > > Thijs > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev > From jkc at musork.com Thu Oct 4 16:48:33 2007 From: jkc at musork.com (Joshua Kit Clayton) Date: Thu Oct 4 16:48:38 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <9b3e2dc20710041452q48e083f1p22d7f0dd92e67d42@mail.gmail.com> References: <1c9cf.47052d30@www.cycling74.com> <9ACC74AC-D63D-4EA0-87CD-88C41D41BBA0@musork.com> <9b3e2dc20710041452q48e083f1p22d7f0dd92e67d42@mail.gmail.com> Message-ID: <1E7B82A5-4ABE-4DA4-9277-06F4E7FD24A5@musork.com> On Oct 4, 2007, at 2:52 PM, Stephen Sinclair wrote: > > Aha! *NOW* i understand why JSUI is slow. ;-) > It has nothing to do with the FSAA per-say.. this software-based > rendering is of course going to be slow. Btw, I don't think it should be much slower than the LCD you are using if you set fsaa to zero (which is why I mentioned that old tidbit again). As for drop in alternate renderers, you can relatively easily change Sketch to jit.gl.sketch with jit.pwindow for HW accelerated OpenGL with similar JS code. -Joshua From cycling74forum at opuslocus.net Thu Oct 4 17:12:04 2007 From: cycling74forum at opuslocus.net (John Pitcairn) Date: Thu Oct 4 17:12:05 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <1E7B82A5-4ABE-4DA4-9277-06F4E7FD24A5@musork.com> Message-ID: <1c9f3.47057343@www.cycling74.com> Quote: jkc wrote on Fri, 05 October 2007 10:48 ---------------------------------------------------- > Btw, I don't think it should be much slower than the LCD you > are using if you set fsaa to zero I also investigated using JSUI for my UI, largely to make use of the better antialiased text and easy scaling/resizing. My display requirements (and thus my internal drawing overhead) are actually very simple. What killed the deal for me seems to be the overhead involved in passing messages from Max into JSUI. I'm dealing with a fairly dense stream of input messages in some situations, and JSUI required an order of magnitude more CPU time than LCD for the same task when I prototyped using both. Yes, FSAA was off. If anything could be done about that overhead, I'd certainly look at JSUI again. Alternately, an OpenGL-based native version of LCD that accepts the equivalent OpenGL commands as Max messages would be most welcome, and possibly more future-proof(?). In Max, not Jitter. But maybe that's not possible? From pcastine at gmx.net Fri Oct 5 04:37:40 2007 From: pcastine at gmx.net (Peter Castine) Date: Fri Oct 5 04:37:44 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <45E1CF7A-1AE8-49A0-9C1C-F5800D660D5B@musork.com> Message-ID: <1ca28.470613f3@www.cycling74.com> Quote: jkc wrote on Thu, 04 October 2007 19:52 ---------------------------------------------------- > Personally, if speed/memory > is the utmost concern, I'd drop down to C. ---------------------------------------------------- For non-UI projects I’d almost always prefer C. But for UI-projects it is arguable that the API is a bit difficult and that something like jsui would be a lot more straight-forward to program (never mind debug). Until such time as The One True Perfect Solution(TM) for an interactive UI development environment is available (for Zola that would clearly be Lua, but other people have probably got other ideals), how about this: use jsui to develop & debug, and when it’s working bite the bullet and port to C. A port could probably have been made with less energy than has been invested into this thread.-! -- Peter Castine Litter Power - Noise and More _________________http://www.bek.no/~pcastine/Litter/ iCE - Sequencing, Recording & UI ____________________________http://www.dspaudio.com/ Facebook ___http://www.facebook.com/p/Peter_Castine/562567537 From thijskoerselman at gmail.com Fri Oct 5 04:46:38 2007 From: thijskoerselman at gmail.com (Thijs Koerselman) Date: Fri Oct 5 04:46:42 2007 Subject: [javascript-dev] [bugreport] this.patcher.filepath Message-ID: <1ca2a.4706160d@www.cycling74.com> this.patcher.filepath only works in a javascript object that is located in the main patcher window. If you place the js object with the same script in a subpatcher, the attribute seems to return an empty string. I suspect this might be a known issue, but I can't find it in the archives. (Windows 4.6.3) -Thijs From looseonthestreet at gmail.com Fri Oct 5 05:21:44 2007 From: looseonthestreet at gmail.com (Zola) Date: Fri Oct 5 05:21:47 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <1ca28.470613f3@www.cycling74.com> Message-ID: <1ca2e.47061e48@www.cycling74.com> When you say 'C' -- what do you mean? I've never seen anything allowing you to write UI components for Max in C, except during the old days of MacOS9. I'd love to be able to do that. HOW!? Every UI component is built-in to Max. Do you mean writing a C extern which... sends commands to LCD? From jeremy at bootsquad.com Fri Oct 5 05:50:50 2007 From: jeremy at bootsquad.com (Jeremy Bernstein) Date: Fri Oct 5 05:50:56 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <1ca2e.47061e48@www.cycling74.com> References: <1ca2e.47061e48@www.cycling74.com> Message-ID: <1AC98D60-0161-421B-9E44-6F4DEC7AE93D@bootsquad.com> That's simply incorrect. You can write any kind of UI external object in C. That said, if you have a big UI object project in mind, and intend to upgrade to Max 5 (yes, I know you can't know this yet, since you haven't seen it, but you know what I mean here), you should wait for Max 5's release, since you'll most likely have to rewrite the object for compatibility. jb Am 05.10.2007 um 13:21 schrieb Zola: > > When you say 'C' -- what do you mean? I've never seen anything > allowing you to write UI components for Max in C, except during the > old days of MacOS9. I'd love to be able to do that. HOW!? Every UI > component is built-in to Max. Do you mean writing a C extern > which... sends commands to LCD? From mattijs at smadsteck.nl Fri Oct 5 06:50:13 2007 From: mattijs at smadsteck.nl (Mattijs Kneppers) Date: Fri Oct 5 06:50:15 2007 Subject: [javascript-dev] Re: Re: jsui was a mistake. In-Reply-To: <1c9cf.47052d30@www.cycling74.com> Message-ID: <1ca39.47063304@www.cycling74.com> Quote: Zola wrote on Thu, 04 October 2007 20:13 ---------------------------------------------------- > I am so sick of seeing you reply to every single person about disabling antialiasing for "2 to 4x" speed benefit. > It's as if it somehow allows you to slink away from the issue. > EVERY TIME. ---------------------------------------------------- What if he would have said 'You are correct, jsui is slow.' before saying 'Btw, if you disable FSAA, JSUI drawing code is 2-4x faster.'? I bet that would have made all the difference. At first I was amazed by the amount of replies by experienced users and developers that looked like slinking away. Now I realize what they really say: 1) 'you are right, this could be better' 2) 'max simply isn't there yet' 3) point out the small improvements there could be made within the current possibilities. Only step 1 and even 2 are mostly skipped. It appears that Cycling '74, unlike most other companies, is honest enough to admit things could be better and that it didn't happen yet because of a simple lack of resources (mostly: time). In fact this is assumed to be common knowledge. So don't be too hard on them if they get a little tired of repeating themselves, right? ;) Mattijs -- SmadSteck - http://www.smadsteck.nl Hard- and software for interactive audiovisual sampling From looseonthestreet at gmail.com Fri Oct 5 07:11:45 2007 From: looseonthestreet at gmail.com (Zola) Date: Fri Oct 5 07:11:57 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <239AB3B5-59F2-45A0-B1C1-2285B3B77A5E@musork.com> Message-ID: <1ca3d.4706380e@www.cycling74.com> I'd like to say sorry, if I was steaming, or flaming. Probably too much coffee. Forgiveness is requested. > > It's not an either or question. > My comments with regards to Javascript annihilation may seem fanatic. ie: "Person has grudge against language Javascript, wants to see it removed. Why would we ever do that?! ..when we can keep the javascript and just provide a better and more generic solution, allowing users to pick what is best for them? Person descends towards language X war. Person hasn't thought this through, person sees only their own selfish preference." Well, it's not that, It's something else. > > and we're looking at easier ways for anyone to > make language bindings. > Speaking in such a way as I have in this thread walks the fine line between making your point, and coming off as a crackpot. Yet such is what we must contend with in an closed-source project. On the flip-side, Max's codified codebase is what makes it really special. Puredata is a mess of different UI solutions, a UI fork, incompatible UI externs with dependencies that went into unmaintained land, and heroic-yet-unconcerted-efforts to fix the problem-- all producing splinters in your hand. There is a certain greatness about the way that Max/Msp users exchange patches here on the forums. It's a defining characteristic of this community. The unification has kept Max strong. People can help eachother, and build upon the pieces which have been contributed by those who came before them. I don't even know how many parts of my max setup have the evolutionary origin of something I saw in a bugpost. I love it. That all goes out the window when you throw us into a cold-world of 9 languages. Max's connection is warm. You must think about this. Don't go cold. I am saying, keep that same patch exchange culture alive with UI design. Keep it alive with a strong fast language. There is an element of support to all of this. Shipping something with the Max box, having a PDF that comes along, having patchers and .JS files that people can take apart. Just like how the max help-patchers rock. You can't support 9 languages, have 9 language forums, have a Tabula Rasa, have everyone become veritable multilinguists. There must be one which is fundamentally aligned with Max's IDEA, as a core piece, which has a strong identity and culture, that everybody can read and understand. And then the rest, for who needs em'. I really believe that people will not try to read Mr.T's_three_thousand_nine_hundred_lines_of_ruby_code when they've focused entirely on another lang for the rest of their work. Well, somebody will. But the gestalt of how things turn out as dependent on previous innovations or posted techniques is very important. Max has a lot of technique to it-- but Mr. T's lines of code weren't learned from lines of code which incorporated drawing techniques and some knowledge gleaned from a forum reply which was learned from lines of code posted in a tip which was taken from a useful abstraction which came from an idea that was in a help file and... And so the Mr.T's-thingy they could possibly pull apart isn't as good as it could be in the first place. Supporting language binding for those who need it, is a great thing. I'm glad you're looking into that. I couldn't possibly argue against it. In truth, of course, I never actually felt that Javascript should be removed from Max. But simply unsupported, and moved into the "pile of languages" category. But for supported? Javascript isn't good enough to deserve that spot. Javascript isn't the one that's good enough for us all to get behind. If you haven't noticed already. This whole problem is what has been keeping people from building sequencers in Max/Msp for ten years. The occurrences are few and far between, because there isn't a buildup of components. It's all about the culture. If I had my druthers, Lua would be the kick-ass UI design language of Max/Msp, Javascript and any other number of languages would be supported via extended language binding. Yours, - Invect From looseonthestreet at gmail.com Fri Oct 5 09:38:07 2007 From: looseonthestreet at gmail.com (Zola) Date: Fri Oct 5 09:38:09 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <1AC98D60-0161-421B-9E44-6F4DEC7AE93D@bootsquad.com> Message-ID: <1ca4f.47065a5f@www.cycling74.com> Quote: Jeremy Bernstein wrote on Fri, 05 October 2007 05:50 ---------------------------------------------------- > That's simply incorrect. You can write any kind of UI external object > in C. Jeremy, I checked the Max SDK, and you're right. I see it's all there. Cool. From looseonthestreet at gmail.com Fri Oct 5 10:08:16 2007 From: looseonthestreet at gmail.com (Zola) Date: Fri Oct 5 10:08:21 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <1ca4f.47065a5f@www.cycling74.com> Message-ID: <1ca55.4706616f@www.cycling74.com> Quote: Zola wrote on Fri, 05 October 2007 09:38 ---------------------------------------------------- > Quote: Jeremy Bernstein wrote on Fri, 05 October 2007 05:50 > ---------------------------------------------------- > > That's simply incorrect. You can write any kind of UI external object > > in C. > > Jeremy, I checked the Max SDK, and you're right. I see it's all there. Cool. ---------------------------------------------------- I had managed to overlook this, coz I never heard it actually mentioned. I went forum searching here for win32 and got no results, went googling for win32 site:cycling74.com and got no results. I searched for every possible variation on UI, windowing toolkit, embedding, ui extern, window handle, lcd, gl, etc. for posts about people discussing how to do UI design in Max/Msp. I think I spent a week reading some 300 forum threads after making a list of every string which might refer to this stuff, and never in one of them heard somebody really actually say anything about doing it. I even found 2 or 3 posts of people asking if you can, or how to do it, all which went unreplied-to. ..and then, seeing the widgets like jit.cellblock -- NOT being externs. (wtf???) Now that I see it's possible in the SDK, I even try searching for QTML and get nothing both here or on google searching here. It's odd. What's with that? I also don't remember any actual GUI externs which were released anytime since the turn of the century. Well, I do remember some old mac-only Elsea objects. Does anybody know of one? From jeremy at bootsquad.com Fri Oct 5 10:16:21 2007 From: jeremy at bootsquad.com (Jeremy Bernstein) Date: Fri Oct 5 10:16:25 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <1ca55.4706616f@www.cycling74.com> References: <1ca55.4706616f@www.cycling74.com> Message-ID: <2DEEA631-943C-4E68-9F23-765CD1BEE4A5@bootsquad.com> iCE has some the ambisonics package that jasch worked on has one all jitter ui objects are externals all msp ui objects are externals several max ui objects are externals UI externs are typically more work to code than non-UI externs, which is probably why they are in the minority. Nothing to get all freaked out about, though (wtf????) Chapter 11 of the Writing Externals pdf (part of the SDK) is called "Writing User Interface Objects". It's a good place to start (looks like you already found it). jb Am 05.10.2007 um 18:08 schrieb Zola: > Does anybody know of one? From leopold.frey at free.fr Fri Oct 5 12:24:19 2007 From: leopold.frey at free.fr (=?ISO-8859-15?Q?L=E9opold_Frey?=) Date: Fri Oct 5 12:24:22 2007 Subject: [javascript-dev] Re: Re: Re: jsui was a mistake. In-Reply-To: <1ca55.4706616f@www.cycling74.com> References: <1ca55.4706616f@www.cycling74.com> Message-ID: <47068153.4050206@free.fr> Zola a ?crit : > I also don't remember any actual GUI externs which were released anytime since the turn of the century. > Well, I do remember some old mac-only Elsea objects. > Does anybody know of one ? Have a look at gmem externals (bargraf~ and panpot). http://gmem.free.fr/recherche/Max-externals.html But porting them to windows was really hard (there are even still bugs on windows) My advice would be to follow Jeremy's advice : wait for Max 5. Or use java/mxj in conjunction with JOGL, GEM, or LCD. (have a look at topher lafata's excellent file browser in the share folder of c74 website). my 2 cents leo -- *L?opold Frey* 77, rue de Berni?res 14000 Caen 02.31.86.40.80 06.84.39.91.46 leopold.frey@free.fr From looseonthestreet at gmail.com Fri Oct 5 14:26:51 2007 From: looseonthestreet at gmail.com (Zola) Date: Fri Oct 5 14:26:52 2007 Subject: [javascript-dev] Re: Re: Re: Re: jsui was a mistake. In-Reply-To: <47068153.4050206@free.fr> Message-ID: <1ca7c.47069e0b@www.cycling74.com> Quote: L?opold Frey wrote on Fri, 05 October 2007 12:24 ---------------------------------------------------- Thanks Leo! Keep em' comin. But what about source code? People's C max widgets, with source, all documented, all nice, with self documenting code, huh? From mzed at cnmat.berkeley.edu Fri Oct 5 15:23:47 2007 From: mzed at cnmat.berkeley.edu (mzed) Date: Fri Oct 5 15:23:48 2007 Subject: [javascript-dev] Re: Re: Re: Re: jsui was a mistake. In-Reply-To: <1ca7c.47069e0b@www.cycling74.com> Message-ID: <1ca84.4706ab62@www.cycling74.com> Another way to reduce jsui's overhead is to have it draw less often. This code is excerpted from CNMAT's resonance-display.js: function ndraw() { if (needtodraw==1) { draw(); needtodraw = 0 } } var tsk = new Task(ndraw); tsk.interval=100; tsk.repeat(); and there's a "needtodraw = 1" statement in the bang method. Look at the whole js for context. There's no point in drawing faster that the screen refresh rate, no matter how much data is coming in. Our function sets the rate at 10 fps, which is totally fine. mz PS Still in favor of a lui *in addition to* jsui. The more the merrier, sez I. -- || michael f. zbyszynski -- molecular gastronimist || http://www.cnmat.berkeley.edu/ || http://www.mikezed.com/ From looseonthestreet at gmail.com Fri Oct 5 15:36:34 2007 From: looseonthestreet at gmail.com (Zola) Date: Fri Oct 5 15:36:40 2007 Subject: [javascript-dev] Re: Re: Re: Re: jsui was a mistake. In-Reply-To: <1ca84.4706ab62@www.cycling74.com> Message-ID: <1ca86.4706ae61@www.cycling74.com> > PS Still in favor of a lui *in addition to* jsui. The more the merrier, sez I. > Ha! LUI and JSUI, A two-headed brother. From j at jasch.ch Sat Oct 6 00:00:55 2007 From: j at jasch.ch (=?ISO-8859-1?Q?jasch_=A0?=) Date: Sat Oct 6 00:00:58 2007 Subject: [javascript-dev] Re: Re: Re: Re: jsui was a mistake. In-Reply-To: <1ca7c.47069e0b@www.cycling74.com> References: <1ca7c.47069e0b@www.cycling74.com> Message-ID: www.icst.net/downloads you'll find the ambimonitor's source in the Ambisonics Tools for MaxMSP package. /*j From lists at lowfrequency.org Sun Oct 7 06:07:50 2007 From: lists at lowfrequency.org (evan.raskob [lists]) Date: Sun Oct 7 06:00:46 2007 Subject: [javascript-dev] [bugreport] this.patcher.filepath In-Reply-To: <1ca2a.4706160d@www.cycling74.com> References: <1ca2a.4706160d@www.cycling74.com> Message-ID: <371B9E98-39CE-4012-B939-8E1BDE9E21FA@lowfrequency.org> this is the same for the thispatcher object itself. it doesn't report a filepath from a subpatch. i think this is expected behavior? frankly, i've never liked it, because it means i can't hide the thispatcher object in a subpatch. cheers evan On Oct 5, 2007, at 11:46 AM, Thijs Koerselman wrote: > > this.patcher.filepath only works in a javascript object that is > located in the main patcher window. If you place the js object with > the same script in a subpatcher, the attribute seems to return an > empty string. > > I suspect this might be a known issue, but I can't find it in the > archives. > > (Windows 4.6.3) > > -Thijs > > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev From mattijs at smadsteck.nl Sun Oct 7 08:51:52 2007 From: mattijs at smadsteck.nl (Mattijs Kneppers) Date: Sun Oct 7 08:51:53 2007 Subject: [javascript-dev] Re: [bugreport] this.patcher.filepath In-Reply-To: <1ca2a.4706160d@www.cycling74.com> Message-ID: <1cb30.4708f287@www.cycling74.com> Quote: thijs.koerselman wrote on Fri, 05 October 2007 12:46 ---------------------------------------------------- > this.patcher.filepath only works in a javascript object that is located in the main patcher window. If you place the js object with the same script in a subpatcher, the attribute seems to return an empty string. > > I suspect this might be a known issue, but I can't find it in the archives. > > (Windows 4.6.3) > > -Thijs > ---------------------------------------------------- I assume filepath is only available for patchers that are actually saved to disk, i.e. abstractions and top patchers. To get the file path of the top patcher from inside a subpatcher you need to traverse up until you reach the top patcher and take the filepath property of that one.. Mattijs -- SmadSteck - http://www.smadsteck.nl Hard- and software for interactive audiovisual sampling From thijskoerselman at gmail.com Sun Oct 7 10:38:15 2007 From: thijskoerselman at gmail.com (Thijs Koerselman) Date: Sun Oct 7 10:38:16 2007 Subject: [javascript-dev] Re: [bugreport] this.patcher.filepath In-Reply-To: <1cb30.4708f287@www.cycling74.com> Message-ID: <1cb3a.47090b77@www.cycling74.com> > To get the file path of the top patcher from inside > a subpatcher you need to traverse up until you reach > the top patcher and take the filepath property of that one.. Ah of course. I guess this.patcher.parentpatcher.filepath will work then. I'll give it a try. Cheers, -Thijs From pnyboer at slambassador.com Tue Oct 9 15:06:40 2007 From: pnyboer at slambassador.com (pnyboer) Date: Tue Oct 9 15:06:41 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: <1c988.4704b351@www.cycling74.com> Message-ID: <1cc38.470bed5f@www.cycling74.com> my 2c....jsui is seductive becuase it offers a nice neat package for UI stuff... but it is too slow with the software rendering, even with fsaa off. Fortunately, I haven't spend too much time finding this out-it was an early lesson. I keep hoping that there will be a hardware-accellerated version of JSUI. Certainly jitter is one possiblility, but it's not quite as tidy as the JSUI. I'm reluctant to keep doing things in LCD, as it will probably never be hardware accellerated & antialiased, and I need to get in the OpenGL habits... -- * * * * The Altamont 2 oz light rum 3/4 oz lime juice 1/2 oz orange cura?ao 1/4 oz orgeat splash of pernod handful of fresh mint leaves shake contents vigorously with ice. Strain well into a chilled cocktail glass. * * * * From dlehrich at gmail.com Wed Oct 10 00:29:39 2007 From: dlehrich at gmail.com (Dan) Date: Wed Oct 10 00:29:44 2007 Subject: [javascript-dev] [Crash] deleting bpatchers through javascript - log attached Message-ID: <1cc56.470c7150@www.cycling74.com> Hello, I am getting a crash when trying to delete 1 or more bpatchers that I have dynamically created through Javascript. MacBookPro, 2.4 GHz Core 2 Duo, OS 10.4.10, Max 4.6.3 The code is too convoluted to post, but basically I'm assigning the bpatcher's object name to an index of an array when it is created. To delete all, I am trying to iterate through the Array. The delete function looks like this: function DeleteAll() { var i; ///"Obj_MaxName" is the name of my array for(i = 0; i < Obj_MaxName.length; i++){ this.patcher.remove(Obj_MaxName[i]); } } For some reason this function crashes every time. Admittedly, the bpatchers are pretty hefty DSP patches themselves, but this is happening even with DSP turned off. Any help would be greatly appreciated. I have attached the log from the crashed thread below. Thanks Dan Date/Time: 2007-10-09 23:19:55.586 -0700 OS Version: 10.4.10 (Build 8R2232) Report Version: 4 Command: MaxMSP Path: /Applications/MaxMSP 4.6/MaxMSP.app/Contents/MacOS/MaxMSP Parent: WindowServer [70] Version: ??? (4.6.3) PID: 516 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000 Thread 0 Crashed: 0 com.cycling74.MaxJSRef 0x31744a89 JS_GetClass + 17 1 com.cycling74.jsui 0x314d38e1 js_valtoobj + 51 2 com.cycling74.jsui 0x314d3a29 jspatcher_remove + 71 3 com.cycling74.MaxJSRef 0x31773326 js_Invoke + 1744 4 com.cycling74.MaxJSRef 0x3176ff3f js_Interpret + 28723 5 com.cycling74.MaxJSRef 0x3177337f js_Invoke + 1833 6 com.cycling74.MaxJSRef 0x3177358b js_InternalInvoke + 178 7 com.cycling74.MaxJSRef 0x31746989 JS_CallFunctionName + 92 8 com.cycling74.js 0x302eff0c js_calljsfun + 1440 9 com.cycling74.js 0x302f0017 js_doanything + 67 10 com.cycling74.MaxMSP46 0x00077495 defer + 111 (defer.c:84) 11 com.cycling74.MaxMSP46 0x00077725 defer_medium + 77 (defer.c:141) 12 com.cycling74.MaxAPI 0x0180b38b defer_medium + 66 13 com.cycling74.js 0x302f03d9 js_messagehandler + 568 14 com.cycling74.js 0x302f0559 js_anything + 47 15 com.cycling74.MaxMSP46 0x00030755 typedmess_fun + 1487 (message.c:631) 16 com.cycling74.MaxMSP46 0x000e8585 outlet_anything + 355 (inletoutlet.c:967) 17 com.cycling74.MaxMSP46 0x00030755 typedmess_fun + 1487 (message.c:631) 18 com.cycling74.MaxMSP46 0x00030c96 typedmess + 80 (message.c:399) 19 com.cycling74.MaxMSP46 0x000316f4 aeval + 1242 (message.c:1061) 20 com.cycling74.MaxMSP46 0x00009750 atombuf_eval + 204 (atombuf.c:234) 21 com.cycling74.MaxMSP46 0x000b6b0d vmessage_bang(_vmessage*) + 57 (vmessage.c:58) 22 com.cycling74.MaxMSP46 0x000b83a7 vmessage_click(_vmessage*) + 439 (vmessage.c:238) 23 com.cycling74.MaxMSP46 0x0000fbe8 box_click + 148 (box.c:123) 24 com.cycling74.MaxMSP46 0x000363b4 patcher_boxclick + 436 (patcher.c:2175) 25 com.cycling74.MaxMSP46 0x000382a1 patcher_click + 1195 (patcher.c:2424) 26 com.cycling74.MaxMSP46 0x0006a7c5 wind_click + 143 (window.c:1118) 27 com.cycling74.MaxMSP46 0x0006f880 wind_event + 394 (window.c:818) 28 com.cycling74.MaxMSP46 0x0002807d app_eventhandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 1273 (main.c:1658) 29 com.apple.HIToolbox 0x92df1617 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1093 30 com.apple.HIToolbox 0x92df0cbc SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 304 31 com.apple.HIToolbox 0x92df809c SendEventToEventTarget + 56 32 com.apple.HIToolbox 0x92df852f ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 1169 33 com.apple.HIToolbox 0x92df19ce DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2044 34 com.apple.HIToolbox 0x92df0cbc SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 304 35 com.apple.HIToolbox 0x92df809c SendEventToEventTarget + 56 36 com.apple.HIToolbox 0x92e3c013 ToolboxEventDispatcher + 81 37 com.apple.HIToolbox 0x92e3a9eb RunApplicationEventLoop + 165 38 com.cycling74.MaxMSP46 0x00027854 app_run + 52 (main.c:1519) 39 com.cycling74.MaxMSP46 0x00027afe main + 680 (main.c:416) 40 com.cycling74.MaxMSP46 0x00002ba2 _start + 216 41 com.cycling74.MaxMSP46 0x00002ac9 start + 41 From dlehrich at gmail.com Wed Oct 10 12:25:56 2007 From: dlehrich at gmail.com (Dan) Date: Wed Oct 10 12:25:57 2007 Subject: [javascript-dev] Re: [Crash] deleting bpatchers through javascript - log attached In-Reply-To: <1cc56.470c7150@www.cycling74.com> Message-ID: <1cc96.470d1933@www.cycling74.com> Just an update... I was able to use this same algorithm to successfully create and delete a bunch of buttons, so I know that it *should* work in theory. Is the problem related specifically to deleting patchers? Or is it just trying to do too much too quickly? Any ideas? Thanks again, Dan Quote: doctor op wrote on Wed, 10 October 2007 00:29 ---------------------------------------------------- > Hello, > > I am getting a crash when trying to delete 1 or more bpatchers that I have dynamically created through Javascript. > > MacBookPro, 2.4 GHz Core 2 Duo, OS 10.4.10, Max 4.6.3 > > The code is too convoluted to post, but basically I'm assigning the bpatcher's object name to an index of an array when it is created. To delete all, I am trying to iterate through the Array. > ---------------------------------------------------- From mattijs at smadsteck.nl Wed Oct 10 14:11:39 2007 From: mattijs at smadsteck.nl (Mattijs Kneppers) Date: Wed Oct 10 14:11:41 2007 Subject: [javascript-dev] Re: [Crash] deleting bpatchers through javascript - log attached In-Reply-To: <1cc96.470d1933@www.cycling74.com> Message-ID: <1cca3.470d31f9@www.cycling74.com> Hi Dan, mostly it is hard for people to get involved when there is no patch to save, open and press a button on to reproduce your problem. It could take quite some time to create the patch that is needed to confirm your problem, let alone say something useful about it. That is mostly a reason for people not to reply. Posting a small patch that clearly demonstrates the problem will dramatically increase the chance for a useful answer. Mattijs -- SmadSteck - http://www.smadsteck.nl Hard- and software for interactive audiovisual sampling From dlehrich at gmail.com Wed Oct 10 14:50:54 2007 From: dlehrich at gmail.com (Dan) Date: Wed Oct 10 14:50:56 2007 Subject: [javascript-dev] Re: [Crash] deleting bpatchers through javascript - log attached In-Reply-To: <1cca3.470d31f9@www.cycling74.com> Message-ID: <1cca5.470d3b2d@www.cycling74.com> Yes, I'm well aware that a thorough example patch is helpful, but I was hoping to avoid it because the patch I'm working in is pretty complicated and I wasn't able to repro the result in a more controlled patch. I was kind of hoping that with my basic description and crash log someone might have some insight. Ah well, pipe dream I suppose... I'm not at my personal computer right now, but I'll do some more investigating tonight and see if I can narrow it down and post a complete example patch. Thanks Dan Quote: Mattijs wrote on Wed, 10 October 2007 14:11 ---------------------------------------------------- > Hi Dan, mostly it is hard for people to get involved when there is no patch to save, open and press a button on to reproduce your problem. > > It could take quite some time to create the patch that is needed to confirm your problem, let alone say something useful about it. That is mostly a reason for people not to reply. > > Posting a small patch that clearly demonstrates the problem will dramatically increase the chance for a useful answer. > > Mattijs ---------------------------------------------------- From dlehrich at gmail.com Wed Oct 10 20:56:20 2007 From: dlehrich at gmail.com (Dan) Date: Wed Oct 10 20:56:22 2007 Subject: [javascript-dev] Re: [Crash] deleting bpatchers through javascript - log attached In-Reply-To: <1cc56.470c7150@www.cycling74.com> Message-ID: <1ccd1.470d90d3@www.cycling74.com> OK... after some snooping on my own I think I've found a fix/workaround for my problem. For what it's worth, I believe that at least part of my problem was not recognizing the difference between the scripted name of an object (i.e. what you see when you right-click and select "Name...") and the js reference name of an object (which I believe, after some well-placed post() messages, is something like "js 120983"). Is it possible that using this.patcher.remove() and passing the scripted name as an argument would cause a crash? In any event... problem solved. I'm a relative newbie with js but getting better all the time. Next time I post with a problem I'll be sure to include a concise example. Thanks dan From lists at lowfrequency.org Thu Oct 11 08:43:34 2007 From: lists at lowfrequency.org (evan.raskob [lists]) Date: Thu Oct 11 08:34:58 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: <1cc38.470bed5f@www.cycling74.com> References: <1cc38.470bed5f@www.cycling74.com> Message-ID: <5501F927-6B70-4585-9F5F-B4815FACE9F1@lowfrequency.org> Pd has a lua object... http://www.blurty.com/users/claudiusmaximus/day/2007/09/25#418 Maybe someone should port it to max. On Oct 9, 2007, at 10:06 PM, pnyboer wrote: > > my 2c....jsui is seductive becuase it offers a nice neat package > for UI stuff... > but it is too slow with the software rendering, even with fsaa off. > Fortunately, I haven't spend too much time finding this out-it was > an early lesson. > I keep hoping that there will be a hardware-accellerated version of > JSUI. Certainly jitter is one possiblility, but it's not quite as > tidy as the JSUI. I'm reluctant to keep doing things in LCD, as it > will probably never be hardware accellerated & antialiased, and I > need to get in the OpenGL habits... > > -- > * * * * > The Altamont > 2 oz light rum > 3/4 oz lime juice > 1/2 oz orange cura?ao > 1/4 oz orgeat > splash of pernod > handful of fresh mint leaves > shake contents vigorously with ice. > Strain well into a chilled cocktail glass. > * * * * > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev From julien.rabin at gmail.com Thu Oct 11 09:42:32 2007 From: julien.rabin at gmail.com (jln) Date: Thu Oct 11 09:42:41 2007 Subject: [javascript-dev] Re: jsui was a mistake. In-Reply-To: <5501F927-6B70-4585-9F5F-B4815FACE9F1@lowfrequency.org> References: <1cc38.470bed5f@www.cycling74.com> <5501F927-6B70-4585-9F5F-B4815FACE9F1@lowfrequency.org> Message-ID: Le 11 oct. 07 ? 16:43, evan.raskob [lists] a ?crit : > Pd has a lua object... > http://www.blurty.com/users/claudiusmaximus/day/2007/09/25#418 > > Maybe someone should port it to max. Is there a need to port it ? What does it have that these ones don't ? http://www.cycling74.com/twiki/bin/view/Share/WesleySmith http://www.mat.ucsb.edu/%7Ewakefield/lua%7E/lua%7E.htm Sorry if I miss something, I didn't have the time to get into them, yet. Best, Julien. From doktorp at mac.com Thu Oct 11 23:46:22 2007 From: doktorp at mac.com (vade) Date: Thu Oct 11 23:46:23 2007 Subject: [javascript-dev] procedurally counting named objects inlets and outlets Message-ID: <1cd5f.470f0a2c@www.cycling74.com> Hello say I have an object in a patcher name "thing". I do know necessarily know how many inlets and outlets "thing" has because "thing" is a patcher module loaded off of disk and could be CRAZY and have like, lots and lots of inlets and outlets. I would like to query "thing" to know how many inlets and outlets "thing" has. How does one do that? var thing=this.patcher.getnamed("thing"); what method to thing can I now call to return the number of inlets and outlets? I checked the docs, so forgive me if ive missed this one. From jeremy at bootsquad.com Fri Oct 12 02:04:50 2007 From: jeremy at bootsquad.com (Jeremy Bernstein) Date: Fri Oct 12 02:04:57 2007 Subject: [javascript-dev] procedurally counting named objects inlets and outlets In-Reply-To: <1cd5f.470f0a2c@www.cycling74.com> References: <1cd5f.470f0a2c@www.cycling74.com> Message-ID: <14225264-5A10-4818-8818-81E7B085DC2B@bootsquad.com> You can't do this in Max 4. jb Am 12.10.2007 um 07:46 schrieb vade: > > Hello > > say I have an object in a patcher name "thing". I do know > necessarily know how many inlets and outlets "thing" has because > "thing" is a patcher module loaded off of disk and could be CRAZY > and have like, lots and lots of inlets and outlets. > > I would like to query "thing" to know how many inlets and outlets > "thing" has. > > How does one do that? > > var thing=this.patcher.getnamed("thing"); > > what method to thing can I now call to return the number of inlets > and outlets? > > I checked the docs, so forgive me if ive missed this one. From doktorp at mac.com Fri Oct 12 08:32:58 2007 From: doktorp at mac.com (vade) Date: Fri Oct 12 08:32:59 2007 Subject: [javascript-dev] Re: procedurally counting named objects inlets and outlets In-Reply-To: <1cd5f.470f0a2c@www.cycling74.com> Message-ID: <1cd82.470f8599@www.cycling74.com> What!?!?! Seriously !?!?! Inlets and Outlets make max go! How can javascript not know about them! Does javascript in Max 5 know about them? if not, PLEASE ! Oh man, really? Id never in a thousand years think that would be the case. From jeremy at bootsquad.com Fri Oct 12 08:35:42 2007 From: jeremy at bootsquad.com (Jeremy Bernstein) Date: Fri Oct 12 08:35:48 2007 Subject: [javascript-dev] Re: procedurally counting named objects inlets and outlets In-Reply-To: <1cd82.470f8599@www.cycling74.com> References: <1cd82.470f8599@www.cycling74.com> Message-ID: Seriously. Sorry. jb Am 12.10.2007 um 16:32 schrieb vade: > Seriously !?!?! From c74-mailinglists at e--j.com Fri Oct 12 09:30:36 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Fri Oct 12 09:30:52 2007 Subject: [javascript-dev] Re: procedurally counting named objects inlets and outlets In-Reply-To: <1cd82.470f8599@www.cycling74.com> References: <1cd82.470f8599@www.cycling74.com> Message-ID: On 12 oct. 07, at 23:32, vade wrote: > Inlets and Outlets make max go! How can javascript not know about > them! It's not a that simple problem. For some object, that's *easy* because it doesn't change but for some objects it changes on instantiation. The worst example is JS, because you have to execute the global code of the javascript file before you can know what's the number of inlet/outlet. ej From doktorp at mac.com Fri Oct 12 10:08:26 2007 From: doktorp at mac.com (vade) Date: Fri Oct 12 10:08:28 2007 Subject: [javascript-dev] Re: procedurally counting named objects inlets and outlets In-Reply-To: <1cd5f.470f0a2c@www.cycling74.com> Message-ID: <1cd8c.470f9bfa@www.cycling74.com> But the js can query itself with the jsthis object and return the number of inlets/outlets. I only need to poll objects. Jeremy gave me a possible workaround over IM, which I will try to get working and post. Thanks, From pnyboer at slambassador.com Fri Oct 12 17:00:26 2007 From: pnyboer at slambassador.com (pnyboer) Date: Fri Oct 12 17:00:28 2007 Subject: [javascript-dev] Re: procedurally counting named objects inlets and outlets In-Reply-To: <1cd5f.470f0a2c@www.cycling74.com> Message-ID: <1cdaf.470ffc89@www.cycling74.com> not really a workaround, but a design consideration, which may or may not be useful...instead of lots of inlets/outlets in abstractions/patcher, can you rely on route and label (an Lobject from peter elsea)? #P window setfont "Sans Serif" 9.; #P number 272 41 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 234 44 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 197 47 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 158 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 119 57 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 80 62 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 41 67 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 43 93 183 196617 label all your inlets are belong to them; #N vpatcher 20 74 620 474; #P inlet 71 48 15 0; #P window setfont "Sans Serif" 9.; #P number 311 119 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 272 119 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 234 119 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 192 120 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 150 121 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 108 122 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 66 123 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 69 71 186 196617 route all your inlets are belong to them; #P connect 0 0 1 0; #P connect 8 0 0 0; #P connect 0 1 2 0; #P connect 0 2 3 0; #P connect 0 3 4 0; #P connect 0 4 5 0; #P connect 0 5 6 0; #P connect 0 6 7 0; #P pop; #P newobj 43 129 33 196617 p sub; #P connect 1 0 0 0; #P connect 8 0 1 6; #P connect 7 0 1 5; #P connect 6 0 1 4; #P connect 5 0 1 3; #P connect 4 0 1 2; #P connect 3 0 1 1; #P connect 2 0 1 0; #P window clipboard copycount 9; -- * * * * The Altamont 2 oz light rum 3/4 oz lime juice 1/2 oz orange cura?ao 1/4 oz orgeat splash of pernod handful of fresh mint leaves shake contents vigorously with ice. Strain well into a chilled cocktail glass. * * * * From keithmanlove at gmail.com Wed Oct 17 19:53:39 2007 From: keithmanlove at gmail.com (keith manlove) Date: Wed Oct 17 19:53:42 2007 Subject: [javascript-dev] JS String to Max Message Message-ID: <64ab801a0710171853t580a317u8c6f4f8c520c4aa8@mail.gmail.com> Is the attached stuff really the best way to do this? I tried sending out max messages to an automatic 0 videoplane from js but max obviously wasn't having it. However, I was also surprised to find that inserting a fromsymbol didn't solve it. I had to rig it up this way. Help is greatly appreciated. If this is the best way, just let me know. Thanks, Keith #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 128 34 48 196617 loadbang; #P newex 128 56 40 196617 uzi 5; #P newex 125 102 59 196617 prepend vp; #N coll vp_info 1; #T flags 1 0; #T 1 1 0.6 0.07 0.6 -0.3 0 -0.32 1 4.67 0.4 tex2; #T 2 2 0.6 0.07 0.6 -0.3 0 -0.32 1 4.67 0.5 tex3; #T 3 3 0.6 0.04 1.2 0.6 0 -0.55 1 5.4 0.9 tex2; #T 4 4 0.6 0.04 1.2 0.6 0 -0.55 1 5.4 0.5 tex3; #T 5 5 1.8 0.03 1.7 0.3 0 -0.55 1 5.4 0.5 tex3; #P newobj 125 80 72 196617 coll vp_info 1; #P toggle 23 83 15 0; #P newex 23 104 90 196617 qmetro 33.333328; #N vpatcher 974 471 1355 765; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 242 126 20 196617 t b; #P newex 218 107 82 196617 prepend texture; #P message 194 168 84 196617 color 1. 1. 1. \$1; #P message 170 149 81 196617 tex_scale_y \$1; #P message 146 128 81 196617 tex_scale_x \$1; #P message 124 108 85 196617 tex_offset_y \$1; #P message 96 168 85 196617 tex_offset_x \$1; #P message 73 149 84 196617 position \$1 \$2 0; #P message 50 109 72 196617 scale \$1 \$2 1; #P newex 50 50 64 196617 fromsymbol; #P window linecount 2; #P newex 50 75 224 196617 route scale position tex_offset_x tex_offset_y tex_scale_x tex_scale_y color texture bang; #P inlet 50 30 15 0; #P outlet 50 238 15 0; #P connect 1 0 3 0; #P connect 3 0 2 0; #P connect 2 0 4 0; #P connect 4 0 0 0; #P connect 5 0 0 0; #P connect 9 0 0 0; #P connect 10 0 0 0; #P connect 11 0 0 0; #P connect 12 0 0 0; #P connect 6 0 0 0; #P connect 7 0 0 0; #P connect 8 0 0 0; #P connect 2 1 5 0; #P connect 2 2 6 0; #P connect 2 3 7 0; #P connect 2 4 8 0; #P connect 2 5 9 0; #P connect 2 6 10 0; #P connect 2 7 11 0; #P connect 2 8 12 0; #P pop; #P newobj 23 149 84 196617 p sort_and_bang; #P newex 23 127 150 196617 js kvm.videoplane_control.js 5; #P window linecount 2; #P newex 23 173 378 196617 jit.gl.videoplane wonk @blend_enable 1 @scale 1.333 1. 0. @depth_enable 0 @lighting_enable 1 @color 1 1 1 1 @automatic 0 @texture tex2 @blend_mode 6 1; #P connect 4 0 3 0; #P fasten 6 0 1 0 130 123 28 123; #P connect 3 0 1 0; #P connect 1 0 2 0; #P connect 2 0 0 0; #P connect 7 2 5 0; #P connect 5 0 6 0; #P connect 8 0 7 0; ---------save as kvm.videoplane_control.js inlets = 1; outlets = 1; var videoplane = new Array(jsarguments[1]); for (i=0;i<=jsarguments[1];i++) { videoplane[i] = new Array(7); } function bang( ){ for (i = 1; i <= jsarguments[1]; i++){ outlet(0, "scale " + videoplane[i][0] + " " + videoplane[i][1]); outlet(0, "position " + videoplane[i][2] + " " + videoplane[i][3]); outlet(0, "tex_offset_x " + videoplane[i][4]); outlet(0, "tex_offset_y " + videoplane[i][5]); outlet(0, "tex_scale_x " + videoplane[i][6]); outlet(0, "tex_scale_y " + videoplane[i][7]); outlet(0, "color" + " " + videoplane[i][8]); outlet(0, "texture " + videoplane[i][9]); outlet(0, "bang"); } } function vp(number, scale_x, scale_y, loc_x, loc_y, tex_offset_x, tex_offset_y, tex_scale_x, tex_scale_y, alpha, texture){ videoplane[number][0] = scale_x; videoplane[number][1] = scale_y; videoplane[number][2] = loc_x; videoplane[number][3] = loc_y; videoplane[number][4] = tex_offset_x; videoplane[number][5] = tex_offset_y; videoplane[number][6] = tex_scale_x; videoplane[number][7] = tex_scale_y; videoplane[number][8] = alpha; videoplane[number][9] = texture; } From c74-mailinglists at e--j.com Wed Oct 17 20:42:57 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Wed Oct 17 20:43:16 2007 Subject: [javascript-dev] JS String to Max Message In-Reply-To: <64ab801a0710171853t580a317u8c6f4f8c520c4aa8@mail.gmail.com> References: <64ab801a0710171853t580a317u8c6f4f8c520c4aa8@mail.gmail.com> Message-ID: <0C94F7CA-A1D3-4F33-8D3E-51808CD8A035@e--j.com> On 18 oct. 07, at 10:53, keith manlove wrote: > outlet(0, "scale " + videoplane[i][0] + " " + videoplane[i][1]); You need to send an array or separate the elements with a coma because outlet() can do that: outlet(0, "scale", videoplane[i][0], videoplane[i][1]); When you use "+" with string in JavaScript it just concatenate the strings to make an unique one. HTH, ej From keithmanlove at gmail.com Wed Oct 17 21:04:48 2007 From: keithmanlove at gmail.com (keith manlove) Date: Wed Oct 17 21:04:51 2007 Subject: [javascript-dev] JS String to Max Message In-Reply-To: <0C94F7CA-A1D3-4F33-8D3E-51808CD8A035@e--j.com> References: <64ab801a0710171853t580a317u8c6f4f8c520c4aa8@mail.gmail.com> <0C94F7CA-A1D3-4F33-8D3E-51808CD8A035@e--j.com> Message-ID: <64ab801a0710172004w43ccba41wa6fb9f3528de308b@mail.gmail.com> Thanks EJ; that does help; I'm not getting error messages anymore, but the videoplane still isn't responding. I really feel like I'm missing something obvious. Keith On 10/17/07, Emmanuel Jourdan wrote: > On 18 oct. 07, at 10:53, keith manlove wrote: > > > outlet(0, "scale " + videoplane[i][0] + " " + videoplane[i][1]); > > You need to send an array or separate the elements with a coma > because outlet() can do that: > > outlet(0, "scale", videoplane[i][0], videoplane[i][1]); > > When you use "+" with string in JavaScript it just concatenate the > strings to make an unique one. > > HTH, > ej > > > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev > From c74-mailinglists at e--j.com Wed Oct 17 21:12:45 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Wed Oct 17 21:13:07 2007 Subject: [javascript-dev] JS String to Max Message In-Reply-To: <64ab801a0710172004w43ccba41wa6fb9f3528de308b@mail.gmail.com> References: <64ab801a0710171853t580a317u8c6f4f8c520c4aa8@mail.gmail.com> <0C94F7CA-A1D3-4F33-8D3E-51808CD8A035@e--j.com> <64ab801a0710172004w43ccba41wa6fb9f3528de308b@mail.gmail.com> Message-ID: <90C310D7-04F4-4E85-9DAC-025C58B6937D@e--j.com> On 18 oct. 07, at 12:04, keith manlove wrote: > Thanks EJ; that does help; I'm not getting error messages anymore, but > the videoplane still isn't responding. I really feel like I'm missing > something obvious Could you post a little bit more of the patch because actually it's missing the textures, the render, etc. ej From keithmanlove at gmail.com Wed Oct 17 21:21:23 2007 From: keithmanlove at gmail.com (keith manlove) Date: Wed Oct 17 21:21:30 2007 Subject: [javascript-dev] JS String to Max Message In-Reply-To: <90C310D7-04F4-4E85-9DAC-025C58B6937D@e--j.com> References: <64ab801a0710171853t580a317u8c6f4f8c520c4aa8@mail.gmail.com> <0C94F7CA-A1D3-4F33-8D3E-51808CD8A035@e--j.com> <64ab801a0710172004w43ccba41wa6fb9f3528de308b@mail.gmail.com> <90C310D7-04F4-4E85-9DAC-025C58B6937D@e--j.com> Message-ID: <64ab801a0710172021k7c624cd7p9cd10dfdeffc09b1@mail.gmail.com> Nevermind. I was doing some dumb stuff with the positioning. Thanks again for your help. Keith On 10/17/07, Emmanuel Jourdan wrote: > On 18 oct. 07, at 12:04, keith manlove wrote: > > > Thanks EJ; that does help; I'm not getting error messages anymore, but > > the videoplane still isn't responding. I really feel like I'm missing > > something obvious > > Could you post a little bit more of the patch because actually it's > missing the textures, the render, etc. > > ej > > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev > From pnyboer at slambassador.com Mon Oct 22 16:01:44 2007 From: pnyboer at slambassador.com (pnyboer) Date: Mon Oct 22 16:02:25 2007 Subject: [javascript-dev] Re: recompiling with JitterListener leads to crash In-Reply-To: <8B605B42-5167-4FDA-BDA6-17642C7C91F2@xs4all.nl> Message-ID: <1d098.471d1dc7@www.cycling74.com> This is a tangent, but appropriate for this thread, for the sake of the archive. I've had to do this: listener.subjectname = ""; listener = new JitterListener(movarray[currentindex].getregisteredname(), thecallback); when using a single listener (i.e., I've only declared "var listener;" at the head of my js) for an array of movies that I'm stepping thru. I don't want to get into details, but it seems that in sequencing an array of movies, and I didn't set the subject name to null, then the JitterListener didn't seem to go away, and as I cycled thru the array of movies, there would be double reportage of loops. I'd love to provide an example, but it is too tiresome to do. So if you are using what seems like a single JitterListener, but you are getting multiple loopreports, you may want to try the above. -- * * * * The Altamont 2 oz light rum 3/4 oz lime juice 1/2 oz orange cura?ao 1/4 oz orgeat splash of pernod handful of fresh mint leaves shake contents vigorously with ice. Strain well into a chilled cocktail glass. * * * * From dlehrich at gmail.com Mon Oct 22 21:45:14 2007 From: dlehrich at gmail.com (Dan) Date: Mon Oct 22 21:45:15 2007 Subject: [javascript-dev] can't move fpic with Maxobj.rect, is there another way? Message-ID: <1d0a9.471d6e49@www.cycling74.com> I've been using Javascript to move objects successfully, but it doesn't seem to work on the fpic object. See sample code below for an example of my problem. Is there another way to move fpic objects through javascript? Thanks Dan Save this as "fpic_move_test.js": inlets = 1; outlets = 1; //// these functions look the same to me, but moving the fpic doesn't work. //// //// is there a way to move an fpic object in javascript? function move_myPanel(X, Y) { /// get my panel object var myPanel = this.patcher.getnamed("myPanel"); /// move the 100x100 Panel myPanel.rect = [X, Y, X+100, Y+100]; } function move_myFpic(X, Y) { /// get my fpic object var myFpic = this.patcher.getnamed("myFpic"); /// move my Fpic myFpic.rect = [X, Y, X+100, Y+100]; } And then run this Max patch: max v2; #N vpatcher 178 288 821 782; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P comment 92 178 100 196617 This doesn't:; #P message 92 196 114 196617 move_myFpic 300 300; #P message 43 128 120 196617 move_myPanel 285 200; #P comment 433 132 117 196617 This is named "myFpic"; #P user fpic 439 172 102 52 DL_Player_Replace_Button_2.jpg 0 0 0 0. 0 0 0; #P objectname myFpic; #P newex 43 275 105 196617 js fpic_move_test.js; #P user panel 290 163 100 100; #X brgb 191 191 191; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P objectname myPanel; #P comment 279 136 117 196617 This is named "myPanel"; #P comment 453 148 100 196617 (load any pic); #P comment 42 109 100 196617 This works:; #P connect 7 0 4 0; #P connect 8 0 4 0; #P pop; From dlehrich at gmail.com Tue Oct 23 20:18:34 2007 From: dlehrich at gmail.com (Dan) Date: Tue Oct 23 20:18:36 2007 Subject: [javascript-dev] Re: can't move fpic with Maxobj.rect, is there another way? In-Reply-To: <1d0a9.471d6e49@www.cycling74.com> Message-ID: <1d103.471eab79@www.cycling74.com> Any takers on this? I've got a workaround where I send information out one of my js object's outlets and use "script move" messages to [thispatcher], but it seems so much less elegant since I'm doing everything else in Javascript. Am I missing something obvious? thanks /dan Quote: doctor op wrote on Mon, 22 October 2007 21:45 ---------------------------------------------------- > I've been using Javascript to move objects successfully, but it doesn't seem to work on the fpic object. See sample code below for an example of my problem. > > Is there another way to move fpic objects through javascript? > > Thanks > Dan > > Save this as "fpic_move_test.js": > > inlets = 1; > outlets = 1; > > //// these functions look the same to me, but moving the fpic doesn't work. > //// > //// is there a way to move an fpic object in javascript? > > function move_myPanel(X, Y) > { > /// get my panel object > var myPanel = this.patcher.getnamed("myPanel"); > > /// move the 100x100 Panel > myPanel.rect = [X, Y, X+100, Y+100]; > } > > function move_myFpic(X, Y) > { > /// get my fpic object > var myFpic = this.patcher.getnamed("myFpic"); > > /// move my Fpic > myFpic.rect = [X, Y, X+100, Y+100]; > } > > And then run this Max patch: > > max v2; > #N vpatcher 178 288 821 782; > #P window setfont "Sans Serif" 9.; > #P window linecount 1; > #P comment 92 178 100 196617 This doesn't:; > #P message 92 196 114 196617 move_myFpic 300 300; > #P message 43 128 120 196617 move_myPanel 285 200; > #P comment 433 132 117 196617 This is named "myFpic"; > #P user fpic 439 172 102 52 DL_Player_Replace_Button_2.jpg 0 0 0 0. 0 0 0; > #P objectname myFpic; > #P newex 43 275 105 196617 js fpic_move_test.js; > #P user panel 290 163 100 100; > #X brgb 191 191 191; > #X frgb 0 0 0; > #X border 1; > #X rounded 0; > #X shadow 0; > #X done; > #P objectname myPanel; > #P comment 279 136 117 196617 This is named "myPanel"; > #P comment 453 148 100 196617 (load any pic); > #P comment 42 109 100 196617 This works:; > #P connect 7 0 4 0; > #P connect 8 0 4 0; > #P pop; > ---------------------------------------------------- From c74-mailinglists at e--j.com Tue Oct 23 22:40:01 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Tue Oct 23 22:40:14 2007 Subject: [javascript-dev] Re: can't move fpic with Maxobj.rect, is there another way? In-Reply-To: <1d103.471eab79@www.cycling74.com> References: <1d103.471eab79@www.cycling74.com> Message-ID: <2DEBB935-0027-4E84-A80B-9DD31A77B952@e--j.com> On 24 oct. 07, at 04:18, Dan wrote: > I've got a workaround where I send information out one of my js > object's outlets and use "script move" messages to [thispatcher], > but it seems so much less elegant since I'm doing everything else > in Javascript. Am I missing something obvious? There's something wrong, in the meantime, you can send the "script move" message from JavaScript, which is slightly more elegant. Cheers, ej inlets = 1; outlets = 1; //// these functions look the same to me, but moving the fpic doesn't work. //// //// is there a way to move an fpic object in javascript? function move_myPanel(X, Y) { /// get my panel object var myPanel = this.patcher.getnamed("myPanel"); /// move the 100x100 Panel myPanel.rect = [X, Y, X+100, Y+100]; } function move_myFpic(X, Y) { /// move my Fpic this.patcher.message("script", "move", "myFpic", X, Y); } From dlehrich at gmail.com Tue Oct 23 22:58:54 2007 From: dlehrich at gmail.com (Dan) Date: Tue Oct 23 22:58:56 2007 Subject: [javascript-dev] Re: Re: can't move fpic with Maxobj.rect, is there another way? In-Reply-To: <2DEBB935-0027-4E84-A80B-9DD31A77B952@e--j.com> Message-ID: <1d10c.471ed10e@www.cycling74.com> thanks very much ej! /dan From roald.baudoux at brutele.be Sat Oct 27 13:29:46 2007 From: roald.baudoux at brutele.be (Roald Baudoux) Date: Sat Oct 27 13:30:13 2007 Subject: [javascript-dev] Providing default values when expected arguments not provided Message-ID: Hello, I am trying to built a random number generator with lower and upper limits defined as arguments. I try to provide default values in case no argument is typed in however the following script doesn't work. It returns a NaN as output. Any advice? Roald Baudoux // Random number generator // inlets and outlets inlets = 1; outlets = 1; //global variables var random_minimum = jsarguments[1]; var random_maximum = jsarguments[2]; var random_range = random_maximum - random_minimum; // random generation upon bang message function bang() { if (random_minimum=="") random_minimum = 0.; else random_minimum = random_minimum; if (random_maximum=="") vrandom_maximum = 1.; else random_maximum = random_maximum; outlet (0, ((Math.random() * random_range)+random_minimum)); } From roby at arts.lu Sat Oct 27 15:36:15 2007 From: roby at arts.lu (Roby Steinmetzer) Date: Sat Oct 27 15:36:20 2007 Subject: [javascript-dev] Providing default values when expected arguments not provided In-Reply-To: References: Message-ID: <2A12A1F0-8827-472E-B58B-E668B8E3E5F2@arts.lu> Salut Roald, On 27 oct. 07, at 21:29, Roald Baudoux wrote: > I am trying to built a random number generator with lower and upper > limits defined as arguments. > > I try to provide default values in case no argument is typed in > however the following script doesn't work. It returns a NaN as output. You could initialize the min and max vars with your default values and then check for the number of arguments. Something like this: // Random number generator // inlets and outlets inlets = 1; outlets = 1; //global variables var random_minimum = 0.; var random_maximum = 1.; if (jsarguments.length==2) { random_minimum = jsarguments[1]; } else if (jsarguments.length==3) { random_minimum = jsarguments[1]; random_maximum = jsarguments[2]; } else if (jsarguments.length>3) { post("error: wrong number of arguments"); post(); } var random_range = random_maximum - random_minimum; // random generation upon bang message function bang() { outlet (0, ((Math.random() * random_range)+random_minimum)); } From roald.baudoux at brutele.be Sat Oct 27 15:43:42 2007 From: roald.baudoux at brutele.be (Roald Baudoux) Date: Sat Oct 27 15:44:08 2007 Subject: [javascript-dev] Re: Providing default values when expected arguments not provided In-Reply-To: References: Message-ID: OK, the answer is in Max tutorial 50. The corrected script is below. Roald Baudoux // Random number generator // inlets and outlets inlets = 1; outlets = 1; //global variables var random_minimum = 0.; var random_maximum = 1.; // random generation upon bang message function bang() { if(jsarguments.length>1) // argument 0 is the name of the js file { random_minimum = jsarguments[1]; } if(jsarguments.length>2) { random_maximum = jsarguments[2]; } var random_range = random_maximum - random_minimum; outlet (0, ((Math.random() * random_range)+random_minimum)); } Le 27-oct.-07 ? 21:29, Roald Baudoux a ?crit : > Hello, > > I am trying to built a random number generator with lower and upper > limits defined as arguments. > > I try to provide default values in case no argument is typed in > however the following script doesn't work. It returns a NaN as output. > > Any advice? > > Roald Baudoux > > > // Random number generator > > // inlets and outlets > inlets = 1; > outlets = 1; > > //global variables > var random_minimum = jsarguments[1]; > var random_maximum = jsarguments[2]; > > var random_range = random_maximum - random_minimum; > > // random generation upon bang message > function bang() > { > if (random_minimum=="") > random_minimum = 0.; > else > random_minimum = random_minimum; > if (random_maximum=="") > vrandom_maximum = 1.; > else > random_maximum = random_maximum; > outlet (0, ((Math.random() * random_range)+random_minimum)); > } > > > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev From derrickgiscloux at free.fr Sun Oct 28 05:23:32 2007 From: derrickgiscloux at free.fr (Derrick Giscloux) Date: Sun Oct 28 05:23:34 2007 Subject: [javascript-dev] error returned in max window Message-ID: <1d245.47247130@www.cycling74.com> Hi JSlist ! I'm new in JS. It's really hard to start and I try to see clear. Goal of my script is to change the color and shape of a jit.gl.gridshape object named "geometrie" when I clic on it through the jit.window named "visu". I put a JitterListener and a callback function. Max return an error that seems incorrect to me : ? error: js: gltest4.js: Javascript ReferenceError: visu is not defined, line 49 Sure "visu" is defined. Please could you have a look at my script. Thanks //JS // //////////instantiation des objets jitter/////////////// //objet jit.window var win = new JitterObject("jit.window", "visu"); win.depthbuffer = 1; win.floating=1; win.size = [320,240]; //objet jit.gl.render var ren = new JitterObject("jit.gl.render","visu"); //objet jit.gl.gridshape var geometrie = new JitterObject("jit.gl.gridshape","visu"); geometrie.scale =[1., 1., 1.]; geometrie.depth_enable = 1; geometrie.smooth_shading = 1; geometrie.color =[.2, .6, .3]; geometrie.lighting_enable = 1; geometrie.shape = "cube"; /////////implantation de la fonction du m?tronome : rendre//////////// function bang() { ren.erase(); ren.drawswap(); // necessaire pour rafraichir...semble-t-til! } // //////////////////////ajout de fonctions////////////////////// function forme(a) { geometrie.shape= [a]; } function taille(x,y,z) { geometrie.scale =[x,y,z]; } function couleur(r,g,b) { geometrie.color=[r,g,b]; } /////////Instanciation d'un listener des actions de la souris sur "visu"//////// //getregisteredname() est la propri?t? qui nous renvoie le nom par lequel l'objet cliqu? sera accessible par le listener (ici "visu") //moncallback = fonction qui sera appel?e lorsqu'une action a effectivement lieu var listener = new JitterListener(visu.getregisteredname(),moncallback); //cr?ation de la fonction de callback = capturer les clic de la souris function moncallback(event) { var monbouton; //d?claration de la variable button if (event.eventname=="mouse") //lorsque je clic dans la window le prefix mouse va pr?c?der x, y ou 1/0 pour clic. La propri?t? event se charge de ce mot cl?. On attribut au mot cl? "mouse" la m?thode "eventname". { monbouton = event.args[2]; //je ne veux que le 2?me argument (0=x,1=y et 2=clic) if (button) // Si on a cliqu?...alors { geometrie.color =[.6, .2, .2]; // changer la couleur geometrie.shape = "torus"; // changer en anneau } else // Si on a relach? { geometrie.color = [.2, .7, .3]; // revenir ? la couleur d'origine geometrie.shape = "cube"; // revenir ? la forme d'origine : un cube } } } // here's the patch : max v2; #N vpatcher 658 72 1153 398; #P origin -20 -39; #P window setfont "Sans Serif" 9.; #P newex 20 97 80 196617 prepend symbol; #P user ubumenu 21 78 94 196617 0 1 1 0; #X add sphere; #X add torus; #X add cylinder; #X add opencylinder; #X add cube; #X add opencube; #X add plane; #X add circle; #X prefix_set 0 0 0; #P message 20 117 52 196617 forme \$1; #P message 16 213 65 196617 autowatch 1; #P user swatch 233 47 128 32; #P newex 233 103 81 196617 vexpr $i1/255.; #B color 2; #P newex 233 82 51 196617 pak 0 0 0; #P newex 233 125 61 196617 pak 0. 0. 0.; #P message 233 145 88 196617 couleur \$1 \$2 \$3; #P flonum 267 175 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 242 197 61 196617 pak 0. 0. 0.; #P message 242 217 78 196617 taille \$1 \$2 \$3; #P number 137 175 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P toggle 90 175 15 0; #P newex 90 197 57 196617 qmetro 20; #P newex 90 248 66 196617 js gltest4.js; #P comment 252 233 100 196617 change scale; #P fasten 15 1 16 0 68 95 25 95; #P connect 16 0 14 0; #P connect 3 0 2 0; #P connect 14 0 1 0; #P fasten 13 0 1 0 21 232 95 232; #P connect 2 0 1 0; #P fasten 5 0 1 0 247 240 95 240; #P connect 8 0 1 0; #P connect 4 0 2 1; #P connect 12 0 10 0; #P connect 10 0 11 0; #P connect 11 0 9 0; #P connect 9 0 8 0; #P connect 7 0 6 0; #P connect 6 0 5 0; #P connect 7 0 6 1; #P connect 7 0 6 2; #P pop; From jkc at musork.com Sun Oct 28 11:12:39 2007 From: jkc at musork.com (Joshua Kit Clayton) Date: Sun Oct 28 11:12:47 2007 Subject: [javascript-dev] error returned in max window In-Reply-To: <1d245.47247130@www.cycling74.com> References: <1d245.47247130@www.cycling74.com> Message-ID: <9B5882C6-BD5B-4671-9E4F-C65AD7841F9D@musork.com> On Oct 28, 2007, at 4:23 AM, Derrick Giscloux wrote: > > Sure "visu" is defined. In Jitter, not Javascript. They are different. Notice that the JS variable for your window is win, not visu. The latter is its Jitter name. > //objet jit.window > var win = new JitterObject("jit.window", "visu"); > > var listener = new JitterListener(visu.getregisteredname > (),moncallback); Above should be win.name which will return "visu". Or you could just use "visu" (quotes important). -Joshua From derrickgiscloux at free.fr Sun Oct 28 14:07:50 2007 From: derrickgiscloux at free.fr (Derrick Giscloux) Date: Sun Oct 28 14:10:44 2007 Subject: [javascript-dev] Re: error returned in max window In-Reply-To: <9B5882C6-BD5B-4671-9E4F-C65AD7841F9D@musork.com> Message-ID: <1d275.4724ec16@www.cycling74.com> oh ! great ! thank you very much. From ayeshas88 at gmail.com Wed Oct 31 03:13:04 2007 From: ayeshas88 at gmail.com (ayeshas) Date: Wed Oct 31 03:13:05 2007 Subject: [javascript-dev] Looking Web design and hosting company Message-ID: <1d354.4728471f@www.cycling74.com> I have developed website in html and flash through [url=http://www.bizline.com.pk]pakistan web design company[/url] , They have developed my content in flash and some sections developed in php and database mysql. Now i have required any cheap hosting which offer all such features, Please let me know if you have any idea. waiting your friendly reply