typeless placeholder in msgs?

johannotto's icon

hi there,
I need some typeless placeholder in messages (like "nil" in supercollider). the patch below simply illustrates my probem:

Max Patch
Copy patch and select New From Clipboard in Max.

any ideas?
thx,
johann

Peter Castine's icon

Max isn't Supercollider. Among other things, Max doesn't have a nil placeholder. (Actually, internally it defines an Atom type A_NOTHING, which is probably quite like what you want, but you do not have access to this kind of Atom from a patch.)

You'll have to take a different approach to achieve your desired effect. What are you trying to achieve?

Without context it's hard to know what you're trying to do, but the following might be a first stab at it. It keeps your convention of only connecting to the left inlet of the if object, and triggering the middle item at the top (now a button instead of a message box) will not change the state of the $f2 placeholder in your patch.

Max Patch
Copy patch and select New From Clipboard in Max.

johannotto's icon

I just want to create dynamic expressions and have problems with the connections to the varifying if inlets. see the patch below.

Max Patch
Copy patch and select New From Clipboard in Max.

johannotto's icon

hm - I just tried this:
(it works, but I'm always feelin unsafe with too much scripting experiments - any smarter ideas?)

Max Patch
Copy patch and select New From Clipboard in Max.

ch's icon

Hi,

Max Patch
Copy patch and select New From Clipboard in Max.

I'm not sure about what you're trying to achieve.
Just to clarify, would something like that do what you want? :

btw, i think you want to write && instead of &, and that [if $f1 == 0 then $f1*1.345] seems a bit strange.
Ch

johannotto's icon

yes, the expressions in my example are just for demonstrating the changing numbers of the if object's inlets - don't look at there logical correctness .
I just really want nothing else then having the option to multicond 3 inputs. I'm building up a data-router with different modification-stages (scaling, interp, patchinsert) and one stage is a simple dynamic expression "insert" who should also have the option to integrate the data of 2 other data-stream inputs.
Due to the fact, that it's dynamic - so in most cases 1 inlet ("if $f1 == 0 then bang), sometimes a kind of simple gate ("if $f1 > 0.5 && $f2 == 1 then $f1") and sometimes also including the third stream. The expression is pattrstored as text, so switching between different conditions works.
It should really be no big deal - the patch in my last post does exactly what I need, I'm just not very happy with too much conditioned scripting. I just came across the js.dynexpr example in the extras overview, that could also be an option - but I don't like the syntax there, yet

thank you very much, ch
johann

ch's icon

Maybe you can consider the use of a simple gate :

Max Patch
Copy patch and select New From Clipboard in Max.

johannotto's icon

ok, but this leads again to my starting point of this thread. When combining values, there's no typeless placeholder - Look at the patch:

Max Patch
Copy patch and select New From Clipboard in Max.

I think, I will make some tries with my scripting solution.
thank you very much!

Tj Shredder's icon

To create an unilpack was easy (replace the nil with a stored version, though for your scripting ideas I'd simply put an $f3 into the equation if you need only one input to keep the other inputs alive... (just reverse the input list)

A substitute can also be helpful if you don't put a nil at the beginning (or it will be more complicated than the unilhilation...

On the other hand, this looks like you learned a lot lines of codes programming and are not so familiar with visual data flow languages like Max.
In almost twenty years of Maxin' I literally never ever use the if object. There are most likely other ways to achieve what you want. Mostly simple route/sel and gate/switch are your friends...

And last not least, if you do scripting, don't worry about scripting connections as well...

Max Patch
Copy patch and select New From Clipboard in Max.

Stefan

johannotto's icon

Thank you, Stefan!
In any other (more complex) cases I also would use gates, switches or routs in a new patcher but in this case I really only want to have a simple text-interface for writing simple conditions - so not having to patch or strip. my scripting version still works fine.
I like your idea, but it still remains the problem illustrated in the patch below.

Max Patch
Copy patch and select New From Clipboard in Max.