Buffer and function in genexpr


    May 28 2018 | 10:07 am
    Hi all, is it possible to change a Buffer reference in a genexpr function? If yes, how?
    In the attached patch I created three gen~ patches: the first one is a simple patch which plays the content of an external buffer, and it works. In the second patch I used a codebox with the same algorithm, and it still works. In the third patch I enclosed the algorithm into a function, then called the function, and it doesn't work: that is because the buffer declaration is inside the function and cannot (apparently) be redirect from the 'outside'. I tried to pass the buffer name as a parameter but without success.
    Is there a way to make it work? Thanks!

    • May 30 2018 | 8:29 am
      Hi Maurizio
      What version of Max?
    • May 30 2018 | 8:31 am
      Hi Ernest, it is the latest Max 7.3.5
    • May 31 2018 | 12:40 pm
      That means I can't help, sorry.
    • May 31 2018 | 12:42 pm
      Oh. ran into bandwidth limits again. Hope you can figure it out )
    • May 31 2018 | 5:50 pm
      You have it right, you just need to uncomment the Buffer declaration. It has been my experience that buffers need to be declared in the top level, so that there is something to pass the message on to the function. Otherwise the top level [gen~] has no idea what to do with the message when it is received from max. Sort of like Params:
    • May 31 2018 | 8:21 pm
      Hi, cptnfantasy, thank you for the reply, but apparently uncommenting the Buffer declaration didn't fix the issue (no sound). I don't know if I'm missing something: is there something other I should do other than uncommenting the Buffer declaration? Your patch is a completely different example so I don't understand how to use it.
      Thanks
    • Jun 19 2018 | 5:01 am
      Not sure if that's what you wanted but I think I managed to make it work
    • Jun 19 2018 | 7:46 am
      .QUASAR Awesome, thanks!