I think of it like this when it comes to arguments: whenever you write a $0 or $1 argument in an object, they address the arguments of the patch they are in, which means the unique $0 of the patch they are situated in, or the argument of that same parent patch in the case of $1. Like this you can pass down arguments in a russian doll fashion even when you have many layers of nested abstractions.
-
Polyphonic voice management using \[poly\]
-
so now the voicetest is an abstraction I write them like so? but then the tabread4 object read from a different table number other than the table which is i.e 1 in gridsamplerptest as well as the the other objects?
-
@Fauveboy In the example you poster earlier they had the $1 argument. That works.
-
so ive returned the it to voicePTest $1. i think for some reason the catch an throw objects are having trouble with the arguments they have perhaps....this screen shot is with the DSP on but the values arnt passing to each other here?....
-
is there a difference when using $0 or $1?...just realised that $0 is assigned a four digit value and $1 indicates sequencial arg.
Im getting warnings saying things are getting multply defined which suggestes the voiceptest's are deriving the same arg val?
-
@Fauveboy Yes there is a big difference. Everything that needs to be unique for the calculation of each voice needs a $0 (unique for each instance). If they get the $1 then every throw and catch in every voice will be having the same name.
-
inside gridSample is where the audio sample is loaded. there are objects which send that file size ect to the voice abstract that have arguments of $1 if they were $0 would they not be different from the voice abstract and therefore not receive the data ?
-
@Fauveboy Yes that's right. In the last patch I sent you and in the last picture you posted those do have $1 (the chunk size samples etc). Where are you getting errors?
-
Itts hard to say theres no specific error messgaes? Just warnings explaining about multiply defined
-
@Fauveboy if you go menu > find > find last error it will tell you which object(s) is causing the error.
-
ah yh i see its currently the throw~ $0-declick object
-
throw~ $1-declick doesn't cause an error...but the signal doesnt reach catch from throw using $1?
Are they not local variables to each other? -
@Fauveboy Is there just one throw and one catch in each voice abstraction? In that case replacing them with s~ and r~ might solve it (keeping $0 of course).
-
okay thats fine actually thats worked thank you.. the issue now is that only the 1st voice abstraction happily plays the audio file back ? Is that some thing to do with the arguements the voice are or arn't deriving ?
-
@Fauveboy Whenever I work on something polyphonic, whenever I make a change to the voice abstraction and save it, it doesn't always update all the instances and therefore only the one you modified plays. You could try closing the whole patch and reopen it.
-
@Fauveboy Horribly tired and unable to follow....... so I might be wide of the mark. Playing audio in abstractions is complicated by needing to get $ variables into a message.
I made this a while ago and it might give some insight/understanding into/of what is not working.....
But it might not...... you might already be beyond this stage.........keyboard.zip
And it might not expose the problem at all.......
David. -
@whale-av said:
Thanks David is this you back from Prague ? Hope your time was good! your code makes sense we've got difference instances of the same code using an arg no. and then using a message to address a particular abstraction......the issue with my code is i have the main body grid2.pd this contains an instance of an abstraction which is the following gridSamplerptest.pd
inside this one "gridsamplerptest" we use an array to unload an audio file. this is informed by the number given to the gridsamplertest X arg ....inside gridsamplerptest i have another four instances of the same abstraction which is voicePTest.pd it receives a note and velocity...however i believe that from there behaviour they don't differentiate from each other.... i.e velocity can be sent to one voicePtest but the signal will be coming from another voicePtest instance?
-
@Fauveboy This is because the voicePtest abstractions all send on the same channels. $1 in objects always resolve to the first creation argument of the abstraction. In your case, every voicePtest abstraction has $1 as creation argument which again resolves to the first creation argument of gridSamplerPtest, which is 1.
So for example [s~ $1-phase] becomes [s~ 1-phase] in each voicePtest abstraction.
General recommendation: Use $0 as a unique number inside each abstraction. Use creation arguments together with $1, $2 etc. to provide information from the parent to the child abstraction.
The creation arguments are shown in the title bar and you can do this to find out what is going on:
[o] <- this is a bang | [f $1] | [print]
and
[o] <- this is a bang | [f $0] | [print]
The results may be different or not for each abstraction or patch, so this is a way to examine your patch and find out what is going on. And yes, all those $-variables will be just numbers in the end (Although you can also use symbols as creation arguments.).
-
Okay does that mean $1 for the voicepTest args so they get the number from the gridsamplerptest but all the objecs inside are zero? Then they'll use different channels from each other. But in doing that im confused as to how to get has to get the values from the sub patch in gridsampler which include sample size into voicePtest becuase they have $1 for there argument which ould be a different channel to reach args inside voicetest now with $0?
-
the design only has one array. is it becuase for polyphony to work with a sample there needs to be multiple arrays? I was hoping just one array can be read multiple voices On the left is the load sample sub patch in the gridSamplePtest but these send and receive objects arnt going to reach separate voicePtest abstracts like this from one place are they?