How to read a table two subpatch levels deep


#1

I have tables in my main patch.
I want to read them in a subpatch that is inside my polyphonic voice subpatch.
So I am reading them two subpatch levels deep.

I know with one subpatch level you use the prefix: "../"

But what about two subpatch levels? I tried "../../" and ".../" but these are wrong.

How doe you reference a table from multiple levels down?


#2

this works ok for me


#3

Which one of these works? ../../ or .../


#4

both, as expected

../test if sub patch
../../test if sub patch of a sub patch


#5

Weird. this does not work for me... One subpatch down works fine. but two does not.

But does it make a difference if the first level down is an polyphonic expression subpatch?


#6

ah, yeah im not sure this works in poly patches... id need to test.
(usually im using this technique in mono patches)


#7

Right. I need this to work in the polypatch or the whole idea of using tables for the mpe modmatrix will not work, since the whole point is to have globally available variables.


#8

Ok Damn!
I just checked with a subpatch within a subpatch... it works. but not in mpe poly patch mode.

That is a real bummer. Is there a work around? can it be fixed? For example, can we address the main patch directly without going through the chain of parents, like with: root/test


#9

I am using that type of table reference, in a poly patch and it works fine.

Attach a screenshot maybe?


#10

nope .. not possible as far as i remember.

(that said, id need to go double check the generator code, see if there was a special case defined)

the underlying issue is...
any reference in a polyphonic voice is considered to be 'per voice', there is no way to differentiate common elements like the reference to the parent.
there is no way to go from the root, its relative

(*) unfortunately, given 2.0.0 is just released, id not want to dig into the 1.0 code now.. as id prefer to concentrate on 2.0
(note: 2.0.0 has same 'issue')


#11

how do you do it?

here is an image of mine:

as you can see it is two levels down...


#12

Ahh but my subpatch is not MPE. It works for regular poly, haven't tried MPE, though. Which Technobear says might be an issue.....


#13

is there a way to use the poly/index to find the table in the main patch?

is there another way to do it? I thought maybe i could put the tables in the voice patch, but then will all my tables be copied as many times as there are voices in the polypatch?


#14

That's what I do in all my patches. I think it has to be like that, that's how polyphony works, I think, that you have to assign all objects in the polyphonic subpatch to each of it's own voice. Or else it will not be polyphonic.


#15

Is there a way to implement poly mpe manually?
I mean without using the subpatch settings.

If I copy my voice 4 times, make them each mono and make them react each to a single channel, wouldn't that be equivalent to using the polyphonic expression subpatch setting?

that way I could use the table properly.


#16

Also, why would this functionality be different in normal poly vs mpe poly?


#17

k, just to confuse things :wink:

in 1.0.12, yes its specific to polyexpression - looks like a bug

in 2.0.0, the issue is with all polyphonic sub patches, as there is a bit of code generation that has not yet been 'ported',

I cannot think of a workaround... other than writing a custom object, which can bypass the issue by not using attributes (and parents)


#18

I guess this is what I have to do...

How do you access tables in objects?


#19

you use attributes (see table/read as an example) to get the names,
then you need to be very careful of things likes scaling (again see table/read and write for examples)

but its very likely you do NOT want to do this... since if your not careful you'll just re-create the same issue in your own object :wink:
what you want to do is a singleton pattern (or a global static if you wanna be a bit hacky) , this will then be in scope to all objects, regardless of where they are in the patch.

(note to self: I need to have a look at this in 2.0, see if the new memory/patch layout changes this at all!)


#20

Thanks @thetechnobear

Are there any beginner resources for this?

I've never even heard of singleton patterns. I don't mind being hacky but I am a real beginner in c++. I don't know where to start.

If I could access the tables in an object and do all the computations within the object, I think I could save a bunch of ram. But when a table is read within an object, within a subpatch, is it still two subpatch levels down? Because if it is essentially just one level down, then it could work. Right?