ModPlug Central

OpenMPT => Help and Questions => Topic started by: Alex TEHb on September 06, 2020, 03:20:33

Title: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Alex TEHb on September 06, 2020, 03:20:33
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???
Title: Re: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Saga Musix on September 06, 2020, 10:35:22
I'm not aware of any such tool but it could certainly be done based on the IT sample specifications (https://github.com/schismtracker/schismtracker/wiki/ITTECH.TXT#impulse-sample-format) (see bit 1 in the "Flg" value).
Title: Re: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Alex TEHb on September 06, 2020, 11:51:12
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... :)
Title: Re: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Saga Musix on September 06, 2020, 12:02:28
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.
Title: Re: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Alex TEHb on September 06, 2020, 12:08:25
I and understood.
Wanted to specify: The FLAC compression does not change structure of the heading IMPS?
Title: Re: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Saga Musix on September 06, 2020, 12:28:00
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.
Title: Re: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Alex TEHb on September 06, 2020, 12:36:07
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... ;)))

Title: Re: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Alex TEHb on September 07, 2020, 01:12:23
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.
Title: Re: How to learn that instrument contains 8bit samples, without using OpenMPT?
Post by: Saga Musix on September 07, 2020, 16:45:10
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.