Iterate over 2D array



  • Hey guys,
    Got a question involving a 2D array. I have a very simple example that looks like this:

    const var knobArray = [Content.getComponent("Knob1"),
                           Content.getComponent("Knob2")];
    
    const var allgains = [
                            Synth.getEffect("Simple Gain1"),
                            [Synth.getEffect("Simple Gain2"),Synth.getEffect("Simple Gain3")]
                        ];
    

    I would like the index of knobArray to control the effects in allgains Array
    So...
    knob1 controls Simple Gain1
    and
    knob2 controls Simple Gain2 and Simple Gain3

    I can't figure out how to get the index of knob2 to control both effects of the corresponding allgains index.
    Any ideas?



  • @dustbro Is it what you need?

    HiseSnippet 1162.3oc6X0saaaCElxNbqVconcXO.Z4Jazr.Ym9GP1PchSRgQWRMl6Z6PPPGsDULQnHMjnypWQdP1tZuF6t7zrq2av1gTxVxo1NtFXAKaVnEA7vyg767wi9NzpUjziFGKiPVkd4fdTj0mgaOPn51nKgIPM2EYcG7AjXEMxIwzNC5Qhio9HKqhOSavpzJHyye9zcHbhvilYBgdkj4Q+VVHSkYsU8my378I9zWxBy48Cp2zSJZH4x9.dJhcQ8HdmRNgdHQ6VALx5S1ymojQsUDEMFYsxNR+As6J+IQh+uhEy5vo5AUQsgEJw79RtuFwZqnFcYb+VCy6XDrJsxXghIrvWfOf4yFYOiMtqYBmrHxyGVElE7pd0vycRvyJG7VIAd2C21Kh0SkMiFa2F2T.GTAD3HHOrR7EU3OJhaHAODpMBImR2OBFLJhxOx0ccmG55VYqUsW0FNHhUNmQhbNUH6rcTDYfy23bzv3OgpZHC6IEvfxq8bvkpqUYcamI+L8npsVki2xN2tQ37S.tNVuYGYpD0QsWP.0CBoMKrGm5nq6f863osgyLPXKW2YVNrIrxGCjvjWaM4L1vo41zryDblf5DzW3oXRgiTXnOMGEI4k8FRPqC7AuOsxp1ueU6RC4kibOF92FwT01JUDqSeEs7klSmCNCiFxiyg+OyyM8pkt8Mf0pC7RW4wQURMwkR84HqpcEYUfLxoLCNqc2xg470iN8Op5wavohSTcA62+9Uz9lrOl+jysiXSiLRlabxvtz4WEeTaV7Qsb7QtT8Poh9BQ4J1u2tj841NWdpffINW5hwoQSbZs3XzrBrrneXGZzvranifJw3xP2d9jg7R3jbNJEMEL0K5QSGmWGcXVObVWznjMuorbLuUSpMA2xL8g5fnzyLPQrPp6fqJid3cR0CayY9zHDCv3mhMEvHC2j1i4GCBru.M2AW6xA+kWf99l6RTDspbJb.H1iFoXZh1ZW5YP6tDM5R3cowmpj8L3MsFCYYekH9cYcDec8AYCdS8Poe5B6w5P4nv7se+gKBIuKeqWnocu1re1f+e8WzO+9Si6GDv.uvXG+cf3884zVxXltvJK1ZZRZtQbsbH9BYNDW+ZEweXWRnWszuOmnFuAtVRHcB8ZjuSotan.V6A4uUyGQWc249RGyKbuGtES40cx3svDvq90i+gwa5cjVEmz7LCrqf2+MWCWHpXNrbqQ2Z0z.+YY2ZM+cEl1sV+MsfvtTNYLB70LeU2bko0mv8ZaJNCdqukjShtL8Wb7bt37kyWw8RmcMhoK2MlZ5OGan7aR.1TRbyAv2E2h7ugBhuS1WwDmb.AtclVC+v9gsgebmGEfpPP4vFgsJn6smL1UOVCn1TguYveAOoSVUO1JcxpCmD8wJFTaZhAlF7KECVJFrTL3+MhAatTLXoXvRwf+aJFbcrGgDuH4a8R9jB5WMukwBj2ByGstD9.8XmQeHBL1cCW8uik8VOO8OY5q.9YxwTaAhYyEHlGr.w7vEHlGs.w73EHlmLyXze+9s6qjgI0+fgV6Y9lNVV6IHPkr4UAzeCFQJtqB
    

    EDIT: Nope sorry, knob should be in array... wait a minute...



  • @dustbro Here you go 🙂

    HiseSnippet 1158.3oc6X8taaaCDmxNZqVctncXO.DY.E1nYAJNscaHanNwIovnKIFycscHvnfVhNlvTjFRzYwqHOHauI6a9AnOL6MX6n9ikRihiqAVvxl0mLu69c72c93cTpkuzgFDH8QFkd43gTjwmY1drP0uQeBSfZtKx3dlGPBTTebjncFOjDDPcQFFEetVfQoUPgO+4y1gvIBGZpHD5URlC8GXdLUpzV0eAiy2m3ReIyKi0OtdSGongjKGA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