From my research for USB to TOSLINK, which may help with HDMI:
"""
Apple MIDI won't recognize more than 2 channels when plugged directly into a TV or via USB to TOSLINK (Optical Audio). No Apple apps will.
Being more explicit:
Mac > USB-C to TOSLINK adapter > Fiber optic cable > TV = only 2 MIDI channels
(the adapter used:
https://www.amazon.com/gp/product/B09QFYNB7Y)
The only option is to use a third party app, like VLC.
For VLC: in menu bar: Audio > Audio Device > "USB SPDIF Adapter (Encoded Output)"
(The "(Encoded Output)" part is the key.)
I used this guy's test audio files, specifically the `DTS 5.1.wav`:
https://www.reddit.com/r/hometheater/comments/11qqv95
From my research, appears as though the only way to get Apple apps (like MIDI) to recognize the distinct speaker channels is to connect HDMI directly to an Audio Receiver. (And this is only for recent Macs; appears as though TOSLINK (optical audio) was better supported in the past.)
(In my case, my Samsung TV had to be in "HDMI Audio Format", "Bitstream", not "PCM"; and then "Audio Format" of "DTS Neo 2.5" (not PCM).)
"""
When I repeated these steps with an HDMI cable (Mac > HDMI cable > TV = only 2 MIDI channels), the "(Encoded Output)" actually has no audio, but I'm posting here regardless because I suspect that something about my TV or Receiver or configuration might be the problem.