-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.it sample vibrato rate and depth are off #103
Comments
Reversing the direction of the bitshift when converting sample vibrato to instrument vibrato makes the depth sound closer to Impulse Tracker. (it_load.c, line 817) sub->vde = ish.vid << 1; The rate is still too slow, though. |
The other thing I ended up doing was to change line 816 to add 1 to the rate:
I don't fully understand how the instrument vibrato works in libxmp, though, or whether or not this is actually a good idea. It did make the .it files I was using to test sound closer to IT, though. |
From some experimentation in Impulse Tracker the vibrato properties listed here seem to function:
How they are translated to xmp subinstrument values (master): sub->vra = ish.vis; /* sample to sub-instrument vibrato */
sub->vde = ish.vid >> 1;
sub->vwf = ish.vit;
sub->vsw = (0xff - ish.vir) >> 1; How these values are actually used in libxmp (read_event.c, 146): libxmp_lfo_set_depth(&xc->insvib.lfo, sub->vde);
libxmp_lfo_set_rate(&xc->insvib.lfo, sub->vra >> 2);
libxmp_lfo_set_waveform(&xc->insvib.lfo, sub->vwf);
xc->insvib.sweep = sub->vsw; lfo.c uses a waveform table of size 64 instead of 256, hence the right shift. This is why my patch above adding 1 to
note to period (linear): p = (240.0 - n - (f / 128.0)) * 16.0 The effective calculation for pitch bend:
So, summary of what I think the correct fix for this is now:
edit: added relevant code links. |
I was wrong, the original source of that bitshift was an intentional change, so I wonder if something else changed in the sample vibrato handling that broke the original fix: b942c8e The For what it's worth, I tested the cited IT module with xmp both before and after the patch and after sounds closer to Impulse Tracker's playback to me. There's something weird with a different sample's volume (might be related to the volume envelope) but it definitely is not relevant to sample vibrato or sample global volume. |
This .it file uses a sample vibrato configuration that is immediately noticeable in Impulse Tracker. When played with xmp, the vibrato is performed but is much harder to hear because the depth is not as deep as it should be. Additionally, the vibrato sounds slower than when played in IT.
sample_vibrato.it.zip
The text was updated successfully, but these errors were encountered: