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?....
-
Polyphonic voice management using \[poly\]
-
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?
-
@Fauveboy You can have more than one argument...... try $1 1.... $1 2 etc. and use the second argument ($2 inside the patch) to differentiate....
It looks like you are starting to get the hang of it........ let the fun commence!
David. -
@Fauveboy Whatever works for you. The more advanced approach is to put $0 to every send, receive, array, text and struct object so every patch and abstraction is always separated and will never interfere when you for example open the same patch twice. So with this approach everything is separated, because you use the $0 of each abstraction inside the abstraction, which is great.
But than how can the abstraction communicate with the main patch? The solution is to give the $0 via creation argument down to the abstraction. Than inside the abstraction you know the $0 of the abstraction and the $0 of the main patch.
For example when you have an array in the main patch which has $0 in its name, you can not access it from within the abstraction because $0 of the main patch is unknown. But you can give the $0 of the main patch as creation argument to the abstraction, so now you can access the array via $1 (if its the first argument) and everything is perfect.
Here is an example: dollar-zero.zip
-
I dont think I understand just yet? is there a chance you can make sense of my code does what you're saying apply to it? Im sure I just need to mull over the logic you're explain but it just hasnt clicked yet.grid2.pd gridSamplerptest.pd voicePTest.pd
when you say via the creation argument…is $0 the creation argument?
I need gridamplerPtest $0 to be 1 because it is coordinated with the grid interface hardware with zero does it not remain as a four digit number?