requested changes

This commit is contained in:
Eknous-P 2024-12-12 01:09:20 +04:00 committed by tildearrow
parent d26c8d576b
commit f853feed4f

View file

@ -892,17 +892,18 @@ void FurnaceGUI::doAction(int what) {
e->lockEngine([this]() { e->lockEngine([this]() {
DivSample* sample=e->getSample(curSample); DivSample* sample=e->getSample(curSample);
if (sample!=NULL) { if (sample!=NULL) {
unsigned int waveLen=e->song.wave[curWave]->len; DivWavetable* wave=e->song.wave[curWave];
sample->rate=(int)round(261.343f*waveLen); // c3 unsigned int waveLen=wave->len;
sample->centerRate=(int)round(261.343f*waveLen); // c3 sample->rate=(int)round(261.625565301*waveLen); // c3
sample->centerRate=(int)round(261.625565301*waveLen); // c3
sample->loopStart=0; sample->loopStart=0;
sample->loopEnd=waveLen; sample->loopEnd=waveLen;
sample->loop=true; sample->loop=true;
sample->loopMode=(DivSampleLoopMode)0; sample->loopMode=DIV_SAMPLE_LOOP_FORWARD;
sample->depth=(DivSampleDepth)8; sample->depth=DIV_SAMPLE_DEPTH_8BIT;
if (sample->init(waveLen)) { if (sample->init(waveLen)) {
for (unsigned short i=0; i<waveLen; i++) { for (unsigned short i=0; i<waveLen; i++) {
sample->data8[i]=e->song.wave[curWave]->data[i]-waveLen/2; sample->data8[i]=wave->data[i]-waveLen/2;
} }
} }
} }