post shift when printing variables in MAX window?

Aug 7, 2006 at 9:43am

post shift when printing variables in MAX window?

Hi
I am experimenting since today a strange behaviour of “post” when writing externals in Java. When asking for a print like:

post(“my variable” + i);

I always get a shifted result in MAX window. I mean: if I just changed the value of i (e.g.from an inlet, or from a changed attribute in the constructor), first subsequent post sends the preceding value of i, and only the following post sends the new value.
Nevertheless, the class uses the right new value for all other tasks (!), I experiment the pb only with post.

I did not find any comparable thread on the forum. Had anybody the same behaviour ?

Dominique

#27059
Aug 7, 2006 at 10:22am

On 7 Aug 2006, at 11:43, David wrote:

> I did not find any comparable thread on the forum. Had anybody the
> same behaviour ?

Er, nope. (Based on a huge amount of MXJ code I have here.)

Can you provide more context? More of the source code?

– N.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com

#81525
Aug 7, 2006 at 12:16pm

Hello

Thank you for answering. I just did that:
- launch MAX
- create the object “mxj echo @feedback 25″ (from an mxj example provided with the java package)
- connect the getfeedback message in left inlet
- connect print in right info outlet

Now clicking the message box, I get in MAX window: print: 25 :-)

I change the attribute value for example to 11. Clicking on getfeedback will return 25 the first time, then 11. Every time I change the attribute value in the constructor, the first getfeedback query returns the old attribute value. I have the same not only with attributes, but also when I want to pass arguments to the class.

I really don’t understand. If nobody experiments the same, hum…

Thanks if you can help

Dominique

#81526
Aug 7, 2006 at 12:37pm

On 7 Aug 2006, at 14:16, David wrote:

> – create the object “mxj echo @feedback 25″ (from an mxj example
> provided with the java package)
> – connect the getfeedback message in left inlet
> – connect print in right info outlet

[getfeedback] gives me 25.0000000.
[feedback 11] then [getfeedback] gives me 11.000000.

If I reinstantiate the object with a new feedback attribute,
[getfeedback] gives me the new value.

In other words, for me, it’s all doing exactly what it says on the
tin. Is there anything else unusual you’re doing?

– N.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com

#81527
Aug 7, 2006 at 1:01pm

No, I do really nothing else than what I just explained above. For me:

[getfeedback] gives me 25.00000
[feedback 11] then [getfeedback] gives me 25.000 then [getfeedback] gives 11.00000

I noticed also that if I close the patcher and reopen another patcher with some mxj object, the first [getattribute] message returns the last value in the preceding patcher! Exactly as if the post messages were waiting in some queue somewhere with one tap delay.

I also tried to stop/restart the computer, then relaunch MAX, but nothing changes. Should I resinstall the Java machine ?! or reinstall MAX ????

I am not a great java expert, but I used only existing classes for testing my problem.

Oooops…

#81528
Aug 7, 2006 at 3:27pm

Hi

I must apologize. I just discovered that my max window has moved a little bit to the left of the screen, thus masking the very last printed line under the scrolling bar.

So every last line was hidden…

Thanks a lot to Nick for hearing. Next time I try to come with some more consistent stuff.

Nevertheless, Java + Max is a pleasure.

Regards

Dominique

#81529
Aug 7, 2006 at 5:10pm

On 7 Aug 2006, at 17:27, David wrote:

> I must apologize. I just discovered that my max window has moved a
> little bit to the left of the screen, thus masking the very last
> printed line under the scrolling bar.

I make that mistake on average once a year…

– N.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com

#81530

You must be logged in to reply to this topic.