From doktorp at mac.com Thu Aug 2 23:05:25 2007 From: doktorp at mac.com (vade) Date: Thu Aug 2 23:05:28 2007 Subject: [javascript-dev] jit.lcd - error -50 creating offscreen? Message-ID: <1b501.46b2b795@www.cycling74.com> Simple question, is jit.lcd supported as a JitterObject? The following code errors: var lcd = new JitterObject("jit.lcd"); In Console:lcd: error -50 creating offscreen From doktorp at mac.com Thu Aug 2 23:06:55 2007 From: doktorp at mac.com (vade) Date: Thu Aug 2 23:07:01 2007 Subject: [javascript-dev] Re: jit.lcd - error -50 creating offscreen? In-Reply-To: <1b501.46b2b795@www.cycling74.com> Message-ID: <1b502.46b2b7ef@www.cycling74.com> This fucking forum will not, no matter what, display all of my message. I will eat its babies. lets try this again. Simple question, is jit.lcd supported as a JitterObject? The following code errors: var lcd = new JitterObject("jit.lcd"); In Console:lcd: error -50 creating offscreen From doktorp at mac.com Thu Aug 2 23:07:59 2007 From: doktorp at mac.com (vade) Date: Thu Aug 2 23:08:01 2007 Subject: [javascript-dev] Re: jit.lcd - error -50 creating offscreen? In-Reply-To: <1b502.46b2b7ef@www.cycling74.com> Message-ID: <1b503.46b2b82f@www.cycling74.com> Babies.eaten = true. Attempting to create my jit.lcd with dimensions such as var lcd = new JitterObject("jit.lcd", 4, "char", 80,60); returns an error: •error: #N: bad arguments for message "jit_lcd" •error: jsjitterobject_Constructor: null object jit_lcd •error: js: v001.grid_selector.js: Javascript ReferenceError: jit is not defined, line 26 etc. etc. Is jit.lcd not supported in JS? Did I miss a memo? (I missed the jit.display memo :( ) From doktorp at mac.com Thu Aug 2 23:10:37 2007 From: doktorp at mac.com (vade) Date: Thu Aug 2 23:10:42 2007 Subject: [javascript-dev] Re: jit.lcd - error -50 creating offscreen? In-Reply-To: <1b501.46b2b795@www.cycling74.com> Message-ID: <1b504.46b2b8cc@www.cycling74.com> Is safari 3 causing issues? im running the latest beta (incase the web team is reading this). Babies taste good, but require sauce. Tartar sauce. Try it. From doktorp at mac.com Fri Aug 3 10:44:22 2007 From: doktorp at mac.com (vade) Date: Fri Aug 3 10:44:26 2007 Subject: [javascript-dev] Re: jit.lcd - error -50 creating offscreen? In-Reply-To: <1b501.46b2b795@www.cycling74.com> Message-ID: <1b531.46b35b65@www.cycling74.com> Ive eaten many babies. jit.lcd is not mop compatible so will not work. From doktorp at mac.com Fri Aug 3 14:44:40 2007 From: doktorp at mac.com (vade) Date: Fri Aug 3 14:44:43 2007 Subject: [javascript-dev] Re: jit.lcd - error -50 creating offscreen? In-Reply-To: <1b531.46b35b65@www.cycling74.com> Message-ID: <1b547.46b393b8@www.cycling74.com> news flash jit.lcd has a "non-standard matrix processing dingus" I thought you should all know. From mattijs at smadsteck.nl Fri Aug 3 18:53:29 2007 From: mattijs at smadsteck.nl (Mattijs Kneppers) Date: Fri Aug 3 18:53:31 2007 Subject: [javascript-dev] Re: jit.lcd - error -50 creating offscreen? In-Reply-To: <1b502.46b2b7ef@www.cycling74.com> Message-ID: <1b557.46b3ce08@www.cycling74.com> It happened to me too, twice. I checked the message with a hex editor. When a character 00xF is in the message, the forum will truncate from there. The 00xF seems to originate in the max window. Quote: vade wrote on Fri, 03 August 2007 07:06 ---------------------------------------------------- > This fucking forum will not, no matter what, display all of my message. I will eat its babies. > > lets try this again. > > Simple question, is jit.lcd supported as a JitterObject? > > The following code errors: > var lcd = new JitterObject("jit.lcd"); > > In Console:lcd: error -50 creating offscreen > ---------------------------------------------------- -- SmadSteck - http://www.smadsteck.nl Hard- and software for interactive audiovisual sampling From pnyboer at slambassador.com Mon Aug 13 14:17:45 2007 From: pnyboer at slambassador.com (pnyboer) Date: Mon Aug 13 14:17:48 2007 Subject: [javascript-dev] retreive value of named object in js? Message-ID: <1b7dc.46c0bc68@www.cycling74.com> I've looked in the docs and forum for an answer to this, but it clearly isn't straightforward. I have an object (a pictctrl) with a name that I'd like to retreive it's value from within a javascript. for example it would be great if this worked... var myobject = this.patcher.getnamed("Knob"); var myvalue = myobject.value; post("myvalue is: ",myvalue); but of course it does not. any suggestions? peter -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Lifespan 2 oz brandy 1/2 oz orgeat 1/2 oz maraschino 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice Shake with ice and serve in a Pernod-rinsed cocktail glass From pnyboer at slambassador.com Mon Aug 13 17:30:13 2007 From: pnyboer at slambassador.com (pnyboer) Date: Mon Aug 13 17:30:19 2007 Subject: [javascript-dev] bug? with jit.matrix and planemap in js Message-ID: <1b7ef.46c0e984@www.cycling74.com> I'm trying to map the green channel to the alpha channel using planemap in javascript. the js and patch below show that (what I belive to be) equivalent situations produce different results - works in 'visual' max, but not in js max. //-----begin map.js var mov = new JitterObject("jit.qt.movie"); mov.autostart = 1; mov.adapt = 1; var outmatrix = new JitterMatrix(4,"char"); outmatrix.adapt = 1; outmatrix.planemap = [2,1,2,3]; function bang(){ mov.matrixcalc(outmatrix,outmatrix); outlet(0,"jit_matrix",outmatrix.name); } function read(v){ rv = mov.read(v); } function getit(){ post("planemap is: ",outmatrix.planemap[0],outmatrix.planemap[1],outmatrix.planemap[2],outmatrix.planemap[3]); } //////------end map.js------------- -----begin patch map.js.help---- #P window setfont "Sans Serif" 9.; #P window linecount 1; #P comment 557 260 100 196617 it works here!; #P user jit.pwindow 801 195 82 62 0 1 0 0 1 0; #P user jit.pwindow 720 195 82 62 0 1 0 0 1 0; #P user jit.pwindow 639 195 82 62 0 1 0 0 1 0; #P user jit.pwindow 558 195 82 62 0 1 0 0 1 0; #P newex 683 146 66 196617 jit.unpack; #P newex 577 125 143 196617 jit.matrix @planemap 2 1 2 3; #P newex 577 104 63 196617 jit.qt.movie; #P comment 184 308 235 196617 <--according to the report \, the @ is correctly set; #P message 151 306 31 196617 getit; #P newex 126 128 21 196617 t 1; #P user jit.pwindow 441 196 82 62 0 1 0 0 1 0; #P user jit.pwindow 360 196 82 62 0 1 0 0 1 0; #P user jit.pwindow 279 196 82 62 0 1 0 0 1 0; #P user jit.pwindow 198 196 82 62 0 1 0 0 1 0; #P newex 323 147 66 196617 jit.unpack; #P toggle 174 110 15 0; #P newex 175 131 46 196617 metro 3; #P user jit.pwindow 64 195 82 62 0 1 0 0 1 0; #P user dropfile 48 19 154 117 1; #P window linecount 2; #P comment 51 55 100 196617 drag and drop a file here...; #P window linecount 1; #P newex 53 127 68 196617 prepend read; #P newex 57 158 52 196617 js map.js; #P window linecount 3; #P comment 195 263 100 196617 why isn't the planemap in the js doing its job?; #P connect 4 0 2 0; #P connect 6 0 1 0; #P connect 2 0 1 0; #P connect 14 0 1 0; #P connect 1 0 5 0; #P connect 2 0 13 0; #P connect 13 0 7 0; #P connect 7 0 6 0; #P connect 8 0 9 0; #P connect 8 1 10 0; #P connect 1 0 8 0; #P connect 8 2 11 0; #P connect 8 3 12 0; #P connect 18 0 19 0; #P connect 6 0 16 0; #P connect 2 0 16 0; #P connect 16 0 17 0; #P connect 18 1 20 0; #P connect 17 0 18 0; #P connect 18 2 21 0; #P connect 18 3 22 0; #P window clipboard copycount 24; -----end patch map.js.help-------- -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Lifespan 2 oz brandy 1/2 oz orgeat 1/2 oz maraschino 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice Shake with ice and serve in a Pernod-rinsed cocktail glass From pdelges at radiantslab.com Tue Aug 14 02:14:50 2007 From: pdelges at radiantslab.com (Patrick Delges) Date: Tue Aug 14 02:14:58 2007 Subject: [javascript-dev] retreive value of named object in js? In-Reply-To: <1b7dc.46c0bc68@www.cycling74.com> References: <1b7dc.46c0bc68@www.cycling74.com> Message-ID: <5091dd7cf3292bc2a10cadce811e2d08@radiantslab.com> On 13 ao?t 07, at 22:17, pnyboer wrote: > > but of course it does not. any suggestions? An ugly one, but it works: using [grab] #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 56 125 62 196617 prepend foo; #P newex 94 62 30 196617 grab; #P objectname grabKnob; #P button 36 228 15 0; #P newex 56 253 99 196617 js boo.js; #P number 158 157 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P user pictctrl 158 88 100 50 ti_HD_X:/Users/pdelges/Documents/biglogo.pict 0 50 0 1 26 0 1 0 64 64 128 0 1 10 2 0 1 270; #P connect 5 0 2 0; #P connect 4 0 5 0; #P connect 4 1 0 0; #P connect 3 0 2 0; #P connect 0 0 1 0; #P window clipboard copycount 6; save as boo.js: var myobject ; function bang () { myobject = this.patcher.getnamed("grabKnob"); myobject.message("bang"); } function foo (i) { post (i); } But I deeply hope there is some "get" or "value" message hidden somewhere... p _____________________________ Patrick Delges Centre de Recherches et de Formation Musicales de Wallonie asbl http://users.skynet.be/crfmw/max From jeremy at bootsquad.com Tue Aug 14 08:54:46 2007 From: jeremy at bootsquad.com (Jeremy Bernstein) Date: Tue Aug 14 08:54:53 2007 Subject: [javascript-dev] retreive value of named object in js? In-Reply-To: <5091dd7cf3292bc2a10cadce811e2d08@radiantslab.com> References: <1b7dc.46c0bc68@www.cycling74.com> <5091dd7cf3292bc2a10cadce811e2d08@radiantslab.com> Message-ID: I'm ashamed to say, there isn't at this time. jb Am 14.08.2007 um 10:14 schrieb Patrick Delges: > But I deeply hope there is some "get" or "value" message hidden > somewhere... From pnyboer at slambassador.com Tue Aug 14 09:35:37 2007 From: pnyboer at slambassador.com (pnyboer) Date: Tue Aug 14 09:35:47 2007 Subject: [javascript-dev] Re: retreive value of named object in js? In-Reply-To: Message-ID: <1b821.46c1cbc8@www.cycling74.com> ok, thanks for squashing my hopes :) I ended up solving the problem by running the needed interface controls through javascript and handling everything there. In my situation it was a classic case of 6 of 1, half dozen of the other. However, I do look forward to being able to arbitrarily and noninvasively poll an object for its value from a js! P. -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Lifespan 2 oz brandy 1/2 oz orgeat 1/2 oz maraschino 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice Shake with ice and serve in a Pernod-rinsed cocktail glass From pnyboer at slambassador.com Tue Aug 14 15:55:53 2007 From: pnyboer at slambassador.com (pnyboer) Date: Tue Aug 14 15:55:56 2007 Subject: [javascript-dev] Re: Javascript function is not a function? In-Reply-To: <1b039.469e1a1b@www.cycling74.com> Message-ID: <1b857.46c224e9@www.cycling74.com> Here's one way to get that error... If you declare a RegExp as a variable outside of a function, such as: var vpattern = ".*"; var vmodifier = "i"; var vregexp = new RegExp(vpattern,vmodifier); you'll get that error. The regexp works, it just generates an error for some reason. There could be other reasons for this error, too. Peter. -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Lifespan 2 oz brandy 1/2 oz orgeat 1/2 oz maraschino 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice Shake with ice and serve in a Pernod-rinsed cocktail glass From pnyboer at slambassador.com Tue Aug 14 15:58:00 2007 From: pnyboer at slambassador.com (pnyboer) Date: Tue Aug 14 15:58:02 2007 Subject: [javascript-dev] Re: [sharingisfun] js based LFO In-Reply-To: <192ea.4636ef9f@www.cycling74.com> Message-ID: <1b858.46c22568@www.cycling74.com> http://www.yowstar.com/share/lfojs.zip has been updated, and includes event-based triggering and two new lfos - random and "continuous random" aka random triangle ("randangle"?) Peter. -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Lifespan 2 oz brandy 1/2 oz orgeat 1/2 oz maraschino 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice Shake with ice and serve in a Pernod-rinsed cocktail glass From grimepoch at mac.com Fri Aug 17 12:11:42 2007 From: grimepoch at mac.com (Rick Burnett) Date: Fri Aug 17 12:11:44 2007 Subject: [javascript-dev] File Access Problem Message-ID: <1b952.46c5e4dd@www.cycling74.com> Hello! When I open a file in write mode, is there a way to tell it to overwrite the file completely without having to delete it with something like java? The problem I am having is that if I try to write over a file with a smaller amount of data, the old file data remains after it. From jeremy at bootsquad.com Fri Aug 17 15:39:38 2007 From: jeremy at bootsquad.com (Jeremy Bernstein) Date: Fri Aug 17 15:39:43 2007 Subject: [javascript-dev] File Access Problem In-Reply-To: <1b952.46c5e4dd@www.cycling74.com> References: <1b952.46c5e4dd@www.cycling74.com> Message-ID: <149C1DB6-8CA8-48D0-B913-7300D9069D7F@bootsquad.com> Set the eof property to 0. jb Am 17.08.2007 um 19:11 schrieb Rick Burnett: > > Hello! > > When I open a file in write mode, is there a way to tell it to > overwrite the file completely without having to delete it with > something like java? The problem I am having is that if I try to > write over a file with a smaller amount of data, the old file data > remains after it. > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev From grimepoch at mac.com Sat Aug 18 09:47:08 2007 From: grimepoch at mac.com (Rick Burnett) Date: Sat Aug 18 09:47:08 2007 Subject: [javascript-dev] Re: File Access Problem In-Reply-To: <149C1DB6-8CA8-48D0-B913-7300D9069D7F@bootsquad.com> Message-ID: <1b98d.46c7147b@www.cycling74.com> Thanks! Haha, I had figured it out by trial and error. What I thought was interesting is that I tried to use the current position property and set the eof to that after I had done all my writing to the file but that didn't work. I do not understand why it wouldn't. rick From pplato at gmail.com Thu Aug 23 03:37:15 2007 From: pplato at gmail.com (Jean-Baptiste Thiebaut) Date: Thu Aug 23 03:37:18 2007 Subject: [javascript-dev] create a list of the last n values (or anything else) Message-ID: <1bb18.46cd5549@www.cycling74.com> Hi, Here is the javascript code of a simple function that outputs a list of the last n values (specified in the argument, such as "js list 10"), every time it receives a new value. I struggled to find a way of doing that with "zl" so I wrote this simple code. I thought it might be useful to some, so here is the code (also attached): var size_list = jsarguments[1]; var t = new Array(size_list); var t_sorted = new Array(size_list); var pos = 0; function anything(v) { t[pos] = v; for (var i = 0; i < size_list ; i++) t_sorted[i] = t[(pos+1+i)%size_list]; pos = (pos+1)%size_list; outlet(0,t_sorted); } best Jean-Baptiste -------------- next part -------------- A non-text attachment was scrubbed... Name: list Type: application/octet-stream Size: 274 bytes Desc: not available Url : http://www.cycling74.com/pipermail/javascript-dev/attachments/20070823/4e2c4a4f/list.obj From julien.rabin at gmail.com Thu Aug 23 08:00:03 2007 From: julien.rabin at gmail.com (jln) Date: Thu Aug 23 08:00:11 2007 Subject: [javascript-dev] create a list of the last n values (or anything else) In-Reply-To: <1bb18.46cd5549@www.cycling74.com> References: <1bb18.46cd5549@www.cycling74.com> Message-ID: <1BC2F598-D5B3-4704-8F05-9674A243EF5F@gmail.com> Le 23 ao?t 07 ? 11:37, Jean-Baptiste Thiebaut a ?crit : > I struggled to find a way of doing that with "zl" so I wrote this > simple code. Thanks for sharing. As I'm not good enough with js and struggled to find a way to that with it, I maked this simple patch: ;-) #P outlet 453 500 15 0; #P inlet 372 130 15 0; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 372 333 27 196617 - 1; #P newex 399 274 44 196617 t zlclear; #P newex 453 235 25 196617 iter; #P newex 372 163 147 196617 route length clear int list float; #P newex 453 346 38 196617 zl join; #P newex 469 380 58 196617 zl slice $1; #P connect 1 0 7 0; #P connect 1 0 0 0; #P fasten 5 0 0 1 377 373 522 373; #P fasten 0 0 1 1 474 420 565 420 565 342 486 342; #P connect 6 0 2 0; #P connect 2 0 5 0; #P connect 2 1 4 0; #P connect 2 5 3 0; #P connect 2 3 3 0; #P fasten 2 2 1 0 431 263 458 263; #P fasten 2 4 1 0 485 263 458 263; #P connect 4 0 1 0; #P fasten 3 0 1 0 458 299 458 299; #P window clipboard copycount 8; Best, Julien. From Stefan-Tiedje at addcom.de Fri Aug 31 02:14:21 2007 From: Stefan-Tiedje at addcom.de (Stefan Tiedje) Date: Fri Aug 31 02:14:41 2007 Subject: [javascript-dev] create a list of the last n values (or anything else) In-Reply-To: <1bb18.46cd5549@www.cycling74.com> References: <1bb18.46cd5549@www.cycling74.com> Message-ID: <46D7CDDD.6020908@addcom.de> Jean-Baptiste Thiebaut schrieb: > I struggled to find a way of doing that with "zl" #P window setfont "Sans Serif" 9.; #P window linecount 1; #N vpatcher 536 351 813 611; #P window setfont "Sans Serif" 9.; #P window linecount 0; #P newex 178 34 63 196617 patcherargs; #P message 181 101 38 196617 zlclear; #P newex 181 77 38 196617 sel 1; #P newex 146 76 25 196617 - 1; #P window linecount 1; #P newex 50 196 41 196617 zl rev; #P newex 50 54 41 196617 t l b; #P newex 113 124 43 196617 - 1; #P newex 113 102 34 196617 zl len; #P newex 81 76 36 196617 zl reg; #P newex 50 170 41 196617 zl join; #P newex 81 145 42 196617 zl ecils; #P inlet 50 34 15 0; #P inlet 146 34 15 0; #P outlet 50 218 15 0; #P connect 2 0 8 0; #P fasten 12 0 4 0 186 166 55 166; #P connect 8 0 4 0; #P connect 4 0 9 0; #P connect 9 0 0 0; #P connect 8 1 5 0; #P connect 5 0 3 0; #P connect 3 0 4 1; #P fasten 4 0 5 1 55 191 177 191 177 71 112 71; #P fasten 5 0 6 0 86 97 118 97; #P connect 6 0 7 0; #P connect 7 0 3 1; #P connect 1 0 10 0; #P connect 10 0 7 1; #P connect 1 0 11 0; #P connect 11 0 12 0; #P pop; #P newobj 124 121 49 196617 p lastnl; #P message 124 176 99 196617 88; #P newex 124 153 62 196617 prepend set; #P number 163 67 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 124 67 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P connect 0 0 4 0; #P connect 1 0 4 1; #P connect 4 0 2 0; #P connect 2 0 3 0; #P window clipboard copycount 5; -- Stefan Tiedje------------x------- --_____-----------|-------------- --(_|_ ----|\-----|-----()------- -- _|_)----|-----()-------------- ----------()--------www.ccmix.com