Creating a receive~ instance inside an external?

    Dec 02 2009 | 11:26 pm
    I am working on a MSP external where I would like to dynamically change the number of inputs to process. I am thinking the easiest way to achieve this is to create a receive~ object inside my external. I found on the forum that it's possible to create a Max object using the newinstance() function. Is there a way to do this with a MSP object?
    Thanks, Toshiro

    • Dec 03 2009 | 11:51 am
      It would be pretty tricky, as you would need to set up and call the dsp method of the internal object from your dsp method.
      If you really want to do this, I would suggest writing your own send~ and receive~ type of objects. Then your objects could have a callback in their perform method, and your host object could register to receive the callback.
    • Dec 08 2009 | 10:53 pm
      Thanks for the input, Timothy. Yeah, I was thinking about how I will have to implement my own call to the DSP method, too. Just curious, is this possible at all?
      I think I will implement my own send~ and receive~ as your suggestion.
      Thanks! Toshiro
    • Dec 08 2009 | 11:38 pm
      you can create inlets and outlets as well as s/r or any other stuff using scripting.
      stefans "st.ools" patches should have working examples for that kind if stuff.
      but of course an abstraction which uses scripting to [thispatcher] to dynamically change the number of inlets will only work in maxmsp, and not in standalones.
    • Dec 09 2009 | 10:47 pm
      I was originally working in max using scripting to make inlets/outlets and send~/receive~. However it got to a point where I was doing too much scripting and was very inefficient. I started writing this in an external format and trying to figure out if I can still use the receive~ internally in the object.
      Thanks for the reference to st.ools. I've heard it before, but never used it. I'll take a look at this, too.