ShelLuser wrote:Poly will look in Max' filepath, and this doesn't include the Live library. Hence it won't be able to find your "external" (that's basically what you're setting up here; a patch which will be used in another patch).
this is not correct. while max does look in the max search path, however you have set it up, it ALSO looks in the directory local the the max patch and/or .amxd device. this can be simpler in some circumstances when you do not want / need to reuse patches.
the op's patch is almost correct but with some problems. whilst flow designer is right to point out the divide by 127 for velocity, it is crucial you divide by 127. and not 127 (ie, a float and not an int). also, while the list idea for the adsr values as a list is a good one, the POINT of using adsr~ inside a poly~ abstraction coupled with thispoly~ is to save cpu usage. how? - because coupling with thispoly~ auto-mutes voices with sample accuracy when envelopes engaged / disengaged in their different stages ('release' point etc). [furthermore, if the ONLY messages being sent to the parent poly~ object will be global anyway (e.g. adsr values), you could just use the instantiation attribute '@target 0' to the parent poly object itself].
ultimately though, what the op should do is the following:
- open the adsr~ helpfile (alt-click on the object)
- once open, double-click the 'p polysynth' subpatch near the bottom
- study this patch and look inside the poly~ abstraction therein - this abstraction does exactly what you are after in a simple and effective way.
NOTE, your (and the example) poly~ abstraction REQUIRE your midi data to be sent into the abstraction using 'midinote $1 $2' or 'prepend midinote' or whatever means before your pitch/velocity list.
crucially, swapping the ordering of the pitch and velocity is important, and using the adsr~ sample rate information to do all the voice muting etc for you is a little more effective. AND, using sah~ might be useful to you - see what samples the input and see how thispoly~ is patched up from the adsr~. while the patch of the OP demostrates a correct use of the master envelope going directly into thispoly~, when you have an adsr~ in your poly~ abstraction you might as well be using the added benefits of that to do you dsp management.
hth.
p.s. - if you continue to have problems with the poly~ parent finding your subpatch, be sure to double check exactly where it is in relation to you master patch / .amxd.