Update DUMB to revision 22e82be0a7b0a915a2669e8f4ff889a938a7bfcb

- Fixed IT tone portamento so it can continue without a destination note on every row



SVN r4096 (trunk)
This commit is contained in:
Randy Heit 2013-02-08 00:45:07 +00:00
parent e1ec8df32d
commit 61def2eb16

View file

@ -1262,58 +1262,50 @@ static void update_effects(DUMB_IT_SIGRENDERER *sigrenderer)
} }
} }
for (j = -1; j < DUMB_IT_N_NNA_CHANNELS; j++) { if (sigrenderer->sigdata->flags & IT_LINEAR_SLIDES) {
if (j >= 0) { if (channel->toneporta && channel->destnote < 120) {
playing = sigrenderer->playing[j]; int currpitch = ((playing->note - 60) << 8) + playing->slide;
if (!playing || playing->channel != channel) continue; int destpitch = (channel->destnote - 60) << 8;
if (currpitch > destpitch) {
currpitch -= channel->toneporta;
if (currpitch < destpitch) {
currpitch = destpitch;
channel->destnote = IT_NOTE_OFF;
}
} else if (currpitch < destpitch) {
currpitch += channel->toneporta;
if (currpitch > destpitch) {
currpitch = destpitch;
channel->destnote = IT_NOTE_OFF;
}
}
playing->slide = currpitch - ((playing->note - 60) << 8);
} }
if (playing) { } else {
if (sigrenderer->sigdata->flags & IT_LINEAR_SLIDES) { if (channel->toneporta && channel->destnote < 120) {
if (channel->toneporta && channel->destnote < 120) { float amiga_multiplier = playing->sample->C5_speed * (1.0f / AMIGA_DIVISOR);
int currpitch = ((playing->note - 60) << 8) + playing->slide;
int destpitch = (channel->destnote - 60) << 8; float deltanote = (float)pow(DUMB_SEMITONE_BASE, 60 - playing->note);
if (currpitch > destpitch) { /* deltanote is 1.0 for C-5, 0.5 for C-6, etc. */
currpitch -= channel->toneporta;
if (currpitch < destpitch) { float deltaslid = deltanote - playing->slide * amiga_multiplier;
currpitch = destpitch;
channel->destnote = IT_NOTE_OFF; float destdelta = (float)pow(DUMB_SEMITONE_BASE, 60 - channel->destnote);
} if (deltaslid < destdelta) {
} else if (currpitch < destpitch) { playing->slide -= channel->toneporta;
currpitch += channel->toneporta; deltaslid = deltanote - playing->slide * amiga_multiplier;
if (currpitch > destpitch) { if (deltaslid > destdelta) {
currpitch = destpitch; playing->note = channel->destnote;
channel->destnote = IT_NOTE_OFF; playing->slide = 0;
} channel->destnote = IT_NOTE_OFF;
}
playing->slide = currpitch - ((playing->note - 60) << 8);
} }
} else { } else {
if (channel->toneporta && channel->destnote < 120) { playing->slide += channel->toneporta;
float amiga_multiplier = playing->sample->C5_speed * (1.0f / AMIGA_DIVISOR); deltaslid = deltanote - playing->slide * amiga_multiplier;
if (deltaslid < destdelta) {
float deltanote = (float)pow(DUMB_SEMITONE_BASE, 60 - playing->note); playing->note = channel->destnote;
/* deltanote is 1.0 for C-5, 0.5 for C-6, etc. */ playing->slide = 0;
channel->destnote = IT_NOTE_OFF;
float deltaslid = deltanote - playing->slide * amiga_multiplier;
float destdelta = (float)pow(DUMB_SEMITONE_BASE, 60 - channel->destnote);
if (deltaslid < destdelta) {
playing->slide -= channel->toneporta;
deltaslid = deltanote - playing->slide * amiga_multiplier;
if (deltaslid > destdelta) {
playing->note = channel->destnote;
playing->slide = 0;
channel->destnote = IT_NOTE_OFF;
}
} else {
playing->slide += channel->toneporta;
deltaslid = deltanote - playing->slide * amiga_multiplier;
if (deltaslid < destdelta) {
playing->note = channel->destnote;
playing->slide = 0;
channel->destnote = IT_NOTE_OFF;
}
}
} }
} }
} }