-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix arpeggio + vibrato in linear frequencies #36
base: master
Are you sure you want to change the base?
Conversation
In Artefact2#27, we refactored xm_frequency to split arpeggio (note offset) from vibrato (period offset). Unfortunately, we did test it properly only for amiga frequencies. It turns out the linear frequency implementation is wrong. The note offset cannot be added to the period, but must be added to the note itself. In case of linear frequencies, that's trivial to do once we get the frequency, as we can simply scale it. This fixes binary_world.xm and so finally... Closes Artefact2#1
Switched to draft as I found a regression in a module with this which I cannot understand. |
Would you mind sharing the module that triggers the regression? (Or a stripped example if the module cannot be shared for licensing reasons.) |
I think it's this one: After the intro, in the chorus there are some high pitch notes that sound distorted with my commit |
Maybe this bug extract can help. You can find here and here the implementation. It would also be necessary to clip the notes with the highest frequency but I don't want that in my version. It's too horrible. |
I don't see how implementing the historical FT2 arpeggio table overflow here helps, given that binary_world.xm has tempo 5, so there is no table overflow. Just in case, using this patch is enough to test: diff --git a/src/play.c b/src/play.c
index 6f1b931..f35dc15 100644
--- a/src/play.c
+++ b/src/play.c
@@ -195,6 +195,7 @@ static void xm_tremolo(xm_context_t* ctx, xm_channel_context_t* ch, uint8_t para
}
static void xm_arpeggio(xm_context_t* ctx, xm_channel_context_t* ch, uint8_t param, uint16_t tick) {
+ if (tick > 14) printf("arpeggio tick: %d\n", tick);
switch(tick % 3) {
case 0:
ch->arp_in_progress = false; and the printf never triggers during binary_world.xm playback. |
Hello rasky, You right: it's only a part of the bug. I look again and again and ... again because i want to fix this (maybe last) issue for my own code. I found that. It seems we must implement E3y effect (slide by semitones) for portamento and arpeggio to close this bug. Original function is here. Maybe this time we are close to the solution. What do you think about that? |
Do you see that effect used in binary_world.xm? The problem I hear is in pattern order 7 (index 4), channels 8 and 9, which sounds out of tune with libxm. The instrument being used is 9, which has autovibrato. In the pattern, effect 0 (arpeggio) is used. So it is probably a bug in the combination of the two. |
I realize that I have not detailed enough the elements that allow me to reach this conclusion. I started with I too thought about the autovibrato, but it seems that it is a side effect since it changes the period "marginally" and that has an impact on the future. By removing all the effects from the instrument, I found myself... without effects....I then started to play with the correction of the base frequency (C-4). II then did a basic track to highlight the problem that we see in I then looked at the ft2-clone code. In particular this famous I'm sorry I didn't take the time to clarify my explanations in my last message. I have the impression that we have a serious lead on these strange frequency changes. Are my explanations clearer? |
I have done a test here. |
Hello, As i expected I had to completely break the logic of managing current periods. In particular to work more comfortably with the non-linear periods of the Paula of the Amiga. To do this, I used a curve approximation function that I found using the Looking back, I feel like there were some errors in notes 4 to 9 in the historical tables... I'll add the last missing pieces (E3y and portamento) a little later. Finally, it's good to have May 1st in the rain... Have a nice day. |
In #27, we refactored xm_frequency to split arpeggio (note offset) from
vibrato (period offset). Unfortunately, we did test it properly only
for amiga frequencies.
It turns out the linear frequency implementation is wrong. The note
offset cannot be added to the period, but must be added to the note
itself. In case of linear frequencies, that's trivial to do once we
get the frequency, as we can simply scale it.
This fixes binary_world.xm and so finally...
Closes #1