From apalomba at austin.rr.com Fri Jan 4 15:34:30 2008 From: apalomba at austin.rr.com (Anthony Palomba) Date: Fri Jan 4 15:34:35 2008 Subject: [java-dev] Re: Re: Re: Re: Processing in mxj In-Reply-To: <19d27.46572a1d@www.cycling74.com> Message-ID: <1e9f2.477eb475@www.cycling74.com> I know this is an old thread but I am interested in loading processing.org pde files in Jitter using [mxj]. Did anyone figure out how to do this? The java source posted on this thread does not seem to specify how a .pde file would be loaded and displayed. Does anyone have an example they can post? From jbmaxwell at rubato-music.com Fri Jan 4 15:50:54 2008 From: jbmaxwell at rubato-music.com (jbmaxwell) Date: Fri Jan 4 15:50:56 2008 Subject: [java-dev] Re: Re: Re: Re: Processing in mxj In-Reply-To: <1e9f2.477eb475@www.cycling74.com> Message-ID: <1e9f4.477eb84d@www.cycling74.com> Quote: Anthony Palomba wrote on Fri, 04 January 2008 22:34 ---------------------------------------------------- > I know this is an old thread but I am interested in loading > processing.org pde files in Jitter using [mxj]. > Did anyone figure out how to do this? The java source posted on > this thread does not seem to specify how a .pde file would be > loaded and displayed. Does anyone have an example they can post? > ---------------------------------------------------- I don't imagine you could ever load a .pde file (that's the native Processing file, right?) in mxj. But if you run Processing in "java mode", then you can build what is pretty much a generic java applet, and _that_ can be made to work with mxj. I can't remember exactly how I was doing it (I'm just using OSC now to communicate between my applet and Max), but it seems to me it was just a matter of making a kind of wrapper mxj which opened a window and embedded the PApplet in that window. I doubt that helps much, but perhaps a little... J. From bart at bartwoodstrup.com Sat Jan 5 15:39:44 2008 From: bart at bartwoodstrup.com (bart woodstrup) Date: Sat Jan 5 15:39:48 2008 Subject: [java-dev] error: connect: outlet 2 of mxj out of range Message-ID: Hi, It's been a few months since I've been under the hood of this patch - please forgive me if my terminology is a bit rusty. I have one of Tim Bitson's (http://www.timbitson.com/Weather_Projects.html) weather stations sending data into max through java/mxj. If I can get the class/object to load properly, it works great. Here's the problem: 1. Plug in the USB weather station 2. Boot up the computer (Mac PPC 10.4.11) 3. Open the "weather" patch in max (4.6.3) 4. The patch opens but shows these errors: error: connect: outlet 2 of mxj out of range error: connect: outlet 3 of mxj out of range error: connect: outlet 4 of mxj out of range error: connect: outlet 5 of mxj out of range error: connect: outlet 6 of mxj out of range... Also, I need to send "start" and "stop" messages to the mxj object in order to start/stop the polling of the sensors. when I click the message box I get this error: error: simpleWeather.SimpleWeather doesn't understand start 5. Here's the trick... I close max and delete simpleWeather.SimpleWeather.jar in the classes folder. 6. I rebuild the .jar in netbeans and then place it in the classes folder. 7. I open Max and make a new MXJ object and (beach ball for 2 seconds) then the object loads perfectly. I close this patch w/o saving. 8. Open the "weather" patch in Max and now it works. 8. ??? 9. I'm happy that I can get it to work, but this piece needs to be installed in a gallery in a few months and I can't expect the gallery staff to hack my max patch... It's probably a simple oversight on my part as I am only an accomplished Java hacker and not a programmer. It seems to me that it is a problem relating to how I am declaring my outlets, or how the "extends MaxObject implements Runnable" get initiated. However, that wouldn't explain why it works fine after a rebuild and replaced in the classes folder. I'm not sure what to send along, but have attached the .jar and will paste the max patch below. As always I deeply appreciate any/all help with this - hopefully it's something simple and obvious (usually is). Note: if I try to open a new patch and make a new mxj object (w/o rebuilding the .jar) and type in the class simpleWeather.SimpleWeather - it crashes Max. THANKS! Bart #P window setfont "Sans Serif" 9.; #P window linecount 1; #P message 161 60 29 196617 stop; #P message 117 61 33 196617 start; #P toggle 34 24 15 0; #P newex 34 44 64 196617 metro 5000; #P number 190 260 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 244 371 62 196617 prepend set; #P flonum 351 203 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 386 205 100 196617 Solar; #P flonum 316 167 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 351 169 100 196617 Lightning; #P flonum 268 125 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 303 127 100 196617 Rain (inches?); #P window setfont "Sans Serif" 14.; #P message 246 403 107 196622 ENE; #P window setfont "Sans Serif" 9.; #P message 576 324 30 196617 NNW; #P message 473 324 22 196617 NW; #P message 500 324 16 196617 W; #P message 420 411 32 196617 WSW; #P message 424 324 22 196617 SW; #P message 272 324 19 196617 SE; #P message 196 324 14 196617 E; #P message 158 324 24 196617 ENE; #P message 310 324 25 196617 SSE; #P message 386 324 30 196617 SSW; #P message 348 324 14 196617 S; #P message 234 324 24 196617 ESE; #P message 120 324 19 196617 NE; #P message 82 324 25 196617 NNE; #P message 44 324 14 196617 N; #P newex 179 289 431 196617 sel 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14; #P flonum 173 229 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 208 231 100 196617 windspeed MPH; #P flonum 127 186 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 162 188 100 196617 dewpoint degrees F; #P flonum 82 153 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 117 155 100 196617 humidity%; #P flonum 35 124 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P button 35 67 15 0; #P newex 35 92 379 196617 mxj simpleWeather.SimpleWeather; #P comment 70 126 120 196617 temperature degrees F; #P connect 10 12 23 0; #P connect 10 11 24 0; #P connect 10 10 21 0; #P connect 10 9 16 0; #P connect 1 7 32 0; #P connect 10 8 15 0; #P connect 1 6 30 0; #P connect 10 7 17 0; #P connect 10 6 20 0; #P connect 1 5 28 0; #P connect 33 0 26 0; #P connect 11 0 33 0; #P connect 12 0 33 0; #P connect 13 0 33 0; #P connect 18 0 33 0; #P connect 19 0 33 0; #P connect 14 0 33 0; #P connect 20 0 33 0; #P connect 17 0 33 0; #P connect 15 0 33 0; #P connect 16 0 33 0; #P connect 21 0 33 0; #P connect 22 0 33 0; #P connect 23 0 33 0; #P connect 24 0 33 0; #P connect 25 0 33 0; #P connect 10 5 14 0; #P connect 10 4 19 0; #P connect 1 4 34 0; #P connect 34 0 10 0; #P connect 1 3 9 0; #P connect 10 3 18 0; #P connect 1 2 7 0; #P connect 10 2 13 0; #P connect 10 1 12 0; #P connect 1 1 5 0; #P connect 10 0 11 0; #P connect 1 0 3 0; #P connect 2 0 1 0; #P connect 37 0 1 0; #P connect 38 0 1 0; #P connect 35 0 2 0; #P connect 36 0 35 0; #P window clipboard copycount 39; -------------- next part -------------- A non-text attachment was scrubbed... Name: simpleWeather.jar Type: application/octet-stream Size: 19871 bytes Desc: not available Url : http://www.cycling74.com/pipermail/java-dev/attachments/20080105/fe89946e/simpleWeather.obj From jbmaxwell at rubato-music.com Sun Jan 6 14:29:56 2008 From: jbmaxwell at rubato-music.com (jbmaxwell) Date: Sun Jan 6 14:29:58 2008 Subject: [java-dev] find a non-serializable class/object Message-ID: <1eaa5.47814852@www.cycling74.com> I'm wondering if there's any way of tracking down the specific object that's causing a NotSerializableException? I have a fairly complex object that I'm trying to write to disk, and I keep getting this exception. I've checked all of my class files, and they all implement Serializable. If I could at least find out which object is failing, maybe I could figure out what's wrong. Any thoughts appreciated. thanks, J. From owen at owengreen.net Sun Jan 6 14:36:56 2008 From: owen at owengreen.net (Owen Green) Date: Sun Jan 6 14:54:08 2008 Subject: [java-dev] find a non-serializable class/object In-Reply-To: <1eaa5.47814852@www.cycling74.com> References: <1eaa5.47814852@www.cycling74.com> Message-ID: <478149F8.6040606@owengreen.net> Doesn't it say in the stack trace? -- O jbmaxwell wrote: > I'm wondering if there's any way of tracking down the specific object > that's causing a NotSerializableException? I have a fairly complex > object that I'm trying to write to disk, and I keep getting this > exception. I've checked all of my class files, and they all implement > Serializable. If I could at least find out which object is failing, > maybe I could figure out what's wrong. > > Any thoughts appreciated. > > thanks, > > J. _______________________________________________ java-dev mailing > list java-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/java-dev > From jbmaxwell at rubato-music.com Sun Jan 6 15:01:24 2008 From: jbmaxwell at rubato-music.com (jbmaxwell) Date: Sun Jan 6 15:01:26 2008 Subject: [java-dev] Re: find a non-serializable class/object In-Reply-To: <478149F8.6040606@owengreen.net> Message-ID: <1eaa8.47814fb4@www.cycling74.com> No. All it shows in the trace, before it hits my "save" method is: java.io.NotSerializableException: java.lang.Object at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) ...which doesn't do me much good. J. Quote: owen wrote on Sun, 06 January 2008 21:36 ---------------------------------------------------- > Doesn't it say in the stack trace? > > -- > O > > jbmaxwell wrote: > > I'm wondering if there's any way of tracking down the specific object > > that's causing a NotSerializableException? I have a fairly complex > > object that I'm trying to write to disk, and I keep getting this > > exception. I've checked all of my class files, and they all implement > > Serializable. If I could at least find out which object is failing, > > maybe I could figure out what's wrong. > > > > Any thoughts appreciated. > > > > thanks, > > > > J. _______________________________________________ java-dev mailing > > > > > ---------------------------------------------------- From jbmaxwell at rubato-music.com Mon Jan 7 13:26:17 2008 From: jbmaxwell at rubato-music.com (jbmaxwell) Date: Mon Jan 7 13:26:19 2008 Subject: [java-dev] Piccolo? Message-ID: <1eb09.47828ae8@www.cycling74.com> Just curious: has anybody here used Piccolo in mxj? http://www.cs.umd.edu/hcil/piccolo/index.shtml I've been working with Processing, but it gets to be quite a cpu hog, once things get a little busier - especially at higher resolutions. Piccolo looks like it might be more appropriate for what I'm doing, so I'm curious to know whether anybody has any experience with it. I've been trying to port my Processing-based interface over to Cocoa, which has been a steeeeeep learning curve, and I'm sure a port to Piccolo would be _much_ easier (remain in java, not obj-C). cheers, J. From bart at bartwoodstrup.com Mon Jan 7 13:54:16 2008 From: bart at bartwoodstrup.com (vodstrup) Date: Mon Jan 7 13:54:18 2008 Subject: [java-dev] Re: error: connect: outlet 2 of mxj out of range In-Reply-To: Message-ID: <1eb0f.47829178@www.cycling74.com> Update: I was able to get this to work. When the mxj would load w/o the outlets, I put a viewsource message into it and noticed that it was seeing the very first script I authored with that name. This is strange because this class didn't exist in the classpath - hadn't for a long time. In fact, I have no idea where this class was located. I deleted everything relating to this: the patch, the classes, the Java code... I then started from scratch (rebuilt the Java, imported the .jar into the classpath, etc.) and now it appears to be working quite well. Anyone know where that old script was lingering? Since it wasn't in my classpath, how could the mxj see it? and why, after putting in a new class, did max still want to load the old one? Is there a possibility that my classpath is pointing to somewhere in addition to the classes folder? bbw From garton at columbia.edu Tue Jan 8 12:21:56 2008 From: garton at columbia.edu (garton@columbia.edu) Date: Tue Jan 8 12:21:58 2008 Subject: [java-dev] java version question Message-ID: <20080108142156.17crzhklk4ggokw4@cubmail.cc.columbia.edu> Have java-dev folks -- I've finished up a fun new mxj thing (maxlispj!), and a number of people were kind enough to test it out. I ran into one problem + a solution: I hadn't realized that mxj depended on the host machine's jvm. I created my first jar using java v. 1.5, but anyone still running 1.4.x would get a major.minor version number error when trying to load my classes. I can compile my classes and make the jar using 1.4, so all is ok. My question, though -- should I make both a 1.4 and a 1.5 version available, or just distribute the 1.4-compiled version? Obviously I'm not using any 1.5-specific features, but are there any other advantages to using a 1.5-compiled version? brad http://music.columbia.edu/~brad From c74-mailinglists at e--j.com Tue Jan 8 12:40:55 2008 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Tue Jan 8 12:41:04 2008 Subject: [java-dev] java version question In-Reply-To: <20080108142156.17crzhklk4ggokw4@cubmail.cc.columbia.edu> References: <20080108142156.17crzhklk4ggokw4@cubmail.cc.columbia.edu> Message-ID: <3809AAF5-4AD9-4610-AF22-F3AB7A17C4FA@e--j.com> On 8 janv. 08, at 20:21, garton@columbia.edu wrote: > I've finished up a fun new mxj thing (maxlispj!), and a number of > people were kind enough to test it out. I ran into one problem + a > solution: I hadn't realized that mxj depended on the host machine's > jvm. I created my first jar using java v. 1.5, but anyone still > running 1.4.x would get a major.minor version number error when > trying to load my classes. I can compile my classes and make the > jar using 1.4, so all is ok. I'm not a java expert, but ejies java externals are compiled with java 1.4 and run fine with java 1.5. ej From nick at cassiel.com Tue Jan 8 16:05:06 2008 From: nick at cassiel.com (Nick Rothwell) Date: Tue Jan 8 16:05:04 2008 Subject: [java-dev] java version question In-Reply-To: <20080108142156.17crzhklk4ggokw4@cubmail.cc.columbia.edu> References: <20080108142156.17crzhklk4ggokw4@cubmail.cc.columbia.edu> Message-ID: <3FFE0555-DFDC-4D89-BE4B-98995E65BE29@cassiel.com> > My question, though -- should I make both a 1.4 and a 1.5 version > available, or just distribute the 1.4-compiled version? Obviously > I'm not using any 1.5-specific features, but are there any other > advantages to using a 1.5-compiled version? Java 1.5 is pretty universal these days (now that OS X has caught up) so everything I'm doing targets 1.5, and uses 1.5 libraries and language features. As Emmanuel says, the JVM is backwards compatible regarding bytecode format, so 1.4 code will run on a 1.5 JVM, and if you're happy sticking with 1.4 there shouldn't be any problems. (If you decide to generate 1.4 code with a 1.5 JDK to target 1.4 systems, you might want to make sure you aren't relying on 1.5-specific bits of the API.) -- N. nick rothwell -- composition, systems, performance -- http:// www.cassiel.com From garton at columbia.edu Tue Jan 8 16:16:22 2008 From: garton at columbia.edu (Brad Garton) Date: Tue Jan 8 16:16:34 2008 Subject: [java-dev] java version question In-Reply-To: <3FFE0555-DFDC-4D89-BE4B-98995E65BE29@cassiel.com> References: <20080108142156.17crzhklk4ggokw4@cubmail.cc.columbia.edu> <3FFE0555-DFDC-4D89-BE4B-98995E65BE29@cassiel.com> Message-ID: On Jan 8, 2008, at 6:05 PM, Nick Rothwell wrote: > As Emmanuel says, the JVM is backwards compatible regarding > bytecode format, so 1.4 code will run on a 1.5 JVM, and if you're > happy sticking with 1.4 there shouldn't be any problems. (If you > decide to generate 1.4 code with a 1.5 JDK to target 1.4 systems, > you might want to make sure you aren't relying on 1.5-specific bits > of the API.) So there's no performance hit or anything? I figured it was probably fine (and I probably will go with 1.4 for now), but wanted to see if there were any reasons not to do it. thanks! brad http://music.columbia.edu/~brad -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cycling74.com/pipermail/java-dev/attachments/20080108/368a11ad/attachment.htm From owen at owengreen.net Wed Jan 9 12:48:19 2008 From: owen at owengreen.net (Owen Green) Date: Wed Jan 9 13:01:03 2008 Subject: [java-dev] Re: find a non-serializable class/object In-Reply-To: <1eaa8.47814fb4@www.cycling74.com> References: <1eaa8.47814fb4@www.cycling74.com> Message-ID: <47852503.7090206@owengreen.net> > java.io.NotSerializableException: java.lang.Object Suggests that it's choking on trying to serialize an instance of java.lang.Object. This seems unlikely, but it's possible that a class somewhere in your object graph has a field declared as Object. This could include built-in classes (like implementations of Reference, for example). If you can find it, you could either skip serializing it, by also declaring it transient, or work out way of serializing the thing. Eclipse, or similar, should make it much easier to find the culprit, if you're not already using it. -- O jbmaxwell wrote: > No. All it shows in the trace, before it hits my "save" method is: > > java.io.NotSerializableException: java.lang.Object > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081) > at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375) > at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347) > at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) > > ...which doesn't do me much good. > > J. > > > From jbmaxwell at rubato-music.com Wed Jan 9 13:10:42 2008 From: jbmaxwell at rubato-music.com (jbmaxwell) Date: Wed Jan 9 13:10:55 2008 Subject: [java-dev] Re: Re: find a non-serializable class/object In-Reply-To: <47852503.7090206@owengreen.net> Message-ID: <1ebe0.47852a41@www.cycling74.com> Cheers, Owen. Yes, I'm using Eclipse already. I'll look for a generic Object. I'm not sure where that would be, but I do have some vague recollection that I might have used an ArrayList to handle some subclassed objects... Not sure. Maybe that's where it's choking. I'll look into it. I read somewhere that serialization is not great for persistence. But that's about all I've been using, so far. Any particular approaches I should read up on? What do you tend to use? thanks again. J. Quote: owen wrote on Wed, 09 January 2008 19:48 ---------------------------------------------------- > > > java.io.NotSerializableException: java.lang.Object > > Suggests that it's choking on trying to serialize an instance of > java.lang.Object. This seems unlikely, but it's possible that a class > somewhere in your object graph has a field declared as Object. > > This could include built-in classes (like implementations of Reference, > for example). If you can find it, you could either skip serializing it, > by also declaring it transient, or work out way of serializing the thing. > > Eclipse, or similar, should make it much easier to find the culprit, if > you're not already using it. > > -- > O > > jbmaxwell wrote: > > No. All it shows in the trace, before it hits my "save" method is: > > > > java.io.NotSerializableException: java.lang.Object > > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081) > > at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375) > > at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347) > > at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290) > > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079) > > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) > > > > ...which doesn't do me much good. > > > > J. > > > > > > > > ---------------------------------------------------- From pcastine at gmx.net Wed Jan 9 14:38:38 2008 From: pcastine at gmx.net (Peter Castine) Date: Wed Jan 9 14:38:45 2008 Subject: [java-dev] Arbitrary binary data with TcpSender? Message-ID: <1ebed.47853ede@www.cycling74.com> I need to build an object that can send arbitrary binary data via TCP. I was hoping to use mxj, in particular com.cycling74.net.TcpSender for this purpose. But on closer examination, TcpSender only seems to grok standard Max data types.-( I need to send largish (2-4kB) data structures of binary data to custom hardware, and the data simply does not parse into Atoms. Ideally I would like to simply pass a byte[] to a TcpSender, which does everything else I need quite handily. Is this possible? (Preparing the stream of bytes is not the problem, at least not yet!) Thanks -- P -- Peter Castine -- Peter is in dire need of a new Facebook tagline. Not to mention a new .sig From topher at topher.com Wed Jan 9 14:52:31 2008 From: topher at topher.com (topher lafata) Date: Wed Jan 9 14:52:51 2008 Subject: [java-dev] Arbitrary binary data with TcpSender? In-Reply-To: <1ebed.47853ede@www.cycling74.com> References: <1ebed.47853ede@www.cycling74.com> Message-ID: <4785421F.8070405@topher.com> Why don't you encode your byte array into a hex string and send that? Its pretty straightforward. T Peter Castine wrote: > I need to build an object that can send arbitrary binary data via TCP. I was hoping to use mxj, in particular com.cycling74.net.TcpSender for this purpose. But on closer examination, TcpSender only seems to grok standard Max data types.-( > > I need to send largish (2-4kB) data structures of binary data to custom hardware, and the data simply does not parse into Atoms. Ideally I would like to simply pass a byte[] to a TcpSender, which does everything else I need quite handily. Is this possible? (Preparing the stream of bytes is not the problem, at least not yet!) > > Thanks -- P > > > -- > Peter Castine > -- > Peter is in dire need of a new Facebook tagline. Not to mention a new .sig > _______________________________________________ > java-dev mailing list > java-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/java-dev > > From nick at cassiel.com Wed Jan 9 15:06:23 2008 From: nick at cassiel.com (Nick Rothwell) Date: Wed Jan 9 15:06:28 2008 Subject: [java-dev] Arbitrary binary data with TcpSender? In-Reply-To: <1ebed.47853ede@www.cycling74.com> References: <1ebed.47853ede@www.cycling74.com> Message-ID: <26BACC02-1D05-4B0E-9D40-5ACEC3D43CAE@cassiel.com> If you want to send arbitrary binary data over TCP, then you're basically working at the level that the Java API provides (the stuff in java.net.* specifically). I don't see why you'd want to link against the com.cycling74 classes. (TcpSender seems to be a wrapper around Socket anyway, with some sanitisation for Atoms and InetAddresses.) -- N. Nick Rothwell / Cassiel.com Limited www.cassiel.com www.myspace.com/cassieldotcom www.last.fm/music/cassiel www.reverbnation.com/cassiel www.linkedin.com/in/cassiel www.loadbang.net From pcastine at gmx.net Wed Jan 9 15:59:09 2008 From: pcastine at gmx.net (Peter Castine) Date: Wed Jan 9 15:59:12 2008 Subject: [java-dev] Re: Arbitrary binary data with TcpSender? In-Reply-To: <26BACC02-1D05-4B0E-9D40-5ACEC3D43CAE@cassiel.com> Message-ID: <1ec08.478551bd@www.cycling74.com> Thanks to both Topher and Nick. In the mean time I've been looking at java.net.Socket, but that's also meant importing add'l packages to catch exceptions and other fun stuff. It looks like I need java.net.*, java.lang.*, and java.io.* as well as the Cycling74 packages. I'm sure it'll all seem easy once I've figured it out, but a lot of this is new ground for me. Given the size of the data (I misspoke previously, it's more like 7-8kB), I was a little unsure of the binary string approach. I was thinking (probably incorrectly) that if I were to do something like TcpSender.send(String s, Atom[] a), the contents of the String would have to go into the Max symbol table (the signature _looks_ like a Max message starting with a symbol). But if the Max symbol table doesn't need to know about what data is being used inside an mxj object, than that isn't a problem. I'll try to get the coding finished tomorrow and can show some code if I'm still stuck. Thanks again. -- P -- Peter Castine -- Peter is in dire need of a new Facebook tagline. Not to mention a new .sig From nick at cassiel.com Thu Jan 10 03:11:24 2008 From: nick at cassiel.com (Nick Rothwell) Date: Thu Jan 10 03:11:26 2008 Subject: [java-dev] Re: Arbitrary binary data with TcpSender? In-Reply-To: <1ec08.478551bd@www.cycling74.com> References: <1ec08.478551bd@www.cycling74.com> Message-ID: <2136C504-BF94-4BD5-992C-9FE3AC600180@cassiel.com> > In the mean time I've been looking at java.net.Socket, but that's > also meant importing add'l packages to catch exceptions and other > fun stuff. It looks like I need java.net.*, java.lang.*, and > java.io.* as well as the Cycling74 packages. java.lang.* you get for free; but anyway, if you're using Eclipse, at least, management of import statements is one key shortcut away. Yes, you have to deal with exceptions (or just let the MXJ instance's entry points propagate the exceptions); it's just one of the ways in which Java sometimes requires a bit (or a lot) of boilerplate. > I was thinking (probably incorrectly) that if I were to do > something like TcpSender.send(String s, Atom[] a), the contents of > the String would have to go into the Max symbol table I would guess, by analogy with the C/C++ API, that Atom.newAtom (String) would hash the string into a symbol. But otherwise, if you're just in the Java world, Max won't see it: just you, me and the Sheriff will know about it. -- N. nick rothwell -- composition, systems, performance -- http:// www.cassiel.com From jmail at nospaces.net Thu Jan 10 10:03:11 2008 From: jmail at nospaces.net (Jonny) Date: Thu Jan 10 10:03:13 2008 Subject: [java-dev] Re: rendering HTML in Jitter In-Reply-To: <1e504.4767cc7e@www.cycling74.com> Message-ID: <1ec45.47864fce@www.cycling74.com> I've got it working well for me now but with a couple of issues i was wondering if you had come across. I seem to be getting crashes when quitting if my html objects (on jit.gl.videoplanes flying about in 3D). I noticed there was no notifyDelete() function - i've added one but i'm not sure i'm releasing everything properly - routine below) The other problem i have is that most websites now use UTF-8 encoding, but this only seems to handle LATIN-1 (ISO 8859-1) properly - have you come across a way of using different text encodings? Or do i have to convert everything? Thanks for the great start though, i'll probably work these things out eventually & will post back here if i do. jonny //--------------------------------- public void notifyDeleted() { if (bi != null) { bi.flush(); } if (rendererContext != null) { rendererContext.close(); } if (htmlPanel != null) { htmlPanel.removeAll(); } } //--------------------------------- From jmail at nospaces.net Thu Jan 10 14:16:45 2008 From: jmail at nospaces.net (Jonny) Date: Thu Jan 10 14:16:58 2008 Subject: [java-dev] Re: rendering HTML in Jitter In-Reply-To: <1ec45.47864fce@www.cycling74.com> Message-ID: <1ec57.47868b3c@www.cycling74.com> Fixed the encoding (the hard way, i think) My version of getDocumentFromUrl follows. //--------------------------------------- private void getDocumentFromUrl(String uri) throws Exception { URL url = new URL(uri); URLConnection connection = url.openConnection(); InputStream in = connection.getInputStream(); // A Reader should be created with the correct charset, // which may be obtained from the Content-Type header // of an HTTP response. Reader reader; String encoding = connection.getContentEncoding(); if (encoding == null) { // take a peek in the file then byte[] buff = new byte[512]; int rc = in.read(buff); if (rc > 0) { // fish out charset from meta tag String s = new String(buff); Pattern p = Pattern.compile("", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.MULTILINE | Pattern.DOTALL); Matcher m = p.matcher(s); if (m.find()) { if (m.groupCount() > 1) { encoding = m.group(1); } } } if (encoding == null) { // no idea? encoding = "UTF-8"; } } reader = new InputStreamReader(in, encoding); // InputSourceImpl constructor with URI recommended // so the renderer can resolve page component URLs. InputSource is = new InputSourceImpl(reader, uri); // This example does not perform incremental rendering. document = builder.parse(is); in.close(); } From paredesespic at gmail.com Thu Jan 10 16:31:51 2008 From: paredesespic at gmail.com (Don Pellito) Date: Thu Jan 10 16:31:53 2008 Subject: [java-dev] Run an Executable File on Max Message-ID: <1ec68.4786aae7@www.cycling74.com> I've been trying to run an executable file on max with no success. Can anybody help me? I've been reading bout the mxj object but i don't know anything about java. I've read some post on this forum but they don't give any much information. Thanks'. CMOOONN!! help. From jmail at nospaces.net Sun Jan 13 13:54:43 2008 From: jmail at nospaces.net (Jonny) Date: Sun Jan 13 13:54:45 2008 Subject: [java-dev] Re: rendering HTML in Jitter In-Reply-To: <1ec57.47868b3c@www.cycling74.com> Message-ID: <1ed45.478a7a93@www.cycling74.com> Another (essential) tweak... I found the memory leak - at the end of outputImage() you need j.freePeer(); Not sure why this works, but it does - this gets called on every scroll tick so gets through memory quite quickly (kaboom!) jb (i better send you my updated version - will try...) From office at maklott.com Tue Jan 15 01:25:04 2008 From: office at maklott.com (oliver) Date: Tue Jan 15 01:25:05 2008 Subject: [java-dev] Re: Jitter / Java Class fills up my Memory till my machine nearly freezes and Max crashes ... In-Reply-To: <1e7bd.47758a22@www.cycling74.com> Message-ID: <1edbe.478c6dde@www.cycling74.com> pity ... no one had an answer ... :/ ... so i had to lear a little bit c ... well ... here's what my "problem" became ... well .. ok ... planetype char works fine ... with the other types i did something wrong ... and it's good to use ONLY 2 dimensions [width height] ... probably it works with other dims too, but if it does, i'm sure it doesn't do it right ... well :) this mxo was compiled on a ppc g4 with gcc ... so ... i don't know if its an universal binary ... i think not ... ... oh, i forgot : 'exciter_amount' ... don't use it with values higher than 0.2 (NEVER above 1) ... well ... see for yourself ... and if you want to see something hit 'calculate_exciter' (for every calculation / frame) ... or trigger it by metro .. or whatever ... ;-) enjoy, yours oliver :-D -- + DON'T HATE ME JUST BECAUSE I'M + BEAUTIFUL_________________________/ -------------- next part -------------- A non-text attachment was scrubbed... Name: phi.jitwripple_src.zip Type: application/zip Size: 26707 bytes Desc: not available Url : http://www.cycling74.com/pipermail/java-dev/attachments/20080115/a2473fd8/phi.jitwripple_src.zip From nick at cassiel.com Tue Jan 15 11:08:06 2008 From: nick at cassiel.com (Nick Rothwell) Date: Tue Jan 15 11:08:16 2008 Subject: [java-dev] outlet vs. outletHigh overloading Message-ID: <38B0863E-F8E0-4861-84AB-A34A4D43903C@cassiel.com> MaxObject.outlet() is overloaded with int*Atom and int*atom[], where the latter calls the former for an Atom array of length 1. MaxObject.outletHigh() doesn't have the int*Atom overloading. As a side-effect, it also seems to generate lists of length 1, since it doesn't do the same delegation as outlet(). -- N. Nick Rothwell / Cassiel.com Limited www.cassiel.com www.myspace.com/cassieldotcom www.last.fm/music/cassiel www.reverbnation.com/cassiel www.linkedin.com/in/cassiel www.loadbang.net From pcastine at gmx.net Wed Jan 16 10:43:04 2008 From: pcastine at gmx.net (Peter Castine) Date: Wed Jan 16 10:43:12 2008 Subject: [java-dev] Re: Re: Arbitrary binary data with TcpSender? In-Reply-To: <2136C504-BF94-4BD5-992C-9FE3AC600180@cassiel.com> Message-ID: <1ee47.478e4227@www.cycling74.com> On a note of closure: Java Sockets work OK. There is more work involved than with Cycling's TcpSender, but it's manageable. Leastaways the code I've written seems to be working now. Thanks also to Brad for some tips offlist. -- P. -- Peter Castine -- Peter is in dire need of a new Facebook tagline. Not to mention a new .sig From nick at cassiel.com Wed Jan 16 11:37:40 2008 From: nick at cassiel.com (Nick Rothwell) Date: Wed Jan 16 11:37:45 2008 Subject: [java-dev] Announce: embedded web server for MaxMSP (beta) Message-ID: <4BDB8FA5-9290-485A-8E3D-8F318D897759@cassiel.com> An installation piece I'm working on requires an embedded web server, so I thought I'd go ahead and wrap up Jetty inside MXJ and release the thing as a package under the LGPL, just in case anyone else finds it useful to run a web server over bits of MaxMSP's search path. You can find it here: http://www.loadbang.net/space/Software/net.loadbang.web Instructions, javadocs, examples and sources included. I'm planning to announce it to the general MaxMSP list soon, but thought I'd let people on the developer list give it a bit of a bashing first. I've run it on OS X and Windows and it seems pretty happy. -- N. Nick Rothwell / Cassiel.com Limited www.cassiel.com www.myspace.com/cassieldotcom www.last.fm/music/cassiel www.reverbnation.com/cassiel www.linkedin.com/in/cassiel www.loadbang.net From adamjmurray at gmail.com Wed Jan 16 21:50:37 2008 From: adamjmurray at gmail.com (Adam Murray) Date: Wed Jan 16 21:50:38 2008 Subject: [java-dev] Re: Announce: embedded web server for MaxMSP (beta) In-Reply-To: <4BDB8FA5-9290-485A-8E3D-8F318D897759@cassiel.com> Message-ID: <1ee98.478ede9b@www.cycling74.com> Nice! Thanks Nick, this is great. I had been meaning to try this for a while but never got around to it. One thing I've wanted to do was to control Max patches from the web. I think using the URL query string would be a good way to do this, but your object doesn't expose that to the patch. So I made a few adjustments... * In net.loadbang.web.mxj.WebServer I increased the number of outlets. declareIO(1, 4); * In net.loadbang.web.WebServer I added the following code to the top of ReporterHandler.handle() (sorry for the forum messing up my code formatting): Enumeration params = request.getParameterNames(); while (params.hasMoreElements()) { String param = (String) params.nextElement(); String[] vals = request.getParameterValues(param); if (vals == null) { itsOutputter.output(3, param); } else { StringBuffer s = new StringBuffer(param); for (int i = 0; i < vals.length; i++) { s.append(" ").append(vals[i]); } itsOutputter.output(3, s.toString()); } } // or something like this: // itsOutputter.output(3, request.getQueryString()); // but I don't feel like doing query string parsing in Max Then, as a really simple example, you could serve up the following HTML:


To control this patch: #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 376 147 32 196617 print; #P user textedit 122 212 270 233 32896 3 9; #P newex 122 186 62 196617 prepend set; #P user textedit 306 213 454 234 32896 3 9; #P newex 306 187 62 196617 prepend set; #P newex 266 138 90 196617 route text1 text2; #P window setfont Monaco 9.; #P user umenu 23 42 100 262183 1 64 57 1; #X add stop; #X add start; #P window linecount 2; #P newex 113 79 214 262153 mxj net.loadbang.web.mxj.WebServer @port 8080 @placeholder web-root; #P connect 1 1 0 0; #P connect 2 0 5 0; #P connect 5 0 6 0; #P connect 2 1 3 0; #P connect 3 0 4 0; #P connect 0 3 7 0; #P connect 0 3 2 0; #P window clipboard copycount 8; If that seems useful to you, might be worth including in your external. It wouldn't take much effort to do something more interactive like using AJAX to update the Max patch on-the-fly (I think there was something like that in the aka.iphone experiements). It would also be cool to enable JSP support. This could be used to allow the Max patch to communicate back to the browser. I'm not exactly sure how you do that with an embedded Jetty server. I might look into that some other time (unless you already know how?) BTW, I was not able to use your build.xml file: $ ant Buildfile: build.xml /Users/adam/workspace/net.loadbang.web/MXJ-basis/ant-defs.xml could not be found BUILD FAILED java.io.FileNotFoundException: /Users/adam/workspace/net.loadbang.web/MXJ-basis/ant-defs.xml (No such file or directory) Cheers, Adam From adamjmurray at gmail.com Wed Jan 16 22:37:37 2008 From: adamjmurray at gmail.com (Adam Murray) Date: Wed Jan 16 22:37:42 2008 Subject: [java-dev] Re: Announce: embedded web server for MaxMSP (beta) In-Reply-To: <1ee98.478ede9b@www.cycling74.com> Message-ID: <1ee99.478ee9a1@www.cycling74.com> This code is probably better: Enumeration params = request.getParameterNames(); while (params.hasMoreElements()) { String param = (String) params.nextElement(); String[] vals = request.getParameterValues(param); if (vals == null) { itsOutputter.output(3, param); } else { for (int i = 0; i < vals.length; i++) { itsOutputter.output(3, param + " " + vals[i]); } } } Adam From adamjmurray at gmail.com Thu Jan 17 00:14:52 2008 From: adamjmurray at gmail.com (Adam Murray) Date: Thu Jan 17 00:14:57 2008 Subject: [java-dev] Re: Announce: embedded web server for MaxMSP (beta) In-Reply-To: <1ee99.478ee9a1@www.cycling74.com> Message-ID: <1ee9f.478f006b@www.cycling74.com> I got JSPs to work. Just needed to add the jars from Jetty's lib/jsp directory (I used jsp-2.1), and then add the following handler in the handlers.setHandlers() call: new WebAppContext(directory.toURL().toString(), "/") This seems to break the DefaultHandler's behavior for favicon though (who cares?) I also have some other changes that let me send messages like "set attrName attrValue" to the WebServer object in Max, and then I can access the value in the JSP with the ${attrName} syntax. So 2-way communication between the web browser and the Max patch is easily possible. Let me know if you would like to see the code. -Adam From nick at cassiel.com Thu Jan 17 02:38:16 2008 From: nick at cassiel.com (Nick Rothwell) Date: Thu Jan 17 02:38:09 2008 Subject: [java-dev] Re: Announce: embedded web server for MaxMSP (beta) In-Reply-To: <1ee9f.478f006b@www.cycling74.com> References: <1ee9f.478f006b@www.cycling74.com> Message-ID: <7F3413D0-DC02-4A0A-8505-75858FC05E1C@cassiel.com> > I got JSPs to work. Wow. Quick work...! I had been playing around with the servlet support, and had thought about having the MXJ object call out into Max, but hadn't thought about JSP support. Thanks for all the effort. If you're happy with it, I'll integrate your enhancements into the main release (credited, natch). -- N. nick rothwell -- composition, systems, performance -- http:// www.cassiel.com From nick at cassiel.com Thu Jan 17 05:24:57 2008 From: nick at cassiel.com (Nick Rothwell) Date: Thu Jan 17 05:25:01 2008 Subject: [java-dev] Re: Announce: embedded web server for MaxMSP (beta) In-Reply-To: <1ee98.478ede9b@www.cycling74.com> References: <1ee98.478ede9b@www.cycling74.com> Message-ID: > BTW, I was not able to use your build.xml file: > $ ant > Buildfile: build.xml > /Users/adam/workspace/net.loadbang.web/MXJ-basis/ant-defs.xml could > not be found Oh yeah, sorry about that: the various references between the Ant files (and for that matter, the class paths) are dependent on the way I've laid out my Eclipse projects, and it'll take a bit of effort to get that into a form which can be used by anyone else. Well done on getting it all into the air regardless. -- N. Nick Rothwell / Cassiel.com Limited www.cassiel.com www.myspace.com/cassieldotcom www.last.fm/music/cassiel www.reverbnation.com/cassiel www.linkedin.com/in/cassiel www.loadbang.net From nick at cassiel.com Fri Jan 18 14:59:37 2008 From: nick at cassiel.com (Nick Rothwell) Date: Fri Jan 18 14:59:39 2008 Subject: [java-dev] Embedded web server for Max: now with added JSP goodness Message-ID: <86A8E251-24B1-48D9-83E9-BEFA7B03D7E7@cassiel.com> After a flurry of activity, and some sterling hackery by Adam Murray, the Jetty-based embedded web server for Max now has JSP support. Browser requests put out parameters into the Max world, and Max can populate the request with values to be manipulated or presented in a JSP. I think it's kind-of fun, but then, I would. I think this is just about in shape to launch on the Max populace at large, but if anyone wants to have a hack with it in the meantime, any feedback is welcome. Everything you need is at http://www.loadbang.net/space/Software/net.loadbang.web Nick Rothwell / Cassiel.com Limited www.cassiel.com www.myspace.com/cassieldotcom www.last.fm/music/cassiel www.reverbnation.com/cassiel www.linkedin.com/in/cassiel www.loadbang.net From adamjmurray at gmail.com Fri Jan 18 17:03:17 2008 From: adamjmurray at gmail.com (Adam Murray) Date: Fri Jan 18 17:03:22 2008 Subject: [java-dev] Re: Embedded web server for Max: now with added JSP goodness In-Reply-To: <86A8E251-24B1-48D9-83E9-BEFA7B03D7E7@cassiel.com> Message-ID: <1ef79.47913e45@www.cycling74.com> Looks good on my end Nick. I like the new examples. -Adam From pcastine at gmx.net Tue Jan 22 06:55:40 2008 From: pcastine at gmx.net (Peter Castine) Date: Tue Jan 22 06:55:42 2008 Subject: [java-dev] Performance differences between Windows & Mac OS Jit/Java Message-ID: <1f07f.4795f5da@www.cycling74.com> This is a follow-up of sorts to my previous query about TCP & Java. We (John Dekron and I) have a Jitter/Java based standalone which is supposed to run on a Mac Pro. The basic processing consist of jit.scissor-ing a 360x50 matrix into 8 parts, each of which is then sent by TCP to a custom wall-sized display using a custom TCP-based protocol. The app runs well enough when we only send a single portion of the matrix, but the CPU demand is pretty high. By the time we use all 8 TCP connections, our standalone is using 100% of its processor's capacity and we're down to about 9fps. The thing is, if we boot the same machine into XP via Boot Camp, the Windows version of our standalone can handle about 20fps and Task Manager says it's using about 80% of CPU capacity (am I right in my understanding that Task Manager is talking total machine capacity, ie 40% of a single core?). In any case, we've got identical hardware, identical Java code, identical Jitter patch. So where does the performance difference come from? Are the JVMs so different? The TCP/IP implementations? Something else? My experience in Max/Jitter is that the OS doesn't make a big performance difference given identical hardware. I'm attaching the .java & .class files if someone would care to look (Ben?). I know that I'm instantiating an InputStream that I don't really need (there was a lot of Copy&Paste to get this working at all) but I don't think that can be slowing things down. I'm wondering if there's anything I can do in my jit_matrix() method to speed up copying the Jitter data into our TCP packet data structure. The other obvious bottleneck is DataOutputStream.write(), but what can one do to speed that up? If a test patch would help I'll cobble something together. The biggest problem in testing is that currently the only test hardware on the planet exists in a village outside Leipzig and is inside an intranet. Not an ideal testing environment? Tell me about it-( Finally, before someone asks "Why not just use Windows?" the computer needs to run other processes as well as our standalone, and Mac OS is really what we need. Thanks for suggestions. -- Peter Castine -- Peter is in dire need of a new Facebook tagline. Not to mention a new .sig -------------- next part -------------- A non-text attachment was scrubbed... Name: jitSendPixm 1.0b6.zip Type: application/zip Size: 9209 bytes Desc: not available Url : http://www.cycling74.com/pipermail/java-dev/attachments/20080122/5f816471/jitSendPixm1.0b6.zip From jkc at musork.com Tue Jan 22 09:48:14 2008 From: jkc at musork.com (Joshua Kit Clayton) Date: Tue Jan 22 09:48:30 2008 Subject: [java-dev] Performance differences between Windows & Mac OS Jit/Java In-Reply-To: <1f07f.4795f5da@www.cycling74.com> References: <1f07f.4795f5da@www.cycling74.com> Message-ID: On Jan 22, 2008, at 5:55 AM, Peter Castine wrote: > Finally, before someone asks "Why not just use Windows?" the > computer needs to run other processes as well as our standalone, > and Mac OS is really what we need. Perhaps you can use VMWare or Parallels? i.e. run Windows under OS X. I don't have time to investigate your patch/code, but the JVMs are different. There may be some JVM settings which are by default used on windows, but not OS X, or vice versa. One other thing. Make sure you are not stalling in the main thread while you don't need to be. One example is to copy your matrix to send, add it to a queue which is serviced by your networking thread (I assume you're using a separate thread for networking, which is *essential*). -Joshua From topher at topher.com Tue Jan 22 13:51:41 2008 From: topher at topher.com (topher lafata) Date: Tue Jan 22 13:52:03 2008 Subject: [java-dev] Performance differences between Windows & Mac OS Jit/Java In-Reply-To: References: <1f07f.4795f5da@www.cycling74.com> Message-ID: Just to add. Historically the JVM implementation for windows has always been higher performance than the OS X JVM so it is not so surprising. Like josh said though some sort of queing mechanism might be worth investigating regardless. T On Jan 22, 2008, at 08:48 AM, Joshua Kit Clayton wrote: > > On Jan 22, 2008, at 5:55 AM, Peter Castine wrote: > >> Finally, before someone asks "Why not just use Windows?" the >> computer needs to run other processes as well as our standalone, >> and Mac OS is really what we need. > > Perhaps you can use VMWare or Parallels? i.e. run Windows under OS X. > > I don't have time to investigate your patch/code, but the JVMs are > different. There may be some JVM settings which are by default used > on windows, but not OS X, or vice versa. > > One other thing. Make sure you are not stalling in the main thread > while you don't need to be. One example is to copy your matrix to > send, add it to a queue which is serviced by your networking thread > (I assume you're using a separate thread for networking, which is > *essential*). > > -Joshua > _______________________________________________ > java-dev mailing list > java-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/java-dev From pcastine at gmx.net Wed Jan 23 04:06:16 2008 From: pcastine at gmx.net (Peter Castine) Date: Wed Jan 23 04:06:18 2008 Subject: [java-dev] Re: Performance differences between Windows & Mac OS Jit/Java In-Reply-To: Message-ID: <1f0bb.47971fa6@www.cycling74.com> Thanks, guys, for the feedback. Some examination last night turned up another bottleneck... I was using the very convenient JitterMatrix.getcell2dInt(), but the copyMatrixToArray() methods appear to be a lot more efficient. After thinking about it a bit I'm feeling a little stoopid for having chosen the cell-by-cell approach at all, but just based on the docs it's not immediately obvious that the one approach would be more efficient than the other. -- P. -- Peter Castine -- Peter is in dire need of a new Facebook tagline. Not to mention a new .sig From jkc at musork.com Wed Jan 23 09:22:17 2008 From: jkc at musork.com (Joshua Kit Clayton) Date: Wed Jan 23 09:22:26 2008 Subject: [java-dev] Re: Performance differences between Windows & Mac OS Jit/Java In-Reply-To: <1f0bb.47971fa6@www.cycling74.com> References: <1f0bb.47971fa6@www.cycling74.com> Message-ID: On Jan 23, 2008, at 3:06 AM, Peter Castine wrote: > > Some examination last night turned up another bottleneck... I was > using the very convenient JitterMatrix.getcell2dInt(), but the > copyMatrixToArray() methods appear to be a lot more efficient. > After thinking about it a bit I'm feeling a little stoopid for > having chosen the cell-by-cell approach at all, but just based on > the docs it's not immediately obvious that the one approach would > be more efficient than the other. Cell process and vec process examples are pretty clear. Yes. Never do cell by cell access if it can be avoided. This results in a boundary crossing (Java->C) for each cell, rather than once per row, or per matrix. Sounds like context switches are much slower on OS X than Windows, though on any platform, they are relatively expensive operations. -Joshua From wallyri at hotmail.com Thu Jan 24 14:19:21 2008 From: wallyri at hotmail.com (isaac) Date: Thu Jan 24 14:19:36 2008 Subject: [java-dev] multicast receive byte limit? Message-ID: <1f12b.479900d7@www.cycling74.com> Hi, A while ago, I changed the existing net.multi.recv code to suit the purposes of a networked medical system that uses max/msp at my university. It worked great, but now the system has grown and it is receiving much larger packets of information (around 8kb). Because of other system elements, it isn't feasible to divide the packets up or anything like that. It seems that the MultiReceiver class which is used in net.multi.recv has an upper limit on packet size, probably around 1 kilobyte, because the packets are getting truncated. Does anyone know of an easy way around this? I went through the api and google, found nothing. If anyone could point me to a manual page or who has experience in a problem like this could help me out, it would be really helpful. I'm also including my code--if anyone sees that I'm doing something stupid that could cause this problem, please let me know. It's pretty similar to the original net.multi.recv code, though. I think the only changes I made are in the receiver method. Isaac -------------- next part -------------- A non-text attachment was scrubbed... Name: recv.java Type: application/octet-stream Size: 1317 bytes Desc: not available Url : http://www.cycling74.com/pipermail/java-dev/attachments/20080124/2eec6ba6/recv.obj From owen at owengreen.net Fri Jan 25 08:06:31 2008 From: owen at owengreen.net (Owen Green) Date: Fri Jan 25 08:07:17 2008 Subject: [java-dev] multicast receive byte limit? In-Reply-To: <1f12b.479900d7@www.cycling74.com> References: <1f12b.479900d7@www.cycling74.com> Message-ID: <4799FAF7.7000106@owengreen.net> Hi Issac, As far as I can tell, the maximum packet size is determined by the buffer size of the underlying DatagramSocket: -- Owen isaac wrote: > Hi, > > A while ago, I changed the existing net.multi.recv code to suit the > purposes of a networked medical system that uses max/msp at my > university. It worked great, but now the system has grown and it is > receiving much larger packets of information (around 8kb). Because > of other system elements, it isn't feasible to divide the packets up > or anything like that. It seems that the MultiReceiver class which > is used in net.multi.recv has an upper limit on packet size, probably > around 1 kilobyte, because the packets are getting truncated. Does > anyone know of an easy way around this? I went through the api and > google, found nothing. If anyone could point me to a manual page or > who has experience in a problem like this could help me out, it would > be really helpful. > > I'm also including my code--if anyone sees that I'm doing something > stupid that could cause this problem, please let me know. It's > pretty similar to the original net.multi.recv code, though. I think > the only changes I made are in the receiver method. > > Isaac > > > ------------------------------------------------------------------------ > > > _______________________________________________ java-dev mailing list > java-dev@cycling74.com > http://www.cycling74.com/mailman/listinfo/java-dev From taprik at zombideo.net Tue Jan 29 06:48:10 2008 From: taprik at zombideo.net (taprik) Date: Tue Jan 29 06:48:10 2008 Subject: [java-dev] deferring a new operation of buf.Op Message-ID: <1f232.479f2e99@www.cycling74.com> Hi there, I'd like to implement a new operation for buf.Op. I want this operation deferred like Copyinto or Copyfrom are. I try this script public void fade(final int start_index){ MaxSystem.deferlow(new Executable() { public void execute(){ float val1=0; float val2=0; for (int c=start_index; c<(start_index+220);c++) { val1 = MSPBuffer.peek(bufname, 1, c)*((c-start_index)/220); val2 = MSPBuffer.peek(bufname, 2, c)*((c-start_index)/220); MSPBuffer.poke(bufname, 1, c, val1 ); MSPBuffer.poke(bufname, 2, c, val2 ); } } } ); } This script gave me a compilation error I don't understand : /Applications/MaxMSP 4.6/Cycling '74/java/classes/buf/Op.java[ 127 ] cannot find symbol symbol : method deferlow() location: class com.cycling74.max.MaxSystem MaxSystem.deferlow(new Executable() { ^ 1 error [ 29 janv. 2008 14:36:20 ] compilation of /Applications/MaxMSP 4.6/Cycling '74/java/classes/buf/Op.java failed. I use the same code as the copyinto or copyfrom method. Does any of you have an idea ? Thanks for your help. NB: I'd like to defer this one as, I'll call this method when I'll read the same buffer. The aim is to make a fade of 5 ms at a given index. From c74-mailinglists at e--j.com Tue Jan 29 07:42:32 2008 From: c74-mailinglists at e--j.com (Emmanuel Jourdan) Date: Tue Jan 29 07:42:54 2008 Subject: [java-dev] deferring a new operation of buf.Op In-Reply-To: <1f232.479f2e99@www.cycling74.com> References: <1f232.479f2e99@www.cycling74.com> Message-ID: On 29 janv. 08, at 14:48, taprik wrote: > I use the same code as the copyinto or copyfrom method. > Does any of you have an idea ? > Thanks for your help. Make sure that you respect the case: it's MaxSystem.deferLow() not MaxSystem.deferlow(). HTH, ej From taprik at zombideo.net Tue Jan 29 08:17:16 2008 From: taprik at zombideo.net (taprik) Date: Tue Jan 29 08:17:18 2008 Subject: [java-dev] Re: deferring a new operation of buf.Op In-Reply-To: <1f232.479f2e99@www.cycling74.com> Message-ID: <1f237.479f437b@www.cycling74.com> Yes ! You're right. Thanks Emmanuel. And I made an other mistake with the type. The correct script is public void fade(final int start_index){ MaxSystem.deferLow(new Executable() { public void execute(){ float val1=0; float val2=0; for (int c=start_index; c<(start_index+221);c++) { val1 = MSPBuffer.peek(bufname, 1, c)*(float)((c-start_index)/220.0); val2 = MSPBuffer.peek(bufname, 2, c)*(float)((c-start_index)/220.0); MSPBuffer.poke(bufname, 1, c, val1 ); MSPBuffer.poke(bufname, 2, c, val2 ); } } } ); } From Thinksamuel at yahoo.com Wed Jan 30 16:21:08 2008 From: Thinksamuel at yahoo.com (Samuel Van Ransbeeck) Date: Wed Jan 30 16:21:14 2008 Subject: [java-dev] Troubleshooting Message-ID: <1f295.47a10663@www.cycling74.com> Hello I aqm using the stockwatch java file to get stock data from the internet. However, everytime I start the program I get these error messages (but I do get nice music though). Can anyone explain me what is wrong here? MXJ System CLASSPATH: /Applications/MaxMSP 4.6/Cycling '74/java/lib/jode-1.1.2-pre-embedded.jar /Applications/MaxMSP 4.6/Cycling '74/java/lib/max.jar MXJClassloader CLASSPATH: /Applications/MaxMSP 4.6/Cycling '74/java/classes/ ? error: java.lang.NullPointerException ? error: at StockWatch._stuff_into_hash(StockWatch.java:207) ? error: at StockWatch._do_lookup(StockWatch.java:160) ? error: at StockWatch.run(StockWatch.java:124) ? error: at java.lang.Thread.run(Thread.java:613)