Creating dynamic instances of shapes using

    May 08 2013 | 6:54 am
    I'm curious how one would go about creating dynamic instances of a shape in MaxMSP using either,, or another object that might work. In other words, I want to create spheres using bangs with dynamic starting positions and movement based on input data (simulated or otherwise) using only one (or a couple) object(s).
    In a scripting language I would do this by creating a class called MyShape and define the shape and variables that would control its position and movement. Then I would initialize the class and create one or more instances every time my trigger event happened using a for loop to give each instance a unique name: MyShape1, MyShape2, etc. After that my input data would govern the movement of the instances via variable set up in the class.
    How would one do this in Max and with what objects? I'm guessing would be best but I'm not sure. Could it be done with, or In this case I would most likely control the movement of the spheres via

    • May 08 2013 | 11:03 am
      my understanding of is rather shallow, the way to control it via matrices seems rather cumbersome for your task.
      But you could use a Java external that does exactly this. You can create a (or or even wrapper class and instantiate it with your bang. obviously you need to sort out how to manage and animate those instances. it should be even possible to add a to each wrapper (linked to the or or, this way you can control the appearance and its animation with one instance...
      it all depends on what you wanna achieve. certain things are easier done with scripting languages.
    • May 09 2013 | 11:34 am
      @cclavio, there are many many ways to approach this. I'll list a few below (there are many more). Which you use, will greatly depends on what you like coding, prior knowledge vs. wanting to learn more, style of patching/coding, etc... * Do it all in procedural coding of java, LUA, or javascript. * Do it all in patching using * Do it all in patching using matricies,, * Partial combinations of the above
      I suggest you look at the Jitter Recipes. There is good code there that you can use for your own. Some to look at include: 00, 06, 09, 19
    • May 15 2013 | 1:27 am
      In my opinion, the easiest to use of the objects mentioned is
      Here's a simple example:
      The section labeled "DETERMINE SHAPE + POSITION" could then be encapsulated (see Basic Max Tutorial 'Encapsulation'), and duplicated to create instances that could be triggered (see counter + select combination). You could potentially keep the encapsulated object in [poly~] as well for cleanliness of the patch.