git-moss / ConvertWithMoss

Converts multisamples from a source format (WAV, multisample, KMP, wavestate, NKI, SFZ, SoundFont 2) to a different destination format.
https://www.mossgrabers.de/Software/ConvertWithMoss/ConvertWithMoss.html
GNU Lesser General Public License v3.0
190 stars 13 forks source link

SFZ -> XPM : Pianobook 'Banjo Ukelele' fail due to 'seq_length=8' #2

Closed mungewell closed 2 years ago

mungewell commented 2 years ago

Found ConvertWithMoss and PianoBook in the same week... so had to give it a go making some MPC Keygroups.

Sample Source: https://www.pianobook.co.uk/packs/banjo-ukulele-banjolele/

Unfortunately had some issues, firstly it appears that the samples are assigned to the wrong note (off by one). imported_to_mpc

banjo_1st_attempt.zip

But digging deeper this is not the only issue. It appears that the sound pack contains 200sample files, and the convertor makes a XPM with 200 'instruments'.

...
Instrument {'number': '199'}
Layer {'number': '1'} Banjo Ukulele_BU1_84_C5_p_3
Layer {'number': '2'} Banjo Ukulele_BU1_84_C5_f_3
Low Note: 84
Root Note: 84
High Note: 84
-
Instrument {'number': '200'}
Layer {'number': '1'} Banjo Ukulele_BU1_84_C5_p_4
Layer {'number': '2'} Banjo Ukulele_BU1_84_C5_f_4
Low Note: 84
Root Note: 84
High Note: 84
=
Lowest Note: 60
Highest Note: 84
Last Instrument: 200

When imported to MPC only the first 128 are taken. It should also be noted that have 'instruments' have overlapping note ranges, then only one of these can be played - making the others superflous.

...
Instrument {'number': '127'}
Layer {'number': '1'} Banjo Ukulele_BU1_75_D#4_p_3
Layer {'number': '2'} Banjo Ukulele_BU1_75_D#4_f_3
Layer {'number': '3'} None
Layer {'number': '4'} None
Low Note: 75
Root Note: 75
High Note: 75
-
Instrument {'number': '128'}
Layer {'number': '1'} Banjo Ukulele_BU1_75_D#4_p_4
Layer {'number': '2'} Banjo Ukulele_BU1_75_D#4_f_4
Layer {'number': '3'} None
Layer {'number': '4'} None
Low Note: 75
Root Note: 75
High Note: 75
=
Lowest Note: 60
Highest Note: 75
Last Instrument: 128

I'm totally new to the convertor and SFZ maybe this is all the 'fault' of the source material.

I have been playing with XPM files for a while and have a Python script for working with them here: https://github.com/mungewell/mpd-utils/blob/master/utils/keygroup.py

mungewell commented 2 years ago

Figured out why... the SFZ defines multiple sequences, which I assume are for round-robin variances on playback

<group>
seq_length=8 <-------------------
ampeg_release=10
trigger=attack
lovel=0
hivel=79

I hand edited the file to remove all but seq_position=1 sample lines and re-converted, now my XPM only contains 25 instruments.

...
Instrument {'number': '24'}
Layer {'number': '1'} Banjo Ukulele_BU1_83_B4_p_1
Layer {'number': '2'} Banjo Ukulele_BU1_83_B4_f_1
Low Note: 83
Root Note: 83
High Note: 83
-
Instrument {'number': '25'}
Layer {'number': '1'} Banjo Ukulele_BU1_84_C5_p_1
Layer {'number': '2'} Banjo Ukulele_BU1_84_C5_f_1
Low Note: 84
Root Note: 84
High Note: 84
=
Lowest Note: 60
Highest Note: 84
Last Instrument: 25

I guess SFZ like this could be converted maintain some velocity variance (using seq 1), or with fixed velocity but with round-robin/random play (seq 1-4).

mungewell commented 2 years ago

