Commit 7048945153747ca4d19035d8a769f8fa56e4076d
Eliminate bkpSynthPos, and instead store a synthPos member in TuneChannel, which is reset to 0 by playInstrument, assigned to Voice before mixing, and saved back to TuneChannel before the Overlap is calculated.
Christopher Snowhill authored on 1/2/2016, 4:00:05 PMChristopher Snowhill committed on 6/13/2018, 12:10:58 AM
Parent: 956789b33edb9ac8476ba6158ecad009df1d19c5
Files changed
src/syntrax/syntrax.c | changed |
src/syntrax/syntrax.h | changed |
src/syntrax/syntrax.c | ||
---|---|---|
@@ -41,8 +41,9 @@ | ||
41 | 41 | tc->sampleBuffer = NULL; |
42 | 42 | tc->smpLoopEnd = 0; |
43 | 43 | //tc->smpLength = 0; |
44 | 44 | tc->sampPos = 0; |
45 | + tc->synthPos = 0; | |
45 | 46 | tc->EYRXAB = 0; |
46 | 47 | tc->volume = 0; |
47 | 48 | tc->panning = 0; |
48 | 49 | tc->VNVJPDIWAJQ = 0; |
@@ -968,8 +969,9 @@ | ||
968 | 969 | tc->hasLooped = 0; |
969 | 970 | tc->isPlayingBackward = 0; |
970 | 971 | tc->EYRXAB = -1; |
971 | 972 | tc->fmDelay = ins->fmDelay; |
973 | + tc->synthPos = 0; | |
972 | 974 | |
973 | 975 | for (i = 0; i < 16; i++) { |
974 | 976 | if (ins->m_ResetWave[i]){ |
975 | 977 | //ins->synthBuffers[i].copyTo(tc.synthBuffers[i]); |
@@ -1783,8 +1785,9 @@ | ||
1783 | 1785 | { |
1784 | 1786 | int waveNum = p->instruments[insNum].waveform; |
1785 | 1787 | v->wavelength = (p->instruments[insNum].wavelength) - 1; |
1786 | 1788 | v->waveBuff = tc->synthBuffers[waveNum]; |
1789 | + v->synthPos = tc->synthPos; | |
1787 | 1790 | v->isSample = 0; |
1788 | 1791 | } |
1789 | 1792 | else |
1790 | 1793 | { |
@@ -1988,18 +1991,19 @@ | ||
1988 | 1991 | tc->sampPos = v->sampPos; |
1989 | 1992 | tc->isPlayingBackward = v->isPlayingBackward; |
1990 | 1993 | tc->hasLooped = v->hasLooped; |
1991 | 1994 | } |
1995 | + else | |
1996 | + { | |
1997 | + tc->synthPos = v->synthPos; | |
1998 | + } | |
1992 | 1999 | } |
1993 | 2000 | } |
1994 | 2001 | if ( p->otherSamplesPerBeat == (p->samplesPerBeat * p->SAMPLEFREQUENCY) / 44100 ) |
1995 | 2002 | { |
1996 | 2003 | p->bkpDelayPos = p->delayPos; |
1997 | 2004 | for (i = 0; i < p->channelNumber; i++) |
1998 | - { | |
1999 | - p->voices[i].bkpSynthPos = p->voices[i].synthPos; | |
2000 | 2005 | resampler_dup_inplace(p->voices[i].resampler[1], p->voices[i].resampler[0]); |
2001 | - } | |
2002 | 2006 | |
2003 | 2007 | p->overlapPos = 0; |
2004 | 2008 | if ( outBuff ) |
2005 | 2009 | { |
@@ -2107,9 +2111,8 @@ | ||
2107 | 2111 | p->delayPos = ++p->delayPos % otherDelayTime; |
2108 | 2112 | } |
2109 | 2113 | } |
2110 | 2114 | p->delayPos = p->bkpDelayPos; |
2111 | - for (i = 0; i < p->channelNumber; i++) p->voices[i].synthPos = p->voices[i].bkpSynthPos; | |
2112 | 2115 | |
2113 | 2116 | //dword_66327200 = 2 * sampleNum; |
2114 | 2117 | advanceTick(p); |
2115 | 2118 | } |
src/syntrax/syntrax.h | ||
---|---|---|
@@ -48,9 +48,8 @@ | ||
48 | 48 | int hasBidiLoop; |
49 | 49 | int synthPos; |
50 | 50 | int gainRight; |
51 | 51 | int smpLoopStart; |
52 | - int bkpSynthPos; | |
53 | 52 | int sampPos; |
54 | 53 | int gainLeft; |
55 | 54 | int hasLoop; |
56 | 55 | int smpLength; |
@@ -91,8 +90,9 @@ | ||
91 | 90 | int fmDelay; |
92 | 91 | int volume; |
93 | 92 | int ACKCWV; |
94 | 93 | int sampPos; |
94 | + int synthPos; | |
95 | 95 | int insNum; |
96 | 96 | int EQMIWERPIF; |
97 | 97 | int freq; |
98 | 98 | int HFRLJCG; |
Built with git-ssb-web