@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?
-
Polyphonic voice management using \[poly\]
-
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? -
@Fauveboy [someobject 15 13] <- 15 and 13 are the creation arguments of someobject. Yes, $0 is a four digit number.
-
@Fauveboy Here another demonstration: dollar-args.zip
-
Okay I think I've got this thank you very much. So...
In the main patch I havegrid2.pd
1st abstraction gridSamplerptest.pd takes the arg $0. (although if I want eight of these maybe I just give it a argument which is 1,2,3 etc?)…actually i would just copy and paste it 8 times
and they would have different $0 values inside them anyway….Inside gridSamplerPtest I use the $1 to use the $0 from the main patch.
in the load.sample subpatch in gridSamplerPtest I load a sample. although for some reason when I go to properties on the array I’m not sure why but it ignores the “$” for the $0-table,so I’m getting errors at the moment.
There are also send and receive objects in load.sample that take the arg $0 because i want these to be unique to this particular gridSamplerPtest abstraction. the more important of these send and receive objects send data of the sample length and phase position.
in gridSamplerPtest i also have the abstraction voicePtest "$0" maybe this is irrelvant if im using $0 inside it?. making thesvoicePTest.pd particular abstractions unique to this gridSamplerPtest $0
inside voicePtest I use tabread4 table$1. $1 will ensure that it reads the table in gridSamplerPtest subpatch load.sample (when its not giving me errors) hopefully.
The pitch will vary between simultaneous button presses of voicePTest $0 . I need to make sure that the result of the value sent to adjust the pitch in an individual abstraction doesn’t send to another abstraction outside it…so with some objects where i don’t need to receive data from gridsamplerPtest I use $0 again so it only sends data with the abstraction its in.
This should work if I can work out whats happening with $0-table?
another note i have. Previously when i gave gridSamplerPtest an argument it was a number that correlated to an x y cordiniate on the monome grid based interface hardware.
so gridSamplePtest 1 would get received by an object such as x = $1. but I guess I got to use a different method to relate the number of gridSamplerPtest the rows located on the grid….
-
@Fauveboy Yes, $0 unique within the abstraction..... and within the parent.
If you have made an abstraction [abstr 1 2 3 $0] then actually the $0 value from the parent will be given to any $4 in the abstraction (its the 4th argument)
In the abstraction you would have ...... $1=1 $2=2 $3=3 $4=1001 $0=1002 (for example).
So in the parent $0=1001 = $4 in the abstraction.Can you zip the whole patch again and post....... it is easier to unwrap then copy/paste/save/rename all the patches separately......
and I cannot find your $0-table........ in the 3 patches you have posted.The reason for the error in the table is that the $0 in the message [read -resize.........] is not $0 as an argument because it is in a message.
You need to pump the value into the message....I am sort of hoping this will be your Eureka! moment, now that you have learnt so much.......
David.