Very strange bpatcher behaviour?

Aug 29, 2009 at 6:41pm

Very strange bpatcher behaviour?

I have this patch wich is getting opened in another patch as a bpatcher.
Inside this patch (opened) as a bpatcher I have got a message wich says #001 $1. This message is sent to a vst~ abject containing battery 3.
For some strange reason I can’t figure out the #001 part of the message gets converted to a random 6 digit number between two quotation marks, such as “104601″. The number changes randomly every time I open the patch.
Strange is this only happens when the patch is opened as a bpatcher. If I open the original patch the #001 stays what it is but if I open a “new view” of the bpatcher I can see the #001 has changed to one of these these random digits.
I tried putting the #001 in between quotation marks wich didn’t work out. I aslo tried to change it to #001 but this didn’t work out either.
Also I have tried to send a $1 message into a prepend object with the argument #001 but even there the #001 miraculously changed into a random 6 digit number.

#45270
Aug 29, 2009 at 7:45pm

I am not at a machine were I can verify this, but I think the following is happening:

using the # sign in combination with a number from 1-9 means that “#1″, “#2″, etc. will be replaced by the arguments provided in your patcher.
For example: you have a patch with three message boxes; you type “#1″, “#2″, “#3″ in each of the boxes and save your patch as “replaceTest”; open a new window and create an object called “replaceTest”; open it and all message boxes should have the number 0 in them; now give “replaceTest” 3 arguments; open it up again and the arguments will appear in the message boxes;

now the “#0″ is a special case. max will create a UNIQUE 4-digit number (I think) for “#0″ in each instance of a patch. In your case you have “#001″, so you get a unique number and then the “01″ added on at the end.

hope this helps

edit: I forgot to mention that when you use the #1 etc. on the top-level in a bpatcher the arguments are supplied by the bpatcher inspector!!!

#163139
Aug 30, 2009 at 8:54am

you’re right.
i tried what you said: i made a message with #1 another with #2 and one with #3. i copied them four times to have a good look what happens.
with no arguments, everything gets replaced by 0. with one argument, the #1′s get replaced by that argument, with two arguments the #1 gets replace by the first and #2 by the second and so on.
i also tried creating a #0 and a #001 message and they get replaced by the same random nummer only the #001 adds a 01 to the end and some quotation marks to beginning and end.

but the big million dollar question: how can i get around this? #001 is the only thing the battery3 vst~ reads.

#163140
Aug 30, 2009 at 10:03am

first thing that comes to mind:

– Pasted Max Patch, click to expand. –
#163141
Aug 30, 2009 at 10:38am

this works fine. i would never come to this solution on my own.

thanks a lot!

#163142
Aug 30, 2009 at 1:40pm
nit wrote on Sun, 30 August 2009 10:54
with no arguments, everything gets replaced by 0.

thats the expected behaviour.

Quote:
with one argument, the #1′s get replaced by that argument, with two arguments the #1 gets replace by the first and #2 by the second and so on.

thats the expected behaviour.

Quote:
i also tried creating a #0 and a #001 message and they get replaced by the same random nummer only the #001 adds a 01 to the end and some quotation marks to beginning and end.

thats the expected behaviour.

Quote:
but the big million dollar question: how can i get around this?

around what?

Quote:
#001 is the only thing the battery3 vst~ reads.

vst~ takes all kinds of data. what are you trying to do?
is “#001″ a named parameter of battery? in that case i´d say dont use them,
do it by parameter number.

#163143

You must be logged in to reply to this topic.