Saving SFZ as IT instrument OPENMPT file

Started by FWL, March 14, 2023, 21:14:07

Previous topic - Next topic

FWL

Hello,

I have some difficulty saving an SFZ file to IT. When I do this in a new openmpt file and reopen the instrument the samples don't get imported with loading. If I do the same procedure but within an new IT-file it works like I expected. With reloading the instrument the samples get imported as well. Saving as an IT-instrument with external samples does work within a new openmpt-file. Is this a bug or am I misunderstanding the way this should work?  I'm using version 1.30.11.00, 64 bit. Windows 11

Thanks in advance!

Saga Musix

It's hard to tell without seeing the SFZ file. and the exported ITI 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.

FWL

Goodmorning Saga,

Well the sfz file is really basic:

<control>
default_path=muziek\openmpt\samples\

<group> //Group 01

<region> sample=asynth_001.wav key=c3 hikey=a3 lokey=c-2
<region> sample=asynth_002.wav key=c4 hikey=a4 lokey=a#3
<region> sample=asynth_003.wav key=c5 hikey=a5 lokey=a#4
<region> sample=asynth_004.wav key=c6 hikey=g8 lokey=a#5

The iti.file is to large for uploading, so I don't know how to share this one. But is the SFZ file really relevant if its loading fine? I thought that the sfz file gives openmpt instructions how to import the samples but once imported they are treated like any other sample or instrument. Or do SFZ files keep a separate status within openmpt after loading?


Saga Musix

It's not necessary to look at the original samples, you could trim them down to e.g. just 100 bytes or so for demonstration purposes.

And just to double-check - by default samples from SFZ instruments are not embedded in MPTM files but kept as references to the original sample files. So if you move the module or sample files around, they will not be found anymore and you will see a dialog when attempting to load the MPTM file, asking you about the location of the samples. Do you see this dialog, or is there no error at all?
» 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.

FWL

I 've shortened the samples to make the .iti file smaller.

The scenario step by step is:

1. I load the sfz file as shown.
2. no errors and the file is playable as expected.
3. save as .iti compressed or uncompressed doesn't really matter. I save the .iti instrument at a different location as the sfz
4. create new module load .iti file
5. file loads no errors, but wave data. Sample-slots do get created.

My expectation was that the samples would be embedded in the .iti file. You say that SFZ sample files are not embedded in MPTM-files but are referenced, but does this mean they also don't get embedded when you save an SFZ file as .iti?

It is probably something really simple I am overlooking.

Saga Musix

Thanks for the file, I can now see a logic bug that causes invalid ITI files to be written if the instrument references any samples that have the "keep sample data on disk" checkbox checked but the ITI file is not saved with external samples. I'll work on a fix for the next version, in the meantime you can resort to disabling that checkbox for all relevant samples, or as you discovered use the IT format, where this checkbox is not available to begin with.
» 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.

FWL

Thanks for taking the time for looking in to this! I am still debating whether it is wise to convert my SFZ to .iti or not. I thought it would keep my instrument folder tidy, but keeping the samples separate with an SFZ-file maybe makes reusing the samples in other instruments easier. Either way, problem solved! Thanks again!

Saga Musix

Personally I prefer SFZ at this point for instruments that are just collections of samples (and don't make use of ITI features that cannot be expressed in SFZ) since it's more interoperable with other software (though admittedly not with most other trackers, while several other trackers could handle ITIs just fine). Even if you have no intention of moving away from OpenMPT, that can be very useful as it allows you to load the instruments e.g. into a sampler plugin that supports SFZ files and then take advantage of any features that sampler has which may be missing in OpenMPT's sample player. And of course it makes it much easier to just load single samples from that instrument if required (I do that quite frequently).
» 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.