random names of a buffer

    Aug 04 2010 | 9:46 pm
    Hi everyone, i am making a simple sampler for live in max and i am a bit new in m4l so i need some help. I almost made a usable version out of it but the only thing is when i load it to different tracks in live it always works with the same sample. To make myself clear it only plays one sample because i want to use it for drum samples and i want to process them separately afterwards. So i use one common buffer for the patch in which i load a sample with the dropfile object and i play it with groove at different speed. So i think he problem is with the name of the buffer cause it always stays the same no mater how much of them i open. I tried number don't work, i also found somewhere that putting a #0_name will generate a name with a random number in front like 345_name but that doesnt work either. Someone has an idea?

    • Aug 04 2010 | 9:53 pm
      i was going to suggest something else as well, so as to avoid being 'the js guy,' but...umm, javascript seems to be the best bet.
    • Aug 05 2010 | 9:27 am
      I tried something similar to a patch I am working on and I the same problems. I have some ideas that maybe can help:
      By not adding the _name to 0# because it seems that those numbers aren't generated when you write it like 0#name.
      Maybe set the buffer name to the file name? By connect the dropfile with a set message to the buffer and groove object.
      I tried something with connecting a loadmess and the combine object but it seems that those 0# generated numbers are random for what I wanted to do.
      all the best,
    • Aug 05 2010 | 10:02 am
      Well i forgot to write that but i tried that already, to get the path name from the drop file and give it that name to the buffer and the groove and rest, but probably is not doing that in the right order, maybe the sample is being loaded first in the buffer and it gets renamed afterwards so it deletes the buffer, and after it doesn't work!
    • Aug 05 2010 | 10:05 am
      Thanks griotspeak but i wouldnt know where to start with javascript :)
    • Aug 05 2010 | 10:13 am
      huh strange. but the example I posted with the replace and set message works okey or not? I tested it and it works fine with me. Or do you need something else in your patch?
    • Aug 05 2010 | 1:14 pm
      "also found somewhere that putting a #0_name will generate a name with a random number in front like 345_name but that doesnt work either."
      that should work (or setting it on startup with [loadmess set #0_] )
      btw, what they do in the tutorials/exmampls is using ---something these "---" have a unique value for every device
    • Aug 05 2010 | 5:08 pm
      in the patch I wrote 0# instead of #0.. I should pay more attention when I am doing stuff..
      @ timo What are the tutorials you're talking about?
    • Aug 05 2010 | 5:14 pm
      what about the --- ? e.g [buffer~ ---hey]
      doesnt this work too? i think the three -'s will be replaced with random numbers iam not sure tho well, if you open your sampler 999 times, 2 will def. have the same sample... might be good to know if you are aaron or richard.
    • Aug 05 2010 | 7:52 pm
      the trick is to set the random names from outside the buffer.
      [loadbang] - [t #0_buffername] - [prepend set]
      now you can connect this to both, a buffer AND (for example) a [play~] object, and in each max4live instance, patcher instance, or pluggo plug-in there are patcher specific unique names now.
      you can also go one step further and use a simple abstraction which loadbangs a #0 style number for maximum flexibilty.
    • Aug 06 2010 | 12:42 pm
      @marinus : look at some patches that come with m4l, they are using --- for receive and buffer names, it's max's simple way of dealing with scope, see also https://cycling74.com/forums/what-does-mean
    • Aug 10 2010 | 10:34 am
      okey that's pretty easy! will this ---name also work when you just use max as standalone when you run multiples of the same patch?
    • Aug 10 2010 | 12:26 pm
      --- simply doesn't work outside of m4l.
      anyway, does this cover you?
    • Aug 10 2010 | 1:09 pm
      thnx man.
      I have some other problems with file handling just for the old fashioned max. I will post a new topic when I have cleared my question about with the patches I tried. Maybe you can take a look at it. It's about loading audio files into buffers inside a poly object, storing information in a coll, saving and to load the same files into the buffers again.
    • Aug 18 2010 | 11:35 pm
      ---name is the way to go in M4L. However if you want to use this in a stand-alone you use 0#_name.
      Load this patcher in multiple tracks in M4L and you will see that every instance is different from the other and no sampes are shared.
    • Mar 20 2013 | 3:09 am
      Hey guys, I was having no luck with the various approaches on here and different threads, then I came across: zl scramble, which made making random letters a breeze