Author Topic: How to learn that instrument contains 8bit samples, without using OpenMPT?  (Read 290 times)

Offline Alex TEHb

  • Inspired artist
  • **
  • Posts: 57
  • Operating System: Win7 x86
There is a big library instruments in the ITI format (more than 1000).
I want to remove from it all 8bits instruments.
Whether there is an opportunity (program/script) to define how many bits in samples used in instuments, without loading everyone separately into Sample Editor OMPT???

I mean batch operation.
Maybe in structure of instruments there is some tag by which it is possible to recognize how many bits, having opened the file in hex-editor or the usual text editor???

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,058
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
I'm not aware of any such tool but it could certainly be done based on the IT sample specifications (see bit 1 in the "Flg" value).
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Alex TEHb

  • Inspired artist
  • **
  • Posts: 57
  • Operating System: Win7 x86
I.e. it is necessary to find the beginning of sample (IMPS) and to check byte No. 19.
If bit No. 1 is equal 0, it means 8 bits of sample.
Did I get it right?

The bit Flg system confuses (I already rather forgot such subtleties). But I will try to write a script...
Thank you!!!
I think, it is better to write a script, than to look through more than 2500 instruments... :)

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,058
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
That sounds correct, yes. Note that in a regular ITS file the IMPS magic is always at the first byte - only within an regular IT file it can be at an arbitrary place inside the file. So you will always be looking at byte #19 in the file.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Alex TEHb

  • Inspired artist
  • **
  • Posts: 57
  • Operating System: Win7 x86
I and understood.
Wanted to specify: The FLAC compression does not change structure of the heading IMPS?

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,058
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
There is FLAC compression in ITS files; Impulse Tracker has its own sample compression algorithm if that's what you mean. Whether samples are compressed that way does not change bit 1 of the "Flg" value, but compressed samples have bit 3 set.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Alex TEHb

  • Inspired artist
  • **
  • Posts: 57
  • Operating System: Win7 x86
Thank you!
Now I will be engaged in search of a programming language in which it is simpler to write it... :)
I programmed the last time for ZX Spectrum, in the Alasm assembler.

I hope, on PC I will find some Basic or Macros-language with which it will be simple to deal... ;)))


Offline Alex TEHb

  • Inspired artist
  • **
  • Posts: 57
  • Operating System: Win7 x86
Somewhere I made a mistake.

Opened couple of instruments in hex-editor.
For example, this:
https://cloud.mail.ru/public/2SVs/2cadcBKtB

To address 00000248(HEX) (value of byte No. 19): 00001011
And when loading in OMPT is defined how 16bit.

With other instrument situation similar.
« Last Edit: September 07, 2020, 04:28:49 by Alex TEHb »

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,058
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Yes, that seems correct. "00001011" has to be read back to front, i.e. the second-to-last digit in that string is the one you are looking for - and it's 1, indicating a 16-bit sample.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.