Author Topic: Missing IT header data: Row highlights, pitch wheel depth  (Read 177 times)

saga

  • Posts: 2291
Given that an effort was made to put some of the missing metadata (such as "made with tracker" information) into MO3 files, it would be sensible to also do this for IT row highlights and pitch wheel depth. In particular, this information can be required for MPTM files that use modern tempo mode (where the row highlights determine how long a row lasts) or instrument plugins (where the pitch wheel depth is used to translate portamentos into MIDI pitch wheel commands).

Pitch wheel information can be stored in a backwards-compatible way by using the per-instrument pitch wheel information that is already used for XM instruments, so no extra chunk needs to be introduced. For row highlights, I guess a new chunk could be added at the end of the song data.

I have attached an example IT file with row highlights set to 16/32 (rather than the default 4/16), and pitch wheel depth set to 13.

Ian @ un4seen

  • Administrator
  • Posts: 21533
Here's a MO3 encoder update that adds a "PRHI" chunk for the "PHiliht" IT header value:

   www.un4seen.com/stuff/mo3.exe

The chunk will not be included if it has the default 4/16 value (or 0/0). This update will also store the "PWD" IT header value (when enabled in "Flags") in each instrument's pitch wheel depth field (if the instrument has a MIDI channel set), but I guess that isn't really needed because OpenMPT's "DWPM" chunk (containing per-instrument pitch wheel depths) will be included in the MO3 file anyway.

saga

  • Posts: 2291
Thanks for the quick update.
This update will also store the "PWD" IT header value (when enabled in "Flags")
Which flag is this based on? From what I can see IT will unconditionally read this value from the file, i.e. it does not depend on the flag for embedding the Zxx MIDI configuration.
While it is indeed less important for OpenMPT due to the per-instrument PWD setting, an accurate representation of a compressed IT file should still contain the PWD information in any case (although the number of MIDI-based IT files outside of OpenMPT is pretty low of course).

If it is possible, I would also suggest to place the PRHI chunk before the OMPT chunk, as the OMPT chunk may contain values that override PRHI chunk's signature if required. This is only ever the case if either of the two PRHI values is greater than 255, i.e. pretty rare, so simplifying the decoding logic by expecting PRHI to come first would be nice.
« Last Edit: 1 Feb '19 - 19:30 by saga »

Ian @ un4seen

  • Administrator
  • Posts: 21533
This update will also store the "PWD" IT header value (when enabled in "Flags")
Which flag is this based on?

In the ITTECH.TXT file, it says this under "Flags":

Quote
                Bit 6: Use MIDI pitch controller, Pitch depth given by PWD

It sounds like pitch wheel depth should be ignored without that flag set but I've never used this stuff in Impulse Tracker myself, so perhaps not?

If it is possible, I would also suggest to place the PRHI chunk before the OMPT chunk, as the OMPT chunk may contain values that override PRHI chunk's signature if required. This is only ever the case if either of the two PRHI values is greater than 255, i.e. pretty rare, so simplifying the decoding logic by expecting PRHI to come first would be nice.

OK, I will change that in the next update.

saga

  • Posts: 2291
Right, OpenMPT always sets that flag, which is why I forgot about it. The reason I was wondering is that with the example file provided above ran through the new mo3.exe, I cannot see the pitch wheel value popping up in the generated MO3 instruments. Does it maybe check for the wrong flag?

Ian @ un4seen

  • Administrator
  • Posts: 21533
The header "Flags" check looks OK but perhaps it's the instrument MIDI channel ("MCh") check that's causing the problem? The MO3 encoder ignores the instrument's other MIDI settings if that's set to 0/none. That's because MO3 doesn't have a "none" setting (0 = channel 1), so all MIDI settings being 0 is used to indicate "none".

saga

  • Posts: 2291
Ah yes, that explains it - there was no MIDI channel set.