Commit e53977afa504fe961bd61e048e74d6ddd0f598b3
Revert "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."
This reverts commit d2d123ccc873a72eb444dabe4fa5d139fbfba90f.Christopher Snowhill authored on 1/2/2016, 4:44:36 PM
Christopher Snowhill committed on 6/13/2018, 12:10:58 AM
Parent: 7546e2f74d2ea029c47a53149da67f11f39cb16a
Files changed
src/syntrax/syntrax.c | changed |
src/syntrax/syntrax.h | changed |
src/syntrax/syntrax.c | ||
---|---|---|
@@ -41,9 +41,8 @@ | ||
41 | 41 | tc->sampleBuffer = NULL; |
42 | 42 | tc->smpLoopEnd = 0; |
43 | 43 | //tc->smpLength = 0; |
44 | 44 | tc->sampPos = 0; |
45 | - tc->synthPos = 0; | |
46 | 45 | tc->EYRXAB = 0; |
47 | 46 | tc->volume = 0; |
48 | 47 | tc->panning = 0; |
49 | 48 | tc->VNVJPDIWAJQ = 0; |
@@ -969,9 +968,8 @@ | ||
969 | 968 | tc->hasLooped = 0; |
970 | 969 | tc->isPlayingBackward = 0; |
971 | 970 | tc->EYRXAB = -1; |
972 | 971 | tc->fmDelay = ins->fmDelay; |
973 | - tc->synthPos = 0; | |
974 | 972 | |
975 | 973 | for (i = 0; i < 16; i++) { |
976 | 974 | if (ins->m_ResetWave[i]){ |
977 | 975 | //ins->synthBuffers[i].copyTo(tc.synthBuffers[i]); |
@@ -1785,9 +1783,8 @@ | ||
1785 | 1783 | { |
1786 | 1784 | int waveNum = p->instruments[insNum].waveform; |
1787 | 1785 | v->wavelength = (p->instruments[insNum].wavelength) - 1; |
1788 | 1786 | v->waveBuff = tc->synthBuffers[waveNum]; |
1789 | - v->synthPos = tc->synthPos; | |
1790 | 1787 | v->isSample = 0; |
1791 | 1788 | } |
1792 | 1789 | else |
1793 | 1790 | { |
@@ -1991,19 +1988,18 @@ | ||
1991 | 1988 | tc->sampPos = v->sampPos; |
1992 | 1989 | tc->isPlayingBackward = v->isPlayingBackward; |
1993 | 1990 | tc->hasLooped = v->hasLooped; |
1994 | 1991 | } |
1995 | - else | |
1996 | - { | |
1997 | - tc->synthPos = v->synthPos; | |
1998 | - } | |
1999 | 1992 | } |
2000 | 1993 | } |
2001 | 1994 | if ( p->otherSamplesPerBeat == (p->samplesPerBeat * p->SAMPLEFREQUENCY) / 44100 ) |
2002 | 1995 | { |
2003 | 1996 | p->bkpDelayPos = p->delayPos; |
2004 | 1997 | for (i = 0; i < p->channelNumber; i++) |
1998 | + { | |
1999 | + p->voices[i].bkpSynthPos = p->voices[i].synthPos; | |
2005 | 2000 | resampler_dup_inplace(p->voices[i].resampler[1], p->voices[i].resampler[0]); |
2001 | + } | |
2006 | 2002 | |
2007 | 2003 | p->overlapPos = 0; |
2008 | 2004 | if ( outBuff ) |
2009 | 2005 | { |
@@ -2111,8 +2107,9 @@ | ||
2111 | 2107 | p->delayPos = ++p->delayPos % otherDelayTime; |
2112 | 2108 | } |
2113 | 2109 | } |
2114 | 2110 | p->delayPos = p->bkpDelayPos; |
2111 | + for (i = 0; i < p->channelNumber; i++) p->voices[i].synthPos = p->voices[i].bkpSynthPos; | |
2115 | 2112 | |
2116 | 2113 | //dword_66327200 = 2 * sampleNum; |
2117 | 2114 | advanceTick(p); |
2118 | 2115 | } |
src/syntrax/syntrax.h | ||
---|---|---|
@@ -48,8 +48,9 @@ | ||
48 | 48 | int hasBidiLoop; |
49 | 49 | int synthPos; |
50 | 50 | int gainRight; |
51 | 51 | int smpLoopStart; |
52 | + int bkpSynthPos; | |
52 | 53 | int sampPos; |
53 | 54 | int gainLeft; |
54 | 55 | int hasLoop; |
55 | 56 | int smpLength; |
@@ -90,9 +91,8 @@ | ||
90 | 91 | int fmDelay; |
91 | 92 | int volume; |
92 | 93 | int ACKCWV; |
93 | 94 | 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