How to learn that instrument contains 8bit samples, without using OpenMPT?

Started by Alex TEHb, September 06, 2020, 03:20:33

Previous topic - Next topic

Alex TEHb

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???

Saga Musix

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.

Alex TEHb

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... :)

Saga Musix

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.

Alex TEHb

I and understood.
Wanted to specify: The FLAC compression does not change structure of the heading IMPS?

Saga Musix

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.

Alex TEHb

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... ;)))


Alex TEHb

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.

Saga Musix

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.