Using [midiformat] inside a [poly~] to assign voice/midi channel

srs's icon

I am trying to use a poly~patcher to create midi data that is sent to mpeformat, but I can't assign the voice number from within the poly.

The use case I'm trying to solve is converting touch data from an Erae interface into mpe output. The data is arriving into Max via OSC and I'm packing it into a dict that is sent to the poly~. The reference point for this approach is the 'Contacts to MPE' project by Sensel which also uses a dict to store the raw touch data (x, y, pressure) and send it to a poly~.

The problem is that I need to use an id value from the dict to assign a midi channel to the data but I don't know if midiformat even works that way inside a poly~.

Is there a way to use a poly~ to generate midi data and assign the voice or midi channel number from inside the poly~ itself?

Attached are screenshots of the poly patcher and the parent patch that is sending the dict into it and routing the output to mpeformat.

Roman Thilenius's icon

i see no reason here why you use poly~ at all, but i also don´t see why data generation would fail only because it is done within a poly~. does the patch work outside?

srs's icon

Yes, the patch works outside the poly~ and I think you're right, it would be better to use it this way and avoid the poly~ voice assignment issue.

The problem is the id's for each contact point on the Erae count upwards and I need to translate these into mpe midi channels. Based on the Sensel Contacts to MPE example, I thought a poly~ would be the best way to do this but there might be another way..

erae-osc data.mov