Array Nodes - Handle many same-type elements

Currently, there is no easy way to handle multiple elements of the same type. Manually adding and wiring them up is both tedious and error-prone.

My suggestion is to add a set of dedicated Array Nodes that allow handling many or even massive amounts of the same data / element.

Primitive Types
For primitives like bool, float, text etc. I would suggest adding nodes that include the type + array suffix:

  • Float Array
  • Text Array
  • …
    These nodes offer a “Count” parameter and a “Select” parameter to select a specific value in the array. There is one in and one out pin that allows to set / read the currently selected value. The selected value can also be entered directly into a input box if desired. There could be a UI that displays a text box, listing all values and allows typing in all values at once (comma-separated). The count could even auto-set via this text input box - but there should then be a checkbox to tell the node to use a “Fixed Count” - even if the user does NOT enter all values. Maybe a “Default Value” could fill in the blanks.

Module Array
This is the much more complex one and it requires my feature request regarding bus pins / cables to be already implemented!

The Module Array is using a node structure inside it as the array type - so in some way it is working as a Module (with Count instances), because you can define any type of structure in it. This inner structure defines the content of each array element.
There is one fixed in and one fixed out bus pin inside of this Node Array. These fixed pins cannot be deleted at all! They control the data flow to and from array elements.

The Module Array also has a “Selected” parameter that allows to select any of its array elements and there is one single “Selected Input” bus and “Selected Output” bus pin that connect directly to this selected instance.

Additionally a fixed input for the index of the actual instance and the total count in the array and also the currently selected index shall be provided permanently as input data into the module for using it in a generative way.

On the outside of the node there is also a “Count” parameter that controls the number of elements to instantiate. This Count also defines how many bus input and output pins the node has. So you always have Count number of inputs and outputs.

As the bus pins allow to transport any data into and out of the structure you can define anything inside of the Module Array to be part of a same-type array.

I think this would make handling many same-type instances much more comfortable!

Hope you like it :slight_smile:

Added this extra passage to my initial post:

“Additionally a fixed input for the index of the actual instance and the total count in the array and also the currently selected index shall be provided permanently as input data into the module for using it in a generative way.”

In the meantime, the new Script node (1.1.5) runs JavaScript code that can be written to handle variable length arrays of types that can transit a data wire. Not as cool as having a dedicated Array node but a decent workaround and fairly straightforward to implement.

Here is a quick example:

Variable Length Array.mnprt (16.4 KB)

Yes, I have seen it. It’s quite nice :slight_smile:

However for me the even more interesting part would be to have this Module Array. It’s still unexplored terrain though!

I believe the bus pins are a part to be discussed. Currently my suggestion was to have as many in/out pins as you have array elements in a Module Array. But thinking more about this I would rather assume we should have only a single bus in and a single bus out for all array elements which would be a bundle of busses from each of the elements.

We then rather need more array handling nodes. These would do things to arrays - and also bus bundle arrays - that are currently not explored - like summing audio ports up e.g. or selecting one with specific properties and so on.

I believe we should go one step at a time to find the right solution for complex array structures. But I believe it’s worth exploring this area. Because it could do things that are currently very messy.

Let’s see where this might lead us :slight_smile:

This would also open the possibility of a novel additive synthesis framework. Basically you have 3 arrays for Ratio, Phase, and Amplitude - one array component per partial. Then you have a set of nodes that work on these arrays, and a sinebank node at the end generates the sines given the arrays.

I already prototyped this in Max, which I was working on before I moved to MNodes.

If you can get this array node I will start looking into re-building this framework in MNodes and it could be a big win - synths like Razor are prized amongst electronic producers and having a modular additive synth would bring some attention to MNodes in general. I can dev that if we start gettings the nodes needed - it would need sample rate read/write. Its called Raptor - named after the 3 fundamental parameters mentioned above (RAP)

hey, sending arrays from one node to another means changing a lot of things deep inside MNodes, so I’ll probably wait a bit before adding it. I want to get it right.
In the meantime, Nucli can already do the additive part inside a single node. It has tables, so you can keep a Ratio, Amplitude and Phase for every partial and play them all as a sine bank.