forked from len0rd/rockbox
Revert some changes that broke looping in midiplayer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15631 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7aa4ae6e45
commit
65331f1749
3 changed files with 26 additions and 21 deletions
|
@ -109,7 +109,7 @@ struct SynthObject
|
||||||
int delta;
|
int delta;
|
||||||
int decay;
|
int decay;
|
||||||
unsigned int cp; /* unsigned int */
|
unsigned int cp; /* unsigned int */
|
||||||
int state;
|
int state, loopState;
|
||||||
int note, vol, ch;
|
int note, vol, ch;
|
||||||
int curRate, curOffset, targetOffset;
|
int curRate, curOffset, targetOffset;
|
||||||
int curPoint;
|
int curPoint;
|
||||||
|
|
|
@ -227,6 +227,7 @@ inline void pressNote(int ch, int note, int vol)
|
||||||
|
|
||||||
setVolScale(a);
|
setVolScale(a);
|
||||||
|
|
||||||
|
voices[a].loopState=STATE_NONLOOPING;
|
||||||
/*
|
/*
|
||||||
* OKAY. Gt = Gus Table value
|
* OKAY. Gt = Gus Table value
|
||||||
* rf = Root Frequency of wave
|
* rf = Root Frequency of wave
|
||||||
|
|
|
@ -316,19 +316,10 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
|
||||||
|
|
||||||
s2 = getSample((cp_temp >> FRACTSIZE)+1, wf);
|
s2 = getSample((cp_temp >> FRACTSIZE)+1, wf);
|
||||||
|
|
||||||
if(mode_mask28 && cp_temp >= end_loop)
|
if(mode_mask28)
|
||||||
{
|
{
|
||||||
if(!mode_mask24)
|
|
||||||
{
|
|
||||||
cp_temp -= diff_loop;
|
|
||||||
s2=getSample((cp_temp >> FRACTSIZE), wf);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
so->delta = -so->delta;
|
|
||||||
|
|
||||||
/* LOOP_REVERSE|LOOP_PINGPONG = 24 */
|
/* LOOP_REVERSE|LOOP_PINGPONG = 24 */
|
||||||
if(cp_temp < start_loop) /* this appears to never be true in here */
|
if(mode_mask24 && so->loopState == STATE_LOOPING && (cp_temp < start_loop))
|
||||||
{
|
{
|
||||||
if(mode_mask_looprev)
|
if(mode_mask_looprev)
|
||||||
{
|
{
|
||||||
|
@ -340,6 +331,19 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
|
||||||
so->delta = -so->delta; /* At this point cp_temp is wrong. We need to take a step */
|
so->delta = -so->delta; /* At this point cp_temp is wrong. We need to take a step */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(cp_temp >= end_loop)
|
||||||
|
{
|
||||||
|
so->loopState = STATE_LOOPING;
|
||||||
|
if(!mode_mask24)
|
||||||
|
{
|
||||||
|
cp_temp -= diff_loop;
|
||||||
|
s2=getSample((cp_temp >> FRACTSIZE), wf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
so->delta = -so->delta;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue