thispoly~ need help !

equanimous's icon

Hello all,

I have made this complex ~thispoly wrapper.

I'm currently having issues with note hanging.

The syntax to play a frequency is :
id,
frequency*100,
velocity,
panning,
unused

Here an example to play a 440hz with centered panning:
midinote 79030, 44000, 127, 0.5, 1

I know this patch is pretty complex, but it's working 90% of the time.

Any polyphonic masters out there :) ?

Thank you for reading !

poly_v1.maxpat
Max Patch

Jean-Francois Charles's icon

Hi, it would be easier to test it out if you sent a simple host patch (the patch with the poly~ inside), as well as your "Panning.maxpat" missing abstraction.
J-F

equanimous's icon

Hello Jean-François, thank you for taking the time to look at it !

Here is host patch (PolyWrapper) and the panning patch.

Thank you again !

Yanic

PolyWrapper.maxpat
Max Patch
Host Patch

Panning.maxpat
Max Patch
Panning patch inside the Poly_V1 patch

Roman Thilenius's icon

i would not use receive in poly, and i would first of all not mix receive with inlets. it is a classic error source for order problems. add a dynamic number of voices, dynamic DSP and scheduler settings and max4live, and you are lost.

Roman Thilenius's icon

you are connecting both the signal and the message outputs from adsr to thispoly.

connectign the signal to thispoly causes that the voice is turned off already when the sustain level is zeo.

Jean-Francois Charles's icon

A couple of quick observations:
- you could use 'mutemap 1' to [poly~] to report then print your mutemap. For that, you need to add a [out 1] in the poly patch. You would then realize that all of your voices are always on. You need [loadbang] 'mute 1' to [thispoly~] inside the voice to turn it off by default.
- the midinote message is very specific. It's difficult to enter a voice that is already playing because it will be flagged as busy... The midinote message enables you to enter the voice you want to turn off, but only because it's looking at the first parameter, treats it as a midinote to keep track of, and at the second parameter and checks if it's 0. You are not using midinote this way, so you can't really turn off your voice the proper way... That's why you have to use a last resort solution like allnotesoff.
- although I think that part of the patch could disappear, check your pack/unpack to set velocity to 0: it has just 4 arguments, then you feed that to the pack with 5 arguments. Be aware that the 5th argument will be the last one that entered the pack, not the '0' that appears there.
- try the "factory" [pan2S] abstraction for panning: it's doing equal power panning.
- (also, you probably won't use parallel for such a light processing power patch.)
[poly~] is a wonderful object... takes time to get to know it...
All best.

equanimous's icon

Thank you both for the clues :D

@Roman: I have tried to remove the message cord between the adsr~ and thispoly~ but the new sound was always restarting the old one. I have just kept the signal cord and it seem to work.

@JF: I didn't know about the mutemap. I have added the mutemap 1 message and I have seen the zeros. I have tried to place the mute 1 with the loadbang inside the patch but now nothing is playing. I don't know why.

It seem that after loading the patch I can reproduce the note hanging. I normally simply change the nb of voices to set back to silence (allnotesoff not always working...). After that, it's seem there is no note hanging. Need to test more to confirm.

I think the solution reside in the mute 1 point but cannot be sure.

What do you think ?

And hey thank you again, this problem as been a rock in my shoe for a long time !

Yanic

Jean-Francois Charles's icon

'mute 1' means that the voice will be muted. So, it's normal that you don't hear any sound. If you use it with a loadbang inside the voice patch, you will get all 1s after load on the mutemap report.
Now, you will be able to check when a voice's audio is active/not (mute 0/1). "Of course", this is different from the busy flag.
If all of this is unclear, I'd recommend going again through the poly~ tutorial "Polyphony Tutorial 1". Don't look into "thehardway", but study especially "simple_poly" (not using mute), then "poly_using_mute". Then, you'll understand what [adsr~] is doing relating to the busy flag and mute state, which should help debug your patch.

Also, you could just use poly~ for polyphony, without dealing with savine processing power: in that case, just don't use any 'mute' message. All voices will be on, like in the "simple_poly"example.
J-F

Jean-Francois Charles's icon

I would suggest you start with a simpler version of your poly~ voice, addressing it with a 'midinote midinote-number velocity-value' message.
Before that, you could also try to modify the "simple_poly" tutorial example so that you give the on and off from outside the poly~. For that, you will use the 'midinote' message instead of 'note'.

Convert the midinote to frequency inside the voice.
Then basic things work, add other parameters after velocity...

J-F

Jean-Francois Charles's icon

Actually, when I say "modify the simple_poly example" I almost mean "study the adsr~ help file". It should be a good starting point to build your patch.

equanimous's icon

Thank you very much Jean-François, I was able to fix the problem and simplify my patch going through divers examples and reading your posts. I will surely optimize later on with voice muting.