Can mxj watch a patcher for arbitrary events?
Hello all,
I'm trying to write an mxj kinda-alternative to autopattr and company. I want to interface max UI stuff with JMSL (algomusic.com) to record presets and play back my actions.
I REALLY want to do this without wires. I can easily send messages to arbitrary MaxBoxes, but I can't seem to figure out how to make java respond when I click (for instance) a bangbutton that isn't wired to the mxj.
Any ideas? I tried implementing MessageReceiver but it seems that it only receives events from AudioBuffer.
best,
Kevin
No ideas? Topher (I think you're the most qualified!)?
-kevin
Hi Kevin,
>From within some Java code I can't think of any way to get at the
message (register a callback, or something like that) that a lonely,
unconnected bang button sends out.
Sorry,
Ben
On 11/28/06, Kevin Cox wrote:
>
> Hello all,
>
> I'm trying to write an mxj kinda-alternative to autopattr and company. I want to interface max UI stuff with JMSL (algomusic.com) to record presets and play back my actions.
>
> I REALLY want to do this without wires. I can easily send messages to arbitrary MaxBoxes, but I can't seem to figure out how to make java respond when I click (for instance) a bangbutton that isn't wired to the mxj.
>
> Any ideas? I tried implementing MessageReceiver but it seems that it only receives events from AudioBuffer.
>
> best,
> Kevin
>
Quote: Kevin Cox wrote on Wed, 29 November 2006 02:49
----------------------------------------------------
> Hello all,
>
> I'm trying to write an mxj kinda-alternative to autopattr and company. I want to interface max UI stuff with JMSL (algomusic.com) to record presets and play back my actions.
>
> I REALLY want to do this without wires. I can easily send messages to arbitrary MaxBoxes, but I can't seem to figure out how to make java respond when I click (for instance) a bangbutton that isn't wired to the mxj.
>
> Any ideas? I tried implementing MessageReceiver but it seems that it only receives events from AudioBuffer.
>
> best,
> Kevin
----------------------------------------------------
I have the same problem in javascript. The way I do this now is to put a pattr outside the js (in your case mxj) object, reserve a special inlet for it, bind it to the pattr where your input enters the patch. You know about the existence of pattrmarker? That one makes this more easy to bind to a remote place.
Oh and make sure you have the latest incremental download of pattr. The default one doesn't update if its bound counterpart updates.
Hth,
Mattijs
(wow, email notification is great! would've definitely missed this...)
Thanks for the info, Mattijs! I'm not completely sure of what you mean, and I don't have time to mess around in Max (on holiday skiing - opened the computer to check the online ski report).
do you mean
[pattr]
|
[mxj or js MyThing]
within a patcher?
Could you maybe paste an example?
thanks VERY much - this was great timing, by the way - I'm about to have a lot more time to Max.
Oh.
I thought about this a bit more. The pattr wouldn't be wired to the mxj/js.
I don't know about pattrmarker. I feel like I've heard of it but I just did a quick search and didn't turn up anything obvious.
time to suit up!
Quote: Kevin Cox wrote on Sat, 13 January 2007 15:08
----------------------------------------------------
> (wow, email notification is great! would've definitely missed this...)
>
> Thanks for the info, Mattijs! I'm not completely sure of what you mean, and I don't have time to mess around in Max (on holiday skiing - opened the computer to check the online ski report).
>
> do you mean
>
> [pattr]
> |
> [mxj or js MyThing]
>
> within a patcher?
That's right.
>
> Could you maybe paste an example?
Sure. I attached it.
Mattijs
Is it possible to use either Java or JavaScript to copy a string from
Max to the clipboard (Mac OS X and Windows XP)?
Georg
Hi Georg,
You can do it with Java:
http://www.javapractices.com/Topic82.cjp
--
Owen
Georg Hajdu wrote:
> Is it possible to use either Java or JavaScript to copy a string from
> Max to the clipboard (Mac OS X and Windows XP)?
>
> Georg
>
Hi Owen,
Thank you for the hint.
Georg
On Jan 16, 2007, at 2:23 AM, Owen Green wrote:
> Hi Georg,
>
> You can do it with Java:
> http://www.javapractices.com/Topic82.cjp
>
> --
> Owen
>
> Georg Hajdu wrote:
>> Is it possible to use either Java or JavaScript to copy a string
>> from Max to the clipboard (Mac OS X and Windows XP)?
>> Georg
>
Hi Owen,
Do you have an idea how to implement this code in mxj? I failed
miserably, which is probably due to the fact that I'm far from being
a Java, let alone MaxJava expert.
Thank you,
Georg
On Jan 16, 2007, at 2:23 AM, Owen Green wrote:
> Hi Georg,
>
> You can do it with Java:
> http://www.javapractices.com/Topic82.cjp
>
> --
> Owen
>
> Georg Hajdu wrote:
>> Is it possible to use either Java or JavaScript to copy a string
>> from Max to the clipboard (Mac OS X and Windows XP)?
>> Georg
>
this should be close if you just want to copy To the system clipboard.
topher
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.StringSelection;
import java.awt.Toolkit;
import java.io.*;
public class toclipboard extends MaxObject implements ClipboardOwner
{
public void setClipboardContents( String aString ){
StringSelection stringSelection = new StringSelection( aString );
Clipboard clipboard = Toolkit.getDefaultToolkit
().getSystemClipboard();
clipboard.setContents( stringSelection, this );
}
/**
* Empty implementation of the ClipboardOwner interface.
*/
public void lostOwnership( Clipboard aClipboard, Transferable
aContents) {
//do nothing
}
}
On Jan 16, 2007, at 09:17 AM, Georg Hajdu wrote:
> Hi Owen,
>
> Do you have an idea how to implement this code in mxj? I failed
> miserably, which is probably due to the fact that I'm far from
> being a Java, let alone MaxJava expert.
>
> Thank you,
>
> Georg
>
> On Jan 16, 2007, at 2:23 AM, Owen Green wrote:
>
>> Hi Georg,
>>
>> You can do it with Java:
>> http://www.javapractices.com/Topic82.cjp
>>
>> --
>> Owen
>>
>> Georg Hajdu wrote:
>>> Is it possible to use either Java or JavaScript to copy a string
>>> from Max to the clipboard (Mac OS X and Windows XP)?
>>> Georg
>>
>
On 16 janv. 07, at 18:17, Georg Hajdu wrote:
> Hi Owen,
>
> Do you have an idea how to implement this code in mxj? I failed
> miserably, which is probably due to the fact that I'm far from
> being a Java, let alone MaxJava expert.
This is quickly made, but should give you enough information to start
with.
Best,
ej
Aww, I just made one and in the meantime Topher and Emmanuel beat me to it!
Anyway, just for completeness; put the attached jar file somewhere
useful and hack the source to your heart's content.
Georg Hajdu wrote:
> Do you have an idea how to implement this code in mxj? I failed
> miserably, which is probably due to the fact that I'm far from being a
> Java, let alone MaxJava expert.
Thanks Topher,
Your solution works like a charm! Finally, I get to put my Max chat
stuff on the clipboard.
What about inclusion in Max v5?
Best,
Georg
On Jan 16, 2007, at 8:46 PM, topher lafata wrote:
> this should be close if you just want to copy To the system clipboard.
> topher
>
>
> import java.awt.datatransfer.Clipboard;
> import java.awt.datatransfer.ClipboardOwner;
> import java.awt.datatransfer.Transferable;
> import java.awt.datatransfer.StringSelection;
> import java.awt.Toolkit;
> import java.io.*;
>
> public class toclipboard extends MaxObject implements ClipboardOwner
> {
>
> public void setClipboardContents( String aString ){
> StringSelection stringSelection = new StringSelection( aString );
> Clipboard clipboard = Toolkit.getDefaultToolkit
> ().getSystemClipboard();
> clipboard.setContents( stringSelection, this );
> }
>
> /**
> * Empty implementation of the ClipboardOwner interface.
> */
> public void lostOwnership( Clipboard aClipboard, Transferable
> aContents) {
> //do nothing
> }
> }
>
> On Jan 16, 2007, at 09:17 AM, Georg Hajdu wrote:
>
>> Hi Owen,
>>
>> Do you have an idea how to implement this code in mxj? I failed
>> miserably, which is probably due to the fact that I'm far from
>> being a Java, let alone MaxJava expert.
>>
>> Thank you,
>>
>> Georg
>>
>> On Jan 16, 2007, at 2:23 AM, Owen Green wrote:
>>
>>> Hi Georg,
>>>
>>> You can do it with Java:
>>> http://www.javapractices.com/Topic82.cjp
>>>
>>> --
>>> Owen
>>>
>>> Georg Hajdu wrote:
>>>> Is it possible to use either Java or JavaScript to copy a string
>>>> from Max to the clipboard (Mac OS X and Windows XP)?
>>>> Georg
>>>
>>
>
Hi Emmanuel
Thank you. For some reason, your solution won't instantiate on my
computer.
Best,
Georg
On Jan 16, 2007, at 9:17 PM, Emmanuel Jourdan wrote:
> On 16 janv. 07, at 18:17, Georg Hajdu wrote:
>
>> Hi Owen,
>>
>> Do you have an idea how to implement this code in mxj? I failed
>> miserably, which is probably due to the fact that I'm far from
>> being a Java, let alone MaxJava expert.
>
> This is quickly made, but should give you enough information to
> start with.
>
> Best,
> ej
>
>
>
Thanks to you too! It works.
Regards,
Georg
On Jan 16, 2007, at 10:37 PM, Owen Green wrote:
>
hello to all.
anybody know where i can get the jar file mentioned here? ...seems to have been removed from this decrepit thread.
much thanks.