From Sunish.George at surrey.ac.uk Tue Jul 3 08:58:37 2007 From: Sunish.George at surrey.ac.uk (Sunish.George@surrey.ac.uk) Date: Tue Jul 3 08:58:41 2007 Subject: [javascript-dev] seek message for 'sfplay~' from Javascript References: <1a9fc.46806f3f@www.cycling74.com> Message-ID: <5D41E33819424847A08D3E7971CDE25D217AF8@EVS-EC1-NODE3.surrey.ac.uk> Hello I am trying to use 'seek' message associated with 'sfplay~' from javascript. The code is as follows: //Recording to be played rec = "meatloaf_004.wav"; //open the specified recording to be played through sfplayer. sfplayer is the equivalent Javascript object for 'sfplay~' sfplayer.message("open",rec); //Playing from X msec onwards. sfplayer.message("seek",X); //looping sfplayer.message("loop",1); When running this snippet of javascript, the playback starts from 0 msec instead of X msec. Am I doing anything wrong here? Some of you please suggest a solution for this? Many thanks Sunish -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cycling74.com/pipermail/javascript-dev/attachments/20070703/f11281f8/attachment.htm From pnyboer at slambassador.com Thu Jul 5 14:17:41 2007 From: pnyboer at slambassador.com (pnyboer) Date: Thu Jul 5 14:17:44 2007 Subject: [javascript-dev] JitterListener and jit.qt.movie read...bug? Message-ID: <1ace2.468d51e4@www.cycling74.com> I would expect that a JitterListener would catch the "read" message that normally comes out of a jit.qt.movie object, but this doesn't seem to be the case? Here is a simple javascript and patch that I would expect this to post a "read <1/0>" in the max window...but it does not! It does, however, post a "flatten" message after that is successful. /* listens to a jit.qt.movie's output. It doesn't seem to generate a "read" message after I read a file? The savemovie and flatten are in here simple to demonstarte that the listener is working at least for the "flatten" command */ var mov01 = new JitterObject("jit.qt.movie"); mov01.autostart = 0; var mov01listen = new JitterListener(mov01.getregisteredname(), listenresults); var movpath = "\."; function listenresults(event) { post(" listener",event.eventname); } function readmov(v){ mov01.read(v); mov01.savemoviecopy(movpath); mov01.flatten(movpath); } function savepath(v){ post(" path",v); movpath = v+"junk.mov"; } //end simplelistener.js #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 188 172 63 196617 jit.qt.movie; #P newex 211 30 48 196617 loadbang; #P message 212 54 29 196617 path; #P newex 202 109 88 196617 prepend savepath; #N thispatcher; #Q end; #P newobj 212 75 61 196617 thispatcher; #P message 89 109 99 196617 readmov dozer.mov; #P newex 112 132 88 196617 js simplelisten.js; #P connect 1 0 0 0; #P connect 3 0 0 0; #P connect 2 1 3 0; #P connect 5 0 4 0; #P connect 4 0 2 0; #P window clipboard copycount 7; -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 Thu Jul 5 14:22:49 2007 From: pnyboer at slambassador.com (pnyboer) Date: Thu Jul 5 14:22:51 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1ace2.468d51e4@www.cycling74.com> Message-ID: <1ace4.468d5318@www.cycling74.com> also, i'd expect the savemoviecopy to generate something that the listener would "hear", but it doesn't seem to either... 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 ico at vt.edu Mon Jul 9 09:57:10 2007 From: ico at vt.edu (Ivica Ico Bukvic) Date: Mon Jul 9 09:57:15 2007 Subject: [javascript-dev] another example of weird javascript crosstalk Message-ID: <007001c7c241$cfa135a0$0402a8c0@64BitBadass> Hi all, Here is an addendum to a problem I posted earlier on the maxmsp list. Symptom 1: multiple instances of the same abstraction (which contains a js object for the purpose of creation dynamic number of audio outputs) create objects ok when included in the same file (see poly_test.pat below), their #0 argument is for some reason cross-polluted. So if we have a "boo" and "bao" instance, both of them will be for some reason instantiated as "boo" in this case. Symptom 2: matters are worse when using this in conjunction with poly~ (see main.pat below) where sometimes instance 1 fails to create objects. I tried rigging the code with Tasks to delay their execution within javascript which for the most part minimizes failure to create objects, but (depending on the time it takes to instantiate poly object, especially in the case of more complex objects) its success rate is impossible to assess consistently. I also tried using setname message which would be responsible for instantiating object's name via external message and that does not work consistently either. Expected behavior: multiple instances should instantiate as per their #0 vars and create/delete objects as expected. FWIW, I tried changing js filenames as well as making two different (identical) abstractions with different filenames in hope to make them more different, neither of which had any bearing in this case. Any insight in this matter is most appreciated. NB: in order for this example to work, please use exact .pat and .js names //dac2~.pat abstraction #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 70 161 109 9109513 send~ $2; #P newex 48 46 49 9109513 zl nth $1; #N comlet signal~; #P inlet 27 26 15 0; #P newex 27 132 30 9109513 *~ 0.; #N comlet amplitude; #P inlet 48 26 15 0; #P newex 48 109 44 9109513 line~ 0.; #P newex 27 161 41 9109513 dac~ $1; #P flonum 48 68 59 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 48 87 59 9109513 append 10; #P connect 5 0 2 0; #P fasten 5 0 8 0 32 155 75 155; #P connect 0 0 3 0; #P connect 1 0 0 0; #P connect 7 0 1 0; #P connect 4 0 7 0; #P connect 3 0 5 1; #P connect 6 0 5 0; #P window clipboard copycount 9; //modular_dac~.pat abstraction #P button 508 25 15 0; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P message 525 25 13 9109513 1; #N comlet instance number; #P inlet 540 25 15 0; #N comlet speaker amplitude list; #P inlet 287 25 15 0; #P objectname amp_list; #P number 626 44 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; #P number 583 44 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; #N comlet rows; #P inlet 626 25 15 0; #N comlet cols; #P inlet 583 25 15 0; #P newex 540 64 97 9109513 js dac2.js $1; #N comlet signal~; #P inlet 9 25 15 0; #P objectname sig_in; #P connect 5 0 1 2; #P connect 3 0 5 0; #P connect 4 0 1 1; #P connect 2 0 4 0; #P connect 7 0 1 0; #P connect 9 0 1 0; #P connect 8 0 1 0; #P window clipboard copycount 10; //poly_test.pat (single instance) #P window setfont "Sans Serif" 10.; #P window linecount 1; #N in 2; #P newobj 143 43 26 9109514 in 2; #P message 243 95 14 9109514 1; #P message 299 96 14 9109514 2; #P newex 285 66 53 9109514 loadbang; #P newex 254 146 97 9109514 modular_dac~ bao; #P newex 139 146 97 9109514 modular_dac~ boo; #P connect 3 0 1 2; #P connect 3 0 1 3; #P connect 3 0 1 4; #P connect 2 0 4 0; #P connect 2 0 3 0; #P connect 5 0 0 2; #P connect 5 0 1 2; #P connect 4 0 0 4; #P connect 4 0 0 3; #P connect 4 0 0 2; #P window clipboard copycount 6; //main.pat (poly~ example) #P window setfont "Sans Serif" 10.; #P window linecount 1; #N thispatcher; #Q end; #P newobj 313 126 59 9109514 thispatcher; #P number 101 138 35 10 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; #P message 112 162 47 9109514 open \$1; #P message 95 110 44 9109514 target 0; #P button 252 126 15 0; #P number 171 75 35 10 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; #P message 171 100 52 9109514 voices \$1; #P newex 178 153 88 9109514 poly~ poly_test 1; #P connect 3 0 0 1; #P connect 4 0 0 0; #P connect 1 0 0 0; #P connect 5 0 0 0; #P connect 2 0 1 0; #P connect 6 0 5 0; #P window clipboard copycount 8; //dac2.js inlets=3; //instance/reset (bang), cols, rows outlets=1; var cols=0; var rows=0; var instance=0; var output; var initialized=false; function msg_int(val) { if (inlet==0 && val>0) { instance=val; init(); } else if (inlet==1 && val>0 && val<17) { cols=val; init(); } else if (inlet==2 && val>0 && val<17) { rows=val; init(); } //else post ("dac2.js reports invalid data " + val + "\n"); } function init() { name=jsarguments[1]; if (cols && rows && instance && name) { if (initialized) destructor(); initialized=true; tsk=new Task(this.createoutputs); tsk.repeat(0,1000); } } function createoutputs() { output=new Array(rows*cols); //make new ones and connect them for (i=0; i References: <007001c7c241$cfa135a0$0402a8c0@64BitBadass> Message-ID: <1079b050707090906n30ddd2cdl8564f7fd0276930b@mail.gmail.com> I haven't looked closely at your files, but I have a hunch that you have global variables messing things up. In js, variables are global unless declared with the var keyword where global means global to all js objects in max. example: var x = 10; function test() { y = 100; } In the above code, x is not global but y is. wes On 7/9/07, Ivica Ico Bukvic wrote: > Hi all, > > Here is an addendum to a problem I posted earlier on the maxmsp list. > > Symptom 1: multiple instances of the same abstraction (which contains a js > object for the purpose of creation dynamic number of audio outputs) create > objects ok when included in the same file (see poly_test.pat below), their > #0 argument is for some reason cross-polluted. So if we have a "boo" and > "bao" instance, both of them will be for some reason instantiated as "boo" > in this case. > > Symptom 2: matters are worse when using this in conjunction with poly~ (see > main.pat below) where sometimes instance 1 fails to create objects. I tried > rigging the code with Tasks to delay their execution within javascript which > for the most part minimizes failure to create objects, but (depending on the > time it takes to instantiate poly object, especially in the case of more > complex objects) its success rate is impossible to assess consistently. I > also tried using setname message which would be responsible for > instantiating object's name via external message and that does not work > consistently either. > > Expected behavior: multiple instances should instantiate as per their #0 > vars and create/delete objects as expected. > > FWIW, I tried changing js filenames as well as making two different > (identical) abstractions with different filenames in hope to make them more > different, neither of which had any bearing in this case. > > Any insight in this matter is most appreciated. > > NB: in order for this example to work, please use exact .pat and .js names > > //dac2~.pat abstraction > #P window setfont "Sans Serif" 9.; > #P window linecount 1; > #P newex 70 161 109 9109513 send~ $2; > #P newex 48 46 49 9109513 zl nth $1; > #N comlet signal~; > #P inlet 27 26 15 0; > #P newex 27 132 30 9109513 *~ 0.; > #N comlet amplitude; > #P inlet 48 26 15 0; > #P newex 48 109 44 9109513 line~ 0.; > #P newex 27 161 41 9109513 dac~ $1; > #P flonum 48 68 59 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; > #P newex 48 87 59 9109513 append 10; > #P connect 5 0 2 0; > #P fasten 5 0 8 0 32 155 75 155; > #P connect 0 0 3 0; > #P connect 1 0 0 0; > #P connect 7 0 1 0; > #P connect 4 0 7 0; > #P connect 3 0 5 1; > #P connect 6 0 5 0; > #P window clipboard copycount 9; > > //modular_dac~.pat abstraction > #P button 508 25 15 0; > #P window setfont "Sans Serif" 9.; > #P window linecount 1; > #P message 525 25 13 9109513 1; > #N comlet instance number; > #P inlet 540 25 15 0; > #N comlet speaker amplitude list; > #P inlet 287 25 15 0; > #P objectname amp_list; > #P number 626 44 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; > #P number 583 44 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; > #N comlet rows; > #P inlet 626 25 15 0; > #N comlet cols; > #P inlet 583 25 15 0; > #P newex 540 64 97 9109513 js dac2.js $1; > #N comlet signal~; > #P inlet 9 25 15 0; > #P objectname sig_in; > #P connect 5 0 1 2; > #P connect 3 0 5 0; > #P connect 4 0 1 1; > #P connect 2 0 4 0; > #P connect 7 0 1 0; > #P connect 9 0 1 0; > #P connect 8 0 1 0; > #P window clipboard copycount 10; > > //poly_test.pat (single instance) > #P window setfont "Sans Serif" 10.; > #P window linecount 1; > #N in 2; > #P newobj 143 43 26 9109514 in 2; > #P message 243 95 14 9109514 1; > #P message 299 96 14 9109514 2; > #P newex 285 66 53 9109514 loadbang; > #P newex 254 146 97 9109514 modular_dac~ bao; > #P newex 139 146 97 9109514 modular_dac~ boo; > #P connect 3 0 1 2; > #P connect 3 0 1 3; > #P connect 3 0 1 4; > #P connect 2 0 4 0; > #P connect 2 0 3 0; > #P connect 5 0 0 2; > #P connect 5 0 1 2; > #P connect 4 0 0 4; > #P connect 4 0 0 3; > #P connect 4 0 0 2; > #P window clipboard copycount 6; > > //main.pat (poly~ example) > #P window setfont "Sans Serif" 10.; > #P window linecount 1; > #N thispatcher; > #Q end; > #P newobj 313 126 59 9109514 thispatcher; > #P number 101 138 35 10 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; > #P message 112 162 47 9109514 open \$1; > #P message 95 110 44 9109514 target 0; > #P button 252 126 15 0; > #P number 171 75 35 10 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; > #P message 171 100 52 9109514 voices \$1; > #P newex 178 153 88 9109514 poly~ poly_test 1; > #P connect 3 0 0 1; > #P connect 4 0 0 0; > #P connect 1 0 0 0; > #P connect 5 0 0 0; > #P connect 2 0 1 0; > #P connect 6 0 5 0; > #P window clipboard copycount 8; > > //dac2.js > inlets=3; //instance/reset (bang), cols, rows > outlets=1; > > var cols=0; > var rows=0; > var instance=0; > var output; > var initialized=false; > > function msg_int(val) > { > if (inlet==0 && val>0) > { > instance=val; > init(); > } > else if (inlet==1 && val>0 && val<17) > { > cols=val; > init(); > } > else if (inlet==2 && val>0 && val<17) > { > rows=val; > init(); > } > //else post ("dac2.js reports invalid data " + val + "\n"); > } > > function init() > { > name=jsarguments[1]; > if (cols && rows && instance && name) > { > if (initialized) destructor(); > initialized=true; > tsk=new Task(this.createoutputs); > tsk.repeat(0,1000); > } > } > > function createoutputs() > { > output=new Array(rows*cols); > //make new ones and connect them > for (i=0; i { > > output[i]=this.patcher.newdefault(100*(i%cols)+20,30*Math.floor(i/cols)+120, > "dac2~", (i+1), name + "_" + instance + "_" + (i+1)); > output[i].varname=(i+1); > } > tsk=new Task(this.connectall); > tsk.repeat(0,500); > } > > function connectall() > { > sig=this.patcher.getnamed("sig_in"); > amp=this.patcher.getnamed("amp_list"); > for (i=0; i { > this.patcher.connect(sig,0,output[i],0); > this.patcher.connect(amp,0,output[i],1); > } > } > > function bang() > { > if (inlet==0) destructor(); > } > > function destructor() > { > //a kind of destructor: remove old outputs > i=1; > while(tmp=this.patcher.getnamed(i)) > { > this.patcher.remove(tmp); > //post(i + "\n"); > i++; > } > initialized=false; > } > //end dac2.js > > Ivica Ico Bukvic, D.M.A. > Composition, Music Technology, CCTAD, CHCI > Virginia Tech > Dept. of Music - 0240 > Blacksburg, VA 24061 > (540) 231-1137 > (540) 231-5034 (fax) > ico@vt.edu > http://www.music.vt.edu/people/faculty/bukvic/ > http://ico.bukvic.net > > > > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev > From c74-mailinglists at e--j.com Mon Jul 9 10:17:59 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Mon Jul 9 10:18:10 2007 Subject: [javascript-dev] another example of weird javascript crosstalk In-Reply-To: <007001c7c241$cfa135a0$0402a8c0@64BitBadass> References: <007001c7c241$cfa135a0$0402a8c0@64BitBadass> Message-ID: On 9 juil. 07, at 17:57, Ivica Ico Bukvic wrote: > Hi all, > > Here is an addendum to a problem I posted earlier on the maxmsp list. > > Symptom 1: multiple instances of the same abstraction (which > contains a js > object for the purpose of creation dynamic number of audio outputs) > create > objects ok when included in the same file (see poly_test.pat > below), their > #0 argument is for some reason cross-polluted. So if we have a > "boo" and > "bao" instance, both of them will be for some reason instantiated > as "boo" > in this case. The problem is that your name variable is not declared in your global code. So it becomes global to every instances of your js code. That is usually the problem when you see when 2 instances of the same js seems to share things. > Symptom 2: matters are worse when using this in conjunction with > poly~ (see > main.pat below) where sometimes instance 1 fails to create objects. > I tried > rigging the code with Tasks to delay their execution within > javascript which > for the most part minimizes failure to create objects, but > (depending on the > time it takes to instantiate poly object, especially in the case of > more > complex objects) its success rate is impossible to assess > consistently. I > also tried using setname message which would be responsible for > instantiating object's name via external message and that does not > work > consistently either. I couldn't reproduce that one. Next time if you can put an archive somewhere, that would be awesome ;-) Cheers, ej From ico at vt.edu Mon Jul 9 10:40:45 2007 From: ico at vt.edu (Ivica Ico Bukvic) Date: Mon Jul 9 10:40:51 2007 Subject: [javascript-dev] another example of weird javascript crosstalk In-Reply-To: <1079b050707090906n30ddd2cdl8564f7fd0276930b@mail.gmail.com> Message-ID: <008001c7c247$e64f6d20$0402a8c0@64BitBadass> That's it! Many thanks for keeping me sane! For some reason I thought that variable declarations within functions were local. Would function.local=1; have helped in this case, or would that simply prevent external calls of such functions but have no bearing whatsoever on shared data? Again, many thanks for the tip! Best wishes, Ico From c74-mailinglists at e--j.com Mon Jul 9 10:46:12 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Mon Jul 9 10:46:21 2007 Subject: [javascript-dev] another example of weird javascript crosstalk In-Reply-To: <008001c7c247$e64f6d20$0402a8c0@64BitBadass> References: <008001c7c247$e64f6d20$0402a8c0@64BitBadass> Message-ID: <4ABC2CAB-8D04-443D-A1D3-ACC969CC1808@e--j.com> On 9 juil. 07, at 18:40, Ivica Ico Bukvic wrote: > That's it! Many thanks for keeping me sane! For some reason I > thought that > variable declarations within functions were local. Would > function.local=1; > have helped in this case, or would that simply prevent external > calls of > such functions but have no bearing whatsoever on shared data? Nope yourfunctionname.local = 1 sets the local property of a function to true? in other word, the function will be local to the file, so you can't call it from outside of the Max object (it'll says yourfunctionname is private in the Max window). ej From pnyboer at slambassador.com Mon Jul 9 11:13:23 2007 From: pnyboer at slambassador.com (pnyboer) Date: Mon Jul 9 11:13:26 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1ace2.468d51e4@www.cycling74.com> Message-ID: <1adc5.46926cb3@www.cycling74.com> if I can't get "read" reportage from the jitter listener, is there another way to find out if a js-instance of jit.qt.movie has sucessfully read a movie? I was hoping to incorporate this with a Task, such that once the listener heard the file was read, it would execute the Task. -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 hoberman at bway.net Mon Jul 9 12:10:39 2007 From: hoberman at bway.net (Perry Hoberman) Date: Mon Jul 9 12:10:56 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1ace2.468d51e4@www.cycling74.com> Message-ID: <1adc9.46927a1d@www.cycling74.com> all you have to do is read the movie with result = mov01.read(v); then result[0] will return the name of the file, and result[1] will return a 0 or a 1 depending on whether the read was successful. From pnyboer at slambassador.com Mon Jul 9 12:22:36 2007 From: pnyboer at slambassador.com (pnyboer) Date: Mon Jul 9 12:22:42 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1adc9.46927a1d@www.cycling74.com> Message-ID: <1adca.46927cea@www.cycling74.com> right...I guess the sad part is that sequencing this with Tasks is perhaps more of a pain. I did something similar with the Listener for flatten, and eventually got that to work, and I was hoping to pretty much reuse that code but listen for "read", rather than flatten. I expected the "read" to come from the Listener, since the Jitter 1.62 docs, when discussing the Listener in Tutorial 47, state: "...For example, when you read a movie file into jit.qt.movie, the object outputs the message read followed by the movie?s filename and a status number out its status outlet. " -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 jeremy at bootsquad.com Mon Jul 9 14:24:49 2007 From: jeremy at bootsquad.com (Jeremy Bernstein) Date: Mon Jul 9 12:25:30 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1adca.46927cea@www.cycling74.com> References: <1adca.46927cea@www.cycling74.com> Message-ID: <3C4673C9-03BA-45E1-8B7F-C85078618917@bootsquad.com> I am pretty sure that asyncread works with the Listener. read, being synchronous, doesn't. jb Am 09.07.2007 um 18:22 schrieb pnyboer: > > right...I guess the sad part is that sequencing this with Tasks is > perhaps more of a pain. I did something similar with the Listener > for flatten, and eventually got that to work, and I was hoping to > pretty much reuse that code but listen for "read", rather than > flatten. I expected the "read" to come from the Listener, since the > Jitter 1.62 docs, when discussing the Listener in Tutorial 47, state: > "...For example, when you read a movie file into jit.qt.movie, the > object outputs the message read followed by the movie?s filename > and a status number out its status outlet. " From pnyboer at slambassador.com Mon Jul 9 12:34:46 2007 From: pnyboer at slambassador.com (pnyboer) Date: Mon Jul 9 12:34:48 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1ace2.468d51e4@www.cycling74.com> Message-ID: <1adce.46927fc5@www.cycling74.com> AH! Thanks Jeremy. substituting "asyncread" for "read" in the above script does indeed result in a "read" message coming from the listener. -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 Jul 9 20:55:53 2007 From: pnyboer at slambassador.com (pnyboer) Date: Mon Jul 9 20:55:55 2007 Subject: [javascript-dev] Re: progress indicator... In-Reply-To: <19fd4.465f67b2@www.cycling74.com> Message-ID: <1adef.4692f537@www.cycling74.com> for the sake of the archive, here is a working version that uses the jitter listener to break up and schedule the task, keeping you informed of the progress along the way. #P window setfont "Sans Serif" 9.; #P window linecount 4; #P comment 310 190 100 196617 the js makes 12 copies of the file "dozer.mov" into the folder.; #P button 287 185 15 0; #P number 113 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 261 186 21 196617 t 0; #P newex 152 187 106 196617 prepend moverastask; #P user multiSlider 152 287 113 60 0. 10. 1 2920 15 0 0 2 0 0 0; #M frgb 0 0 0; #M brgb 255 255 255; #M rgb2 127 127 127; #M rgb3 0 0 0; #M rgb4 37 52 91; #M rgb5 74 105 182; #M rgb6 112 158 18; #M rgb7 149 211 110; #M rgb8 187 9 201; #M rgb9 224 62 37; #M rgb10 7 114 128; #P newex 152 213 66 196617 js movem.js; #P user dropfile 152 104 319 158 1; #P comment 163 116 127 196617 drag an empty folder here; #P window linecount 6; #P comment 282 289 100 196617 is it possible to show the progress of the movie copying? Nothing comes out of the js outlet until everything is done.; #P connect 2 0 5 0; #P connect 2 0 6 0; #P connect 8 0 6 0; #P connect 6 0 4 0; #P connect 3 0 7 0; #P connect 3 0 4 0; #P connect 5 0 3 0; #P window clipboard copycount 10; //-----begin movem.js /* moves the dozer.mov file to a specified folder 11 times, and provides progress while doing it. */ autowatch = 1; mov = new JitterObject("jit.qt.movie"); mov.autostart = 0; var movlisten = new JitterListener(mov.getregisteredname(), thecallback); var movepath; var movecounter = 0; var TASK_INTERVAL = 1; var MOVEIT = new Task(movetask,this); function mover(topath){ for (var i=0; i<11;i++){ var tomove = mov.read("dozer.mov"); var saveto = topath+i+mov.moviename; post(" savingto",saveto); mov.savemoviecopy(saveto); mov.flatten(saveto); myout = i; outlet(0,myout); } } function moverastask(topath){ movepath = topath; var limit = 11; if (!MOVEIT.running){ MOVEIT.execute(); } } function movetask(){ var tomove = mov.read("dozer.mov"); var saveto = movepath+movecounter+mov.moviename; post(" savingto",saveto); mov.savemoviecopy(saveto); mov.flatten(saveto); post(" counting",movecounter); outlet(0,movecounter); movecounter++; } movetask.immediate = 0; function thecallback(event) { if (event) post(" listen",event.eventname); if (event.eventname=="flatten"){ if (movecounter<12) MOVEIT.execute(); } } //end movem.js -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 Jul 9 22:02:14 2007 From: pnyboer at slambassador.com (pnyboer) Date: Mon Jul 9 22:02:17 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1ace2.468d51e4@www.cycling74.com> Message-ID: <1adf0.469304c3@www.cycling74.com> Can you stand another one? I hope so, cuz I seem to surfing the edges of Max scheduling, and not understanding it. This simple, but complete, patch and javascript are an attempt to read a folder of movies and output a sample frame from each, using a Task and JitterListener. The big mystery to me is why when I use the mov.matrixcalc() method in function thecallback(), it doesn't actually output a matrix. The simple example of "readit", when called from the outside does what I want to do, so I know I'm using the correct code to output a matrix from a jit.qt.movie in js. I presume it has to do with the asyncread, which the JitterListener seems to say is all finished, but it is apparently not, since the matrixcalc results in nothing! Is there a way to get this working?? Thanks, Peter. #P window setfont "Sans Serif" 9.; #P window linecount 3; #P comment 394 301 127 196617 for the sake of testing \, store up to 72 images for easy recall; #P window linecount 4; #P comment 389 86 127 196617 read \, rather than asyncread each movie in the folder \, and a frame is output after each read; #P window linecount 1; #P message 21 151 22 196617 set; #P window linecount 4; #P comment 141 94 139 196617 should output the 30th frame from each movie read....but it doesn't \, i guess becuase of the "asyncread"; #P comment 324 47 48 196617 bang out the last movie's matrix; #P window linecount 1; #P comment 185 254 38 196617 count:; #P number 218 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 185 235 35 196617 total:; #P number 218 234 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 422 230 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P message 422 254 82 196617 outputmatrix \$1; #P newex 343 253 72 196617 prepend index; #P user jit.pwindow 310 306 82 62 0 1 0 0 1 0; #P newex 311 231 27 196617 t l b; #N counter; #X flags 0 0; #P newobj 343 231 66 196617 counter; #P newex 371 210 21 196617 t 0; #P newex 311 281 158 196617 jit.matrixset 72 4 char 320 240; #P button 131 232 15 0; #P number 381 46 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P message 381 68 52 196617 readit \$1; #P button 309 46 15 0; #P newex 45 129 62 196617 prepend set; #P window linecount 0; #P message 45 150 244 196617; #P user jit.pwindow 46 232 82 62 0 1 0 0 1 0; #P window linecount 1; #P newex 131 173 91 196617 prepend drawtiles; #P newex 131 206 115 196617 js draw_tiles_async.js; #P comment 149 55 127 196617 drag a folder of clips here; #P user dropfile 131 36 298 90 1; #P fasten 18 0 17 0 427 249 427 249; #P connect 9 0 8 0; #P connect 12 0 13 2; #P connect 3 0 2 0; #P fasten 3 0 12 0 136 200 376 200; #P connect 13 0 16 0; #P connect 14 1 13 0; #P connect 11 0 15 0; #P connect 14 0 11 0; #P fasten 17 0 11 0 427 275 316 275; #P fasten 16 0 11 0 348 275 316 275; #P fasten 2 0 4 0 136 228 52 228; #P connect 2 0 10 0; #P fasten 2 0 14 0 136 226 316 226; #P hidden connect 2 2 21 0; #P fasten 2 1 19 0 188 224 223 224; #P fasten 7 0 2 0 314 194 136 194; #P fasten 8 0 2 0 386 197 136 197; #P fasten 5 0 3 0 50 170 136 170; #P fasten 0 0 6 0 136 109 50 109; #P connect 0 0 3 0; #P connect 6 0 5 0; #P connect 25 0 5 0; #P window clipboard copycount 28; //-----begin draw_tiles_async.js /* takes a folder of movies and tries to asynchronously grab "thumbnails" from each. However, even though the JitterListener reports a "read", it doesn't seem to be able to immediately output a matrix. */ autowatch = 1; outlets = 3; mov = new JitterObject("jit.qt.movie"); mov.autostart = 0; mov.adapt = 1; var movlisten = new JitterListener(mov.getregisteredname(), thecallback); var movepath; var counter = 0; var total = 0; var TASK_INTERVAL = 1; var DRAWIT = new Task(readtask,this); var clips = new Array(); var tmpmatrix = new JitterObject("jit.matrix"); function drawtiles(topath){ counter = 0; var g = new Folder(topath); g.typelist = ["MooV","mpg4","dvc!","MPEG","MPGa","MPGv","MPGx","SWFL","SWF","JPEG","GIF","GIFf","PNG","PNGf","8BPS","TIFF","TGA","PICT","SWF","BMPf","BMP","qtif","SGI","TPIC","PNTG","qdgx","PFix","PICS","MP3","MPG3","AIFF","WAVE","Mp3 ","????"]; total=g.count; outlet(1,total); if(g.count){ for (var i=0;i< g.count;i++) { g.next(); var thefile = g.pathname+"/"+g.filename; clips[i] = thefile; post("filling array: ",i,thefile," "); } g.close(); } movepath = topath; if (!DRAWIT.running){ DRAWIT.execute(); } } function readtask(){ mov.asyncread(clips[counter]); } readtask.immediate = 1; function thecallback(event) { if (event) post(" listen",event.eventname); if (event.eventname=="read"){ mov.frame(30); mov.matrixcalc(tmpmatrix,tmpmatrix); outlet(0,"jit_matrix",tmpmatrix.name); outlet(2,counter); counter++; if (counter At the beginning of my js code I have inlets=3; outlets=3; autowatch=1; The autowatch works, but the JSUI object still only shows 1 inlet and 1 outlet no matter what I do. Any thoughts? Rick From keithmanlove at gmail.com Sat Jul 14 23:37:50 2007 From: keithmanlove at gmail.com (keith manlove) Date: Sat Jul 14 23:37:53 2007 Subject: [javascript-dev] JSUI and inlets/outlets In-Reply-To: <1af46.4699b10c@www.cycling74.com> References: <1af46.4699b10c@www.cycling74.com> Message-ID: <64ab801a0707142237j4d7ea8fbvd56c04d409b1f43a@mail.gmail.com> I normally delete, then undo and it comes back with the right number with inlets/outlets. Assuming you've done everything right... that works. Keith On 7/15/07, Rick Burnett wrote: > > At the beginning of my js code I have > > inlets=3; > outlets=3; > autowatch=1; > > > The autowatch works, but the JSUI object still only shows 1 inlet and 1 outlet no matter what I do. > > Any thoughts? > > Rick > _______________________________________________ > javascript-dev mailing list > javascript-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/javascript-dev > From grimepoch at mac.com Sat Jul 14 23:48:03 2007 From: grimepoch at mac.com (Rick Burnett) Date: Sat Jul 14 23:48:04 2007 Subject: [javascript-dev] Re: JSUI and inlets/outlets In-Reply-To: <64ab801a0707142237j4d7ea8fbvd56c04d409b1f43a@mail.gmail.com> Message-ID: <1af48.4699b513@www.cycling74.com> Even stranger, I had to move the js file to the same location as the patch I was working on. Then I deleted and undid and it came back and WITH the correct ports. THANKS!!! :) Rick From c74-mailinglists at e--j.com Sun Jul 15 00:45:12 2007 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Sun Jul 15 00:45:37 2007 Subject: [javascript-dev] JSUI and inlets/outlets In-Reply-To: <64ab801a0707142237j4d7ea8fbvd56c04d409b1f43a@mail.gmail.com> References: <1af46.4699b10c@www.cycling74.com> <64ab801a0707142237j4d7ea8fbvd56c04d409b1f43a@mail.gmail.com> Message-ID: <67976185-DBF3-473A-9389-FA07BCCC65E8@e--j.com> On 15 juil. 07, at 07:37, keith manlove wrote: > I normally delete, then undo and it comes back with the right number > with inlets/outlets. Assuming you've done everything right... that > works. That's true. Changing the number of inlets/outlets requires the recreation of the object (the object can't just self-destruct an reinstantiate a new one). AFAIK inlets and outlets property are the only one which requires that, otherwise autowatch is just great. ej From grimepoch at mac.com Sun Jul 15 00:49:11 2007 From: grimepoch at mac.com (Rick Burnett) Date: Sun Jul 15 00:49:12 2007 Subject: [javascript-dev] Re: JSUI and inlets/outlets In-Reply-To: <67976185-DBF3-473A-9389-FA07BCCC65E8@e--j.com> Message-ID: <1af4a.4699c366@www.cycling74.com> I just discovered autowatch as well and YES it really helps :) From gusanomaxlist at googlemail.com Tue Jul 17 06:28:33 2007 From: gusanomaxlist at googlemail.com (gusanomaxlist) Date: Tue Jul 17 06:28:35 2007 Subject: [javascript-dev] get patcher name (again) Message-ID: <1aff1.469cb5ee@www.cycling74.com> Hi. 1st of all, sorry if this sounds very easy and stupid to you but these are my very first steps into JS. I'm trying to get a bpatcher scripting name from inside of it. I've searched on the javascript list and tried different scripts but can't get it working. Now I have a really simple js and I place it inside a named bpatcher and I only get when I ask for his scriptname. If someone could have a look at the following example... (I also have the js inside a patcher to compare) ____________________________________ getname.js function bang() { post(this.patcher.varname); } ____________________________________ testgetname.pat #P button 36 36 15 0; #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 36 68 54 9109513 js getname; #P connect 1 0 0 0; #P window clipboard copycount 2; ____________________________________ main patcher #P window setfont "Sans Serif" 9.; #P window linecount 1; #N vpatcher 39 284 188 448; #P button 36 58 15 0; #P window setfont "Sans Serif" 9.; #P newex 36 87 54 9109513 js getname; #P connect 1 0 0 0; #P pop; #P newobj 212 252 36 9109513 p none; #P objectname wow; #P bpatcher 105 93 100 100 0 0 testgetname.pat 1; #P objectname blah; #P window linecount 3; #P comment 257 252 100 9109513 this patcher is also named and it also doesn't work; #P window clipboard copycount 3; Thanx. From julien.rabin at gmail.com Tue Jul 17 07:02:47 2007 From: julien.rabin at gmail.com (jln) Date: Tue Jul 17 07:02:53 2007 Subject: [javascript-dev] get patcher name (again) In-Reply-To: <1aff1.469cb5ee@www.cycling74.com> References: <1aff1.469cb5ee@www.cycling74.com> Message-ID: <871C4632-08A5-462F-9CFA-079E6F9BA1A2@gmail.com> Le 17 juil. 07 ? 14:28, gusanomaxlist a ?crit : > > I'm trying to get a bpatcher scripting name from inside of it. I'm certainly not a js expert, but 'this.patcher.box.varname' should work. Best, Julien. From mattijs at smadsteck.nl Tue Jul 17 07:05:08 2007 From: mattijs at smadsteck.nl (Mattijs Kneppers) Date: Tue Jul 17 07:05:10 2007 Subject: [javascript-dev] Re: get patcher name (again) In-Reply-To: <1aff1.469cb5ee@www.cycling74.com> Message-ID: <1aff4.469cbe84@www.cycling74.com> That should be function bang() { post(this.patcher.box.varname); } Check it out in javascriptinmax.pdf, the varname property belongs to Maxobj, not to Patcher hth, Mattijs -- SmadSteck - http://www.smadsteck.nl Hard- and software for interactive audiovisual sampling From gusanomaxlist at googlemail.com Tue Jul 17 07:20:27 2007 From: gusanomaxlist at googlemail.com (gusanomaxlist) Date: Tue Jul 17 07:20:28 2007 Subject: [javascript-dev] Re: get patcher name (again) In-Reply-To: <1aff4.469cbe84@www.cycling74.com> Message-ID: <1aff5.469cc21a@www.cycling74.com> ach sooo ! I should sleep a little bit more before trying to understand this javascriptinmax.pdf :) Many thanx to both of you ! Cheers. From mattijs at smadsteck.nl Wed Jul 18 07:48:11 2007 From: mattijs at smadsteck.nl (Mattijs Kneppers) Date: Wed Jul 18 07:48:13 2007 Subject: [javascript-dev] Javascript function is not a function? Message-ID: <1b039.469e1a1b@www.cycling74.com> Does anyone know what this means? • error: js: (null): Javascript function is not a function, line 0 Mattijs -- SmadSteck - http://www.smadsteck.nl Hard- and software for interactive audiovisual sampling From grimepoch at mac.com Wed Jul 18 17:40:12 2007 From: grimepoch at mac.com (Rick Burnett) Date: Wed Jul 18 17:40:14 2007 Subject: [javascript-dev] Mouse position... Message-ID: <1b087.469ea4dc@www.cycling74.com> Is there anything I can call to get the mouse position regardless if it is inside the JSUI or not? I am using a metro and message to have some internal code poll something, but I need the XY relative to the JSUI. Thanks! From hoberman at bway.net Wed Jul 18 17:58:45 2007 From: hoberman at bway.net (Perry Hoberman) Date: Wed Jul 18 17:58:47 2007 Subject: [javascript-dev] Re: Mouse position... In-Reply-To: <1b087.469ea4dc@www.cycling74.com> Message-ID: <1b08b.469ea935@www.cycling74.com> the mousestate object in mode 1 gives you patcher coordinates... From grimepoch at mac.com Thu Jul 19 14:12:24 2007 From: grimepoch at mac.com (Rick Burnett) Date: Thu Jul 19 14:12:26 2007 Subject: [javascript-dev] Re: Mouse position... In-Reply-To: <1b087.469ea4dc@www.cycling74.com> Message-ID: <1b0c6.469fc5a8@www.cycling74.com> This worked perfectly, thank you! From grimepoch at mac.com Fri Jul 20 09:48:54 2007 From: grimepoch at mac.com (Rick Burnett) Date: Fri Jul 20 09:48:55 2007 Subject: [javascript-dev] Re: Javascript outlets, what am I missing? In-Reply-To: <1b10a.46a09498@www.cycling74.com> Message-ID: <1b127.46a0d965@www.cycling74.com> Sorry about posting it here, I didn't notice the JavaScript section initially. From jeremy at bootsquad.com Tue Jul 24 05:02:02 2007 From: jeremy at bootsquad.com (Jeremy Bernstein) Date: Tue Jul 24 05:02:30 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1adf0.469304c3@www.cycling74.com> References: <1adf0.469304c3@www.cycling74.com> Message-ID: Hi Peter Just got around to taking a look at this. It appears that, yes, there is a "sync" problem with asyncread and the JitterListener. I don't know precisely when this will get fixed, but it will get fixed. jb Am 10.07.2007 um 06:02 schrieb pnyboer: > > Is there a way to get this working?? From pnyboer at slambassador.com Tue Jul 24 21:56:39 2007 From: pnyboer at slambassador.com (pnyboer) Date: Tue Jul 24 21:56:41 2007 Subject: [javascript-dev] Re: Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: Message-ID: <1b240.46a6c9f6@www.cycling74.com> ok, thanks for the confirmation. i thought it was further evidence of not knowing what the hell I'm really doing! Looking forward to a fix! -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 Wed Jul 25 12:31:51 2007 From: pnyboer at slambassador.com (pnyboer) Date: Wed Jul 25 12:31:53 2007 Subject: [javascript-dev] Re: JitterListener and jit.qt.movie read...bug? In-Reply-To: <1ace2.468d51e4@www.cycling74.com> Message-ID: <1b27c.46a79714@www.cycling74.com> i'm not so sure it's just a javascript problem, as I encounter a similar difficulty with regular old max patching. This patch, when used with a library of DV clips, demonstrates that the "read" message from an asyncread isn't actually reported after the movie is "readable" by qt.movie. I would expect that, in this patch, asyncread and read would give similar results. #P window setfont "Sans Serif" 9.; #P window linecount 2; #P comment 267 368 187 196617 even with high values of delay \, async still doesn't cooperate; #P comment 191 143 187 196617 i can reproduce this problem best with DV movies on my MacBookPro 2.33.; #P number 233 370 35 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 197 372 32 196617 del 0; #B color 5; #P toggle 191 95 15 0; #P newex 182 219 27 196617 + 1; #P user jit.pwindow 103 73 82 62 0 1 0 0 1 0; #P newex 180 281 94 196617 prepend asyncread; #P newex 218 263 68 196617 prepend read; #P newex 182 241 47 196617 gate 2 1; #B color 5; #P window setfont Arial 9.; #P newex 100 202 69 131137545 prepend prefix; #P window setfont Arial 12.; #P user ubumenu 190 74 157 131137548 0 1 1 0; #X add "Clip 01_2024_699.dv"; #X add "Clip 01_2045_719.dv"; #X add "Clip 01_2057_948.dv"; #X add "Clip 01_2068_530.dv"; #X add "Clip 02_2017_643.dv"; #X add "Clip 02_2025_628.dv"; #X add "Clip 02_2026_469.dv"; #X add "Clip 02_2044_681.dv"; #X add "Clip 02_2050_904.dv"; #X add "Clip 02_2052_368.dv"; #X add "Clip 02_2064_182.dv"; #X add "Clip 02_2072_432.dv"; #X add "Clip 03_2018_99.dv"; #X add "Clip 03_2025_171.dv"; #X add "Clip 03_2035_426.dv"; #X add "Clip 03_2059_660.dv"; #X add "Clip 03_2067_639.dv"; #X add "Clip 03_2071_350.dv"; #X add "Clip 04_2017_18.dv"; #X add "Clip 04_2019_222.dv"; #X add "Clip 04_2021_545.dv"; #X add "Clip 04_2022_523.dv"; #X add "Clip 04_2024_622.dv"; #X add "Clip 04_2027_423.dv"; #X add "Clip 04_2032_762.dv"; #X add "Clip 04_2039_979.dv"; #X add "Clip 04_2040_444.dv"; #X add "Clip 04_2041_780.dv"; #X add "Clip 04_2044_794.dv"; #X add "Clip 04_2048_874.dv"; #X add "Clip 04_2052_456.dv"; #X add "Clip 04_2053_614.dv"; #X add "Clip 04_2054_276.dv"; #X add "Clip 04_2055_793.dv"; #X add "Clip 04_2057_648.dv"; #X add "Clip 04_2061_255.dv"; #X add "Clip 04_2063_964.dv"; #X add "Clip 04_2064_960.dv"; #X add "Clip 04_2066_170.dv"; #X types MooV "JPG " JPEG TIFF MooV "JPG " JPEG TIFF; #X prefix_set 0 1 "LosMochis:/Analog synth/Edits01/" 0; #X pattrmode 1; #P window setfont "Sans Serif" 9.; #P newex 197 349 23 196617 t b; #B color 5; #P message 197 395 79 196617 frame 35 \, bang; #P newex 197 326 57 196617 route read; #B color 5; #P newex 180 305 201 196617 jit.qt.movie 320 240 @autostart 0 @vol 0; #B color 5; #P comment 206 96 142 196617 async (0) or regular (1) read; #P window linecount 2; #P comment 189 114 187 196617 aync doesn't consistently produce an image in the pwindow \, but regular does; #P user dropfile 100 63 419 197 1; #P hidden connect 7 1 9 1; #P connect 9 1 10 0; #P connect 15 0 5 0; #P connect 6 0 15 0; #P connect 16 0 15 0; #P connect 4 0 6 0; #P fasten 3 1 4 0 376 324 202 324; #P hidden connect 8 0 7 0; #P connect 13 0 9 0; #P hidden connect 14 0 13 0; #P connect 5 0 3 0; #P connect 11 0 3 0; #P connect 10 0 3 0; #P connect 9 0 11 0; #P fasten 3 0 12 0 185 388 83 388 83 68 109 68; #P connect 0 0 8 0; #P window clipboard copycount 19; -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 hoberman at bway.net Thu Jul 26 19:27:51 2007 From: hoberman at bway.net (Perry Hoberman) Date: Thu Jul 26 19:27:53 2007 Subject: [javascript-dev] any way to get all the values of a jit.matrix from a js? Message-ID: <1b314.46a94a17@www.cycling74.com> Hi - I may be missing something obvious, but... I want to output all the cell values of a small javascript-instantiated jit.matrix, all at once as a list of numbers or an array. Is there any way to do this in one step, or do I have use getcell() to get the values one at a time to assemble an array first? IE, is there a method like getcell() but for multiple cells? - pH From cyrilbiz at yahoo.com Fri Jul 27 14:50:45 2007 From: cyrilbiz at yahoo.com (tirilo) Date: Fri Jul 27 14:50:46 2007 Subject: [javascript-dev] access to ftm objects from javascript? Message-ID: <1b365.46aa5aa4@www.cycling74.com> Hi, on http://ftm.ircam.fr/index.php/A_brief_introduction_to_FTM it is stated that: "FTM objects can also be created, accessed and manipulated in the Max/MSP JavaScript externals js and jsui" I have not found documentation about this feature. Can anyone point me to one or have any tips as for instance how to access and modify an fmat from a js object? So far I have been issuing messages from js outlets to control ftm objects through patch lines which is somewhat cumbersome but this is the best I have found so far. thanks! From gusanomaxlist at googlemail.com Sat Jul 28 13:32:11 2007 From: gusanomaxlist at googlemail.com (gusanomaxlist) Date: Sat Jul 28 13:32:18 2007 Subject: [javascript-dev] Bpatcher resizing Message-ID: <1b397.46ab99ba@www.cycling74.com> Hi ! I'm trying to resize a Bpatcher with "this.patcher.box.rect", but I can't find how to add/substract a value to one of the existing coordinates (here to the vertical right one). I have a toggle going in a message [size $1] going in js object. Here is the code (please, forgive my javascript newbieness) : --------------------------------------- function size(x) { r = this.patcher.box.rect; if (x > 0) r[3] = (r[3] + 100); else r[3] = (r[3] - 100); } --------------------------------------- Thanx for your advices. From gusanomaxlist at googlemail.com Mon Jul 30 06:27:41 2007 From: gusanomaxlist at googlemail.com (gusanomaxlist) Date: Mon Jul 30 06:27:43 2007 Subject: [javascript-dev] Re: Bpatcher resizing In-Reply-To: <1b397.46ab99ba@www.cycling74.com> Message-ID: <1b3ef.46add93b@www.cycling74.com> ah, stupid me, I found the answer in the cycling74 stories: http://www.cycling74.com/story/2006/4/14/145031/478 sorry again for this.