Problem with adsr~ and poly~
Started this patch last night, and what I thought would be simple has turned into a large problem. I want my patch to be polyphonic, and for the sustain of each note to correspond to the length of time a note is held. However, I can’t seem to get the poly~ and the adsr~ to play nice. The polyphony abstraction works, but only with a fixed sustain time. I am using the Velocity outlet of the notein object to trigger the adsr~. This would work in a monophonic patch, but when sent to the poly~, the messages are out of sync, causing the adsr~ to switch off when a note is played, and on when it is released.
Sorry for the spotty explanation, I have attached the patch and abstraction. I’m sure there is a simple fix for this I have overlooked and thanks in advance for any help given.
Check out the poly~ tutorial on this site. You should be able to modify the demo patchers to get what you want here. Let me know if that isn’t adequate.
Thanks, I checked out the tutorial and created a new patch based on it. While I now understand adsr~ better, I have run into a new problem. I can now have the adsr~ and poly~ working together, when I try to add my voice selector (cycle~, saw~ etc.), the polyphony stops working and I am unsure as to why.
I used a selector object in the ProjectPoly abstraction, should I be doing something differently?
Modify your poly~ with the @target 0 attribute.
Yeah, Chris is right, anytime you want to send data into a poly~ object, you need to specify which voice ("target 1, 2, 3, etc.") or all voices ("target 0").
I’m not 100% clear on how this works. Chris, can I just send the target message to a particular inlet once?
You can either send it via a message, or use the attribute "@target 0"
Okay, so when I send it to one inlet, I’m sending it to all inlets? And when I set the attribute, I’m setting it for all inlets? So if I want to send a different value to each voice, I have to change the target value/attr before I send each value?
Thank you, that fixed it. I feel like I should’ve noticed that, but to be honest, I never would have done that myself. I’ll take a look at those examples as well.
To use a different value for each voice, include the value in a note or midinote message. These messages are typically a pitch-velocity list, but they can be as long as you need to send all the parameters.
The MIDI pitch number is used to allocate voices, which is why the mtof object is usually inside poly~.
Check out the adsr~ help patch.
Oh that is awesome. Thanks!