panning in poly~

artmusicsouth's icon

I am trying to implement panning in this synth patch. Rather than applying the panning to currently active voice it is global.

I am sure it has something to do with a target message that I am not sure how to implement yet.

I can't get the code to post so I am attaching the patches.

cyclesynthSimpleFM.maxpat
Max Patch
synth-data.maxpat
Max Patch
Peter McCulloch's icon

s/r are global, whereas in 1/in 2/etc. can be local (they can also be global). Change "r pan" to in 2, then before sending the pan value into the second inlet in the main patch, specify a target.

(e.g. target 3, pan 50)

Alternatively, if you want it to change on a per note basis, send it in as part of a list with the "note" message, and unpack from there.

artmusicsouth's icon

That makes sense. I'll try that as I do want it on a per note basis.

artmusicsouth's icon

I tried both and neither works for me. Most likely operator error. in2 does get the line from the panner in but is still only global. I tried prepending @target 0 to the line message but I just kept getting the error "doesn't understand @target".

I also pack the list together using "pack 0. 0." --> note $1 --> to poly~. I then unpacked inside poly with unpack 0. 0. but got nothing for panning.

Peter McCulloch's icon

Try using "prepend note" instead of the message box. (the prepend object with "note" as argument)

- Note $1 means "note first_value_in_list", so you won't get the pan value that way
- It needs to be "target" instead of "@target"; also if you use 0 it will target all voices, IIRC.

artmusicsouth's icon

Still not working. Using pack/unapck it still seems to target the global pan rather than note for note. I've attached the patches.

synth-data1.maxpat
Max Patch
cyclesynthSimpleFM1.maxpat
Max Patch
artmusicsouth's icon

It may be working now. I think I just didn't have enough data going through.