Forums > MaxMSP

typeless placeholder in msgs?

Nov 12 2009 | 1:37 pm

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

— Pasted Max Patch, click to expand. —

any ideas?

Nov 12 2009 | 6:05 pm

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.

-- Pasted Max Patch, click to expand. --
Nov 12 2009 | 11:00 pm

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

— Pasted Max Patch, click to expand. —
Nov 12 2009 | 11:34 pm

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

— Pasted Max Patch, click to expand. —

Nov 13 2009 | 8:06 am


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

-- Pasted Max Patch, click to expand. --

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

Nov 13 2009 | 11:54 am

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 Smile.
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 Smile

thank you very much, ch

Nov 13 2009 | 1:16 pm

Maybe you can consider the use of a simple gate :

— Pasted Max Patch, click to expand. —
Nov 13 2009 | 5:34 pm

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

— Pasted Max Patch, click to expand. —

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

Nov 18 2009 | 2:52 pm

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…


-- Pasted Max Patch, click to expand. --

Nov 18 2009 | 3:25 pm

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.

— Pasted Max Patch, click to expand. —
Viewing 10 posts - 1 through 10 (of 10 total)

Forums > MaxMSP