git ssb

0+

kode54 / syntrax-c



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 PM
Christopher Snowhill committed on 6/13/2018, 12:10:58 AM
Parent: 956789b33edb9ac8476ba6158ecad009df1d19c5

Files changed

src/syntrax/syntrax.cchanged
src/syntrax/syntrax.hchanged
src/syntrax/syntrax.cView
@@ -41,8 +41,9 @@
4141 tc->sampleBuffer = NULL;
4242 tc->smpLoopEnd = 0;
4343 //tc->smpLength = 0;
4444 tc->sampPos = 0;
45+ tc->synthPos = 0;
4546 tc->EYRXAB = 0;
4647 tc->volume = 0;
4748 tc->panning = 0;
4849 tc->VNVJPDIWAJQ = 0;
@@ -968,8 +969,9 @@
968969 tc->hasLooped = 0;
969970 tc->isPlayingBackward = 0;
970971 tc->EYRXAB = -1;
971972 tc->fmDelay = ins->fmDelay;
973+ tc->synthPos = 0;
972974
973975 for (i = 0; i < 16; i++) {
974976 if (ins->m_ResetWave[i]){
975977 //ins->synthBuffers[i].copyTo(tc.synthBuffers[i]);
@@ -1783,8 +1785,9 @@
17831785 {
17841786 int waveNum = p->instruments[insNum].waveform;
17851787 v->wavelength = (p->instruments[insNum].wavelength) - 1;
17861788 v->waveBuff = tc->synthBuffers[waveNum];
1789+ v->synthPos = tc->synthPos;
17871790 v->isSample = 0;
17881791 }
17891792 else
17901793 {
@@ -1988,18 +1991,19 @@
19881991 tc->sampPos = v->sampPos;
19891992 tc->isPlayingBackward = v->isPlayingBackward;
19901993 tc->hasLooped = v->hasLooped;
19911994 }
1995+ else
1996+ {
1997+ tc->synthPos = v->synthPos;
1998+ }
19921999 }
19932000 }
19942001 if ( p->otherSamplesPerBeat == (p->samplesPerBeat * p->SAMPLEFREQUENCY) / 44100 )
19952002 {
19962003 p->bkpDelayPos = p->delayPos;
19972004 for (i = 0; i < p->channelNumber; i++)
1998- {
1999- p->voices[i].bkpSynthPos = p->voices[i].synthPos;
20002005 resampler_dup_inplace(p->voices[i].resampler[1], p->voices[i].resampler[0]);
2001- }
20022006
20032007 p->overlapPos = 0;
20042008 if ( outBuff )
20052009 {
@@ -2107,9 +2111,8 @@
21072111 p->delayPos = ++p->delayPos % otherDelayTime;
21082112 }
21092113 }
21102114 p->delayPos = p->bkpDelayPos;
2111- for (i = 0; i < p->channelNumber; i++) p->voices[i].synthPos = p->voices[i].bkpSynthPos;
21122115
21132116 //dword_66327200 = 2 * sampleNum;
21142117 advanceTick(p);
21152118 }
src/syntrax/syntrax.hView
@@ -48,9 +48,8 @@
4848 int hasBidiLoop;
4949 int synthPos;
5050 int gainRight;
5151 int smpLoopStart;
52- int bkpSynthPos;
5352 int sampPos;
5453 int gainLeft;
5554 int hasLoop;
5655 int smpLength;
@@ -91,8 +90,9 @@
9190 int fmDelay;
9291 int volume;
9392 int ACKCWV;
9493 int sampPos;
94+ int synthPos;
9595 int insNum;
9696 int EQMIWERPIF;
9797 int freq;
9898 int HFRLJCG;

Built with git-ssb-web