Reply 1920 of 2176, by Spesek
Falcosoft wrote on 2024-08-05, 15:53:Hi, […]
Hi,
Spesek wrote on 2024-08-05, 14:25:Can't say that about saving though.
The bad
First, the format is saved as .mid instead of .rmi. But this is a minor issue.This is simply not true. When you change the file type in the Save As dialog it always changes the extension accordingly (.mid, .kar, .rmi). Of course if you forcefully change the extension manually it will be saved as you set.
Spesek wrote on 2024-08-05, 14:25:Second, the soundfont just gets copied into the file which results in this: SpessaSynth trims it to only use the samples in the […]
Second, the soundfont just gets copied into the file which results in this:
SpessaSynth trims it to only use the samples in the MIDI. (It finds every key-velocity combo for each used program (on each track and each port if multiport) and removes every unused preset and every unused sample in the used presets)
Third, the banks are not shifted. I've specified an offset of 2 and put a gm midi in, and it also was copied without change. This results in fsmp6 using the main bank instead of the embedded one.
Spessa does alter the bank selects for the offset (it doesn't just blidnly add offset though. It checks if the preset exists in the given soundfont then adds offset to it. For example original calls 50:16 because it was made for some specific soundfont. spessa then checks for this preset. Let's say that the only preset with program 16 is 0:16. So it adds offset to that which for offset of 2 becomes bank select 2 and program 16. Same with programs, except for adding the offset)
Lastly, spessa just... doesn't see the embedded soundfont from files exported by fsmp6, like, at all. But that might be spessa's issue, not yours because fsmp6 detects it fine. I'll look into it.This is all intentional. It's not supposed to overthink the user and make changes to either the Midi or the SF2 file. I do not know why you chose the path you chose but I would not like to follow you on this way.
I would like to add both the mid and the SF2 file to the riff file exactly the way as the user made/edited them.
BTW, the automatic shifting is simply wrong in some situations. You should not suppose that all presets in the Midi file would like to use the same bank and thus only the embedded soundfont (and thus making changes to bank select messages in Midi file arbitrarily).
Maybe that's why you have not understood the original concept behind the +1 offset. I always wanted that .rmi files like the attached below to be valid the same way as similar Mid+SF2 pairs are valid
Hi again,
You're right about soundfont trimming. It is optional. Spessa does it to shrink the file size, as the RMI file is something like an XM file: necessary samples (soundfont) and pattern data (midi) used to play the file. For example take a typical user who has a cool sounding gm soundfont and a midi file that they want to bundle together. Pasting the raw soundfont into the file will result in a ton of unused samples and taking a ton of space (exactly what the 1GB rmi file i sent is). But that's just my personal opinion. Pasting the entire soundfont into the rmi doesn't violate the rmi spec so it's perfectly fine.
About the bank shifting:
RMI files should be self contained (in my opinion). The soundfont in the file should contain all presets used in the file. Other than the very specific Creative! demos you've mentioned before, I don't think any regular midi file is specifically made to use more than 1 soundfont. And even if, what's the point of bundling an rmi + gm sf2? If it uses 2 soundfonts, why not just merge them into one and bundle that as rmi?
Let's assume that Joe downloaded a cool soundfont and a cool midi. He wants to share it as a single file, so others won't be forced to download an entire gm soundfont just to listen to a single MID. Joe leaves bank offset at the default 1, not knowing what it is. Spessa shifts the midi file's banks to correctly match with the new offset, while FSMP6 expects the user to modify the MIDI manually.
TLDR; spessa modifies mid to work with sf2, FSMP6 expects the user to do so. Both approaches are fine.
But again, this is opinionated. All I care about is that the format is somewhat standardized and it works on both FSMP6 and SS!
About the wrong bank offsets:
I don't think that's the case with spessasynth. it correctly shifts the banks for each program, taking the real bank into account. For example in Flowering night rmi i've sent before, stereo strings is on bank 16, coupled harprischord is on bank 8, etc. And they all are shifted by 1. Not all set to 1.
I've tested it with multiple MIDIs and it seems to work fine.
PS: Looks like the MS riff chunk is defined differently than the soundfont riff chunk. SF RIFF expects the size to be even (so it takes the pad byte into the total size), while MS also pads, but the size may be odd. After adding a quick fix, it works fine on my end. And also: it takes a ton of time to load that 1GB soundfont there!