Note the root note is still showing incorrectly... it is stated in the XPM pre-install, but is displayed incorrectly ('B2' for this one). Strange!!

                        <RootNote>60</RootNote>
                        <KeyTrack>False</KeyTrack>
                        <SampleName>Banjo Ukulele_BU1_60_C3_f_1</SampleName>
                        <PitchRandom>0.000000</PitchRandom>
                        <VolumeRandom>0.000000</VolumeRandom>
                        <PanRandom>0.000000</PanRandom>
                        <OffsetRandom>0.000000</OffsetRandom>
                        <SampleFile/>
                        <SliceIndex>129</SliceIndex>
                        <Direction>0</Direction>
                        <Offset>0</Offset>
                        <SliceStart>0</SliceStart>
                        <SliceEnd>131274</SliceEnd>
                    </Layer>
                </Layers>
                <LowNote>60</LowNote>
                <HighNote>60</HighNote>
git-moss commented 2 years ago

Thanks for the detailed analysis. Round robin with full layers is currently not supported, will add it to my TODO list. Regarding the note info: I tried the file, which converted fine for me (besides the multiple layers issue). After that I think I also saw something wrong but could not replicate it again. Not sure if this might be an issue of the MPC software or user error, since I still struggle with this software and understanding what is displayed where and when...

git-moss commented 2 years ago

I just released version 3.1 which can deal now with the round-robin layers (up to 4). It also fixes the root note being of by 1, which strangely have to be 1 larger than expected. Also velocity layers are distributed in multiple keygroups if necessary.

mungewell commented 2 years ago

I tried loading my original XPM into MPC Essentials, same issue arises with 'Root Note = B2'. Will try the new release... essentials '

mungewell commented 2 years ago

I can confirm that the new 3.1.0 version causes the right root note to be displayed.

However, I am not convinced about the other stuff. The convertor kicks out a single XPM with 50 instruments, the '_f' and '_p' samples are on different instruments with overlapping lo/hi notes.

Reading Banjo Ukulele.xpm...

-
Instrument {'number': '1'}
Layer {'number': '1'} Banjo Ukulele_BU1_60_C3_p_1
Layer {'number': '2'} Banjo Ukulele_BU1_60_C3_p_2
Layer {'number': '3'} Banjo Ukulele_BU1_60_C3_p_3
Layer {'number': '4'} Banjo Ukulele_BU1_60_C3_p_4
Low Note: 60
Root Note: 61
High Note: 60
-
...
-
Instrument {'number': '26'}
Layer {'number': '1'} Banjo Ukulele_BU1_60_C3_f_1
Layer {'number': '2'} Banjo Ukulele_BU1_60_C3_f_2
Layer {'number': '3'} Banjo Ukulele_BU1_60_C3_f_3
Layer {'number': '4'} Banjo Ukulele_BU1_60_C3_f_4
Low Note: 60
Root Note: 61
High Note: 60
-

I think this only causes the first declaration of each particular note to be ever be played (the '_p' in this case). Using 16-levels to cause different velocities from pads I can see that only instrument 1 is display (MPC switches to show last played) and sounds to be triggered.

Editing instrument 26 ('_f') to be triggered from 'B2' I can clearly hear it's different tone.

Maybe the smart thing to do when presented with a 'difficult' SFZ is to output 3 different XPM - velocity, cycle-lo and cycle-hi. User could then select which to load.

mungewell commented 2 years ago

Huh, weird.... if I change the samples in instrument 26 to be higher ones from with the set. With '16 levels' I can hear 2 different samples being played for each press regardless of which pad/velocity is pressed, even though the volume IS altering.

I am using 'pad keys' (as away from my MPC hardware) and the midi monitor is showing 127 velocity for each press. Maybe there's a bug with that.

[edit] I think that the velocity map for each sample (within the instrument) is being ignored if the 'layer play' is not set to 'velocity'.