mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-29 02:51:24 +00:00
try to unglitch the sample loops
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
This commit is contained in:
parent
0c8ec07633
commit
e8163b71e2
1 changed files with 10 additions and 1 deletions
|
@ -2495,12 +2495,21 @@ SafeWriter* DivEngine::saveVGM() {
|
|||
for (int i=0; i<streamID; i++) {
|
||||
if (loopSample[i]>=0) {
|
||||
loopTimer[i]-=(loopFreq[i]/44100.0)*(double)totalWait;
|
||||
}
|
||||
}
|
||||
for (int i=0; i<streamID; i++) {
|
||||
if (loopSample[i]>=0) {
|
||||
if (loopTimer[i]<0) {
|
||||
double waitTime=totalWait+(loopTimer[i]*(44100.0/loopFreq[i]));
|
||||
w->writeC(0x61);
|
||||
w->writeS(waitTime);
|
||||
printf("wait is: %f\n",waitTime);
|
||||
totalWait-=waitTime;
|
||||
tickCount+=waitTime;
|
||||
if (loopSample[i]<song.sampleLen) {
|
||||
DivSample* sample=song.sample[loopSample[i]];
|
||||
// insert loop
|
||||
if (sample->loopStart<(int)sample->rendLength) {
|
||||
//logW("inserting LOOP: %d\n",sample->rendOffContiguous);
|
||||
w->writeC(0x93);
|
||||
w->writeC(i);
|
||||
w->writeI(sample->rendOffContiguous+sample->loopStart);
|
||||
|
|
Loading…
Reference in a new issue