Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

drohnee
Posts: 26
Joined: Mon Mar 07, 2022 8:26 pm

Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by drohnee »

Is it possible to transform Polyphonic Aftertouch messages to Channel Aftertouch using the Multifaceted MIDI Transformer? Am demoing the module now, and do not see a way to perform this particular transformation. The hurdle is that the Pressure value is in data byte 2 for polyphonic AT but in data byte 1 for channel AT, and it does not appear possible for the user to change the byte order in the transformation.
User avatar
utdgrant
Posts: 687
Joined: Wed Apr 07, 2021 8:58 am
Location: Scotland
Contact:

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by utdgrant »

I think that would lead to all sorts of horrible glitches. If you were pressing two keys on a poly AT keyboard and merging both poly AT streams into a single channel AT stream, then each new poly AT value would instantly 'overwrite' the previous one, regardless of which key generated the most recent value.

Depending on the sensitivity of the poly AT keyboard, you could find yourself rapidly alternating between high and low values when playing one note softly and one with a harder touch.
______________________
Dome Music Technologies
ColinP
Posts: 1037
Joined: Mon Aug 03, 2020 7:46 pm

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by ColinP »

Why do you require this facility? I'd presume that any keyboard that produces poly AT will also produce channel AT. Is this not the case? Or perhaps you're dealing with a MIDI file where channel AT has been filtered out? Very curious.

As Grant says, any simple translation mechanism would be unstable as the AT value would jump around. I guess a dev could write a module that tracks which keys are down and computes an average of their poly AT values (maybe with some added slew to make it smoother) but I can't think of an application for such a module as everybody would just use channel AT instead.
ColinP
Posts: 1037
Joined: Mon Aug 03, 2020 7:46 pm

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by ColinP »

Thinking about it a little more, one would probably just use the maximum poly AT value of any keys that are down rather than an average of them. So the value returned would be from whichever key was being pressed the hardest. My guess is that this is probably what poly AT keyboards transmit as channel AT.
Steve W
Posts: 827
Joined: Thu Jul 16, 2020 5:55 pm

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by Steve W »

In the 1980s as a hobbyist I wrote a Commodore 64 assembly language program to convert 2-byte AT data to 3-byte CC data. Called D0B0, it took the Casio DH-100's channel aftertouch and played a Korg EX-800's CC (probably modulation). But the channel remained the same.

I have not coded anything that transforms poly AT, but it certainly looks possible to convert it to Channel AT. Getting the desired result is a different question for the reason Grant and Colin gave. It really depends on what you are trying to accomplish. As Colin asks, "Why do you require this facility?"
Thinking about it a little more, one would probably just use the maximum poly AT value of any keys that are down rather than an average of them. So the value returned would be from whichever key was being pressed the hardest.
I can think of other approaches, basically different ways of handling cases where more than one note is on and sending per-note AT data. But it all goes back to, "Why?" i.e., what is the desired effect?
Status Byte: Indicates that the message is a polyphonic aftertouch message and specifies the MIDI channel.
Key Number: Specifies which key on the keyboard is being pressed.
Pressure Amount: Indicates the amount of pressure applied to the key after it has been initially depressed.
drohnee
Posts: 26
Joined: Mon Mar 07, 2022 8:26 pm

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by drohnee »

The motivation for the original post is that I am using a pad controller that outputs poly AT and I want to use the pressure values from a couple of the pads. The hardware could be switched to output channel AT, but I cannot switch it quickly enough in the context of performance so I need to leave the hardware in poly AT mode.

I am aware that playing polyphonically on the controller could be an issue in this scenario, but I am usually only using the pressure from one of the pads so it is effectively a monophonic signal. I am currently using a custom script that takes the maximum key pressure value across a given MIDI channel and outputs this as the channel pressure value, which is fine for my case. But I thought I would see if I could get something working with VM modules rather than relying on external plugins / scripts.

Colin, if your MIDI Trap module had a Pressure / Poly AT Out jack, I could wire up a couple of those to solve my use-case...

Thanks for engaging with my question.
Last edited by drohnee on Sun Aug 10, 2025 5:45 pm, edited 1 time in total.
drohnee
Posts: 26
Joined: Mon Mar 07, 2022 8:26 pm

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by drohnee »

It occurs to me that another option for my use case is to use Granular Synth + GS MIDI X to get poly AT CV signal, if I pre-filter the MIDI so the poly AT is only extracted from particular notes.

Update: (ab)using GS MIDI X in this way does not get the desired result. Might just stick with a custom script for now.
ColinP
Posts: 1037
Joined: Mon Aug 03, 2020 7:46 pm

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by ColinP »

Ah, I hadn't thought of a pad controller. Everything makes sense now.

Have you tried sending a clock signal to SEED IN on GS MIDI X?

If that doesn't work let me know and I'll look at a mod to MIDI Trap to make it catch Poly AT.
drohnee
Posts: 26
Joined: Mon Mar 07, 2022 8:26 pm

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by drohnee »

ColinP wrote: Mon Aug 11, 2025 4:09 am Have you tried sending a clock signal to SEED IN on GS MIDI X?
Colin, I have sent clock to SEED IN to get at the polyAT value as noted in the online docs about multi-seeding mode. The issue I have run in to is that the output is not what I expect: the poly AT signal from GS MIDI X often does not return to the baseline, and the curve is not as smooth as I expect. In this image, the red trace is coming from GS MIDI X polyAT out. The yellow trace comes from running the MIDI through a plugin in the Mini Plug-In Host that converts poly AT to channel AT. Blue trace is the gate from the MIDI note. The shape of the yellow trace is what I expect, but you can see GS MIDI X outputs a more coarse shape. GS MIDI X also appears to drop some notes (i.e. does not output either Gate or Poly AT Out).
gsmidix_pressure_sm.png
gsmidix_pressure_sm.png (345.66 KiB) Viewed 349 times
ColinP wrote: Mon Aug 11, 2025 4:09 am If that doesn't work let me know and I'll look at a mod to MIDI Trap to make it catch Poly AT.
If you do decide to modify MIDI Trap to catch and send Poly AT, that would be appreciated.
ColinP
Posts: 1037
Joined: Mon Aug 03, 2020 7:46 pm

Re: Multifaceted MIDI Transformer: possible to transform poly AT to channel pressure?

Post by ColinP »

Thanks very much for that feedback.

I don't actually have a device that outputs poly AT (I'm not much of a keyboard player so just use a Arturia Keystep and my MIDI pad/knob controller isn't pressure sensitive) so I cobbled up a crude test rig when developing the poly AT code.

I've not noticed any dropped notes from GS MIDI X when its driving GS but I'll take a look at these issues as it seems like there's a problem judging by your traces and comments. It's a long time since I wrote GS MIDI X so can't remember the exact details of how the multiplexing code works.

On MIDI Trap, after you bringing this up, I think it would be a useful additional feature to have a poly AT output that tracks any poly pressure messages for the trapped note, so I've decided to go ahead and do that anyway. I ought to be able to squeeze in an extra socket on the panel so that the HP will remain the same.

I can see that with a poly AT capable controller one could get mulitple CVs that indicate live pressure from individual fingers using multiple MIDI Traps with poly AT output and that could be very nice in a performance situation.

Hopefully I can get this all sorted and through CA's QC reasonably quickly.
Post Reply

Return to “Oliver Moebus”