Abstraction detection using #1


    Mar 23 2011 | 5:51 pm
    I am using instance name to save file at load and close (no savebang) so I use #1 to generate filename But I'd like for the abstraction itself (original) to avoid having #1 in the name and replace it with "default" for example how to test #1 ?

    • Mar 23 2011 | 6:16 pm
      not sure if i understood your question, but if you don't give a name/argument which should be/replace #1, max sends/generate 0 instead of #1 what I do is using a [sel 0] which bangs to a "default" value/name etc
      again, not sure if i understood your question. Hope it helps
      kasper
    • Mar 23 2011 | 6:23 pm
      The patcherargs object will give you a default argument if none is specified.
    • Mar 23 2011 | 7:55 pm
      want to change the behavior of the original file where #1 is not replace by anything
    • Mar 24 2011 | 8:09 am
      but it is; it will be replaced by 0
    • Mar 24 2011 | 11:23 pm
      it is not replaced by 0
      Ok I made the problem even simpler
      if you include the 3 blocks here in a patch and load it the last one is set to #1 i'd like to get "default" there
    • Mar 25 2011 | 1:45 am
      Is this what you want to do?
    • Mar 25 2011 | 2:27 am
      No but thanks
      I think you meant to use sel not split (below a corrected one)
      I want the default message to be trig not for an abstraction used with no name in a patch : yes #1 is replaced by 0 in this case but when you open the original patch where it is
    • Mar 25 2011 | 2:56 am
      This one will replace the #1 with default when the patch is not an abstraction, but use the first arg if there is one assigned. It will output a zero if no arg is defined.
    • Mar 25 2011 | 10:42 am
      YES, I can move on now, THANKS
      in case somebody else need it I made it faster (I'm a programmer, got to optimize) it deal also with the no argument case
      Maa
    • Mar 25 2011 | 11:52 am
      You found a solution, but with patcherargs it all becomes simpler.
    • Mar 25 2011 | 1:45 pm
      yep but so difficult to understand (and test) when your not a max addict for months and have only a so clear patcherargs help/reference could you explain / comment please
    • Mar 25 2011 | 3:19 pm
      > could you explain / comment please
      Sure. I forgot that I found the patcherargs object a little intimidating myself when I got to know it.
    • Mar 25 2011 | 9:45 pm
      Thanks I got it now