Mercurial > hg > dmlib
diff jssplr.c @ 175:4192aa6d5af6
Cosmetic cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 06 Oct 2012 11:11:41 +0300 |
parents | 520c18f581c7 |
children | eb293aa7a671 |
line wrap: on
line diff
--- a/jssplr.c Sat Oct 06 09:48:04 2012 +0300 +++ b/jssplr.c Sat Oct 06 11:11:41 2012 +0300 @@ -692,22 +692,20 @@ /* Slide the pitch of channel to the destination value * with speed of iLastPortaToNoteParam[] * 4 and stop when it equals. */ - if (chn->iCPitch != chn->iLastPortaToNotePitch) + if (chn->iCPitch < chn->iLastPortaToNotePitch) { + // Increase pitch UP + jmpChangePitch(chn, channel, chn->iLastPortaToNoteParam * 4); + if (chn->iCPitch > chn->iLastPortaToNotePitch) + chn->iCPitch = chn->iLastPortaToNotePitch; + } + else + if (chn->iCPitch > chn->iLastPortaToNotePitch) + { + // Decrease pitch DOWN + jmpChangePitch(chn, channel, -(chn->iLastPortaToNoteParam * 4)); if (chn->iCPitch < chn->iLastPortaToNotePitch) - { - // Increase pitch UP - jmpChangePitch(chn, channel, chn->iLastPortaToNoteParam * 4); - if (chn->iCPitch > chn->iLastPortaToNotePitch) - chn->iCPitch = chn->iLastPortaToNotePitch; - } - else - { - // Decrease pitch DOWN - jmpChangePitch(chn, channel, -(chn->iLastPortaToNoteParam * 4)); - if (chn->iCPitch < chn->iLastPortaToNotePitch) - chn->iCPitch = chn->iLastPortaToNotePitch; - } + chn->iCPitch = chn->iLastPortaToNotePitch; } } @@ -832,7 +830,7 @@ { // Check if we need to set the count if (chn->iPatLoopCount == 0) - chn->iPatLoopCount = (paramY + 1); + chn->iPatLoopCount = paramY + 1; // Loop to specified row chn->iPatLoopCount--; @@ -1232,8 +1230,6 @@ // Compute new pitch tmp = dmClamp(chn->iCNote + inst->ERelNote, 0, 119); -//fprintf(stderr, "HEH: %d + %d = %d\n", chn->iCNote, inst->ERelNote, tmp); - chn->iCPitch = jmpGetPeriodFromNote(mp, tmp, inst->EFineTune); JMPSETNDFLAGS(cdfNewPitch); } @@ -1272,7 +1268,8 @@ if (paramY) chn->iLastPortaToNoteParam = paramY; - if (currNote->note != jsetNotSet && currNote->note != jsetNoteOff) { + if (currNote->note != jsetNotSet && currNote->note != jsetNoteOff) + { chn->iLastPortaToNotePitch = chn->iCPitch; chn->iCPitch = chn->iCOldPitch; JMPUNSETNDFLAGS(cdfNewPitch | cdfNewInstr | cdfNewPanPos);