parent
03bdabf7a6
commit
240d3c5718
3 changed files with 16 additions and 1 deletions
|
|
@ -9010,6 +9010,7 @@ FurnaceGUI::FurnaceGUI():
|
|||
wavePreviewHeight(255),
|
||||
wavePreviewInit(true),
|
||||
wavePreviewPaused(false),
|
||||
wavePreviewAccum(0.0f),
|
||||
pgSys(0),
|
||||
pgAddr(0),
|
||||
pgVal(0),
|
||||
|
|
|
|||
|
|
@ -2470,6 +2470,7 @@ class FurnaceGUI {
|
|||
DivWaveSynth wavePreview;
|
||||
int wavePreviewLen, wavePreviewHeight;
|
||||
bool wavePreviewInit, wavePreviewPaused;
|
||||
float wavePreviewAccum;
|
||||
|
||||
// bit 31: ctrl
|
||||
// bit 30: reserved for SDL scancode mask
|
||||
|
|
|
|||
|
|
@ -3289,6 +3289,7 @@ void FurnaceGUI::insTabWavetable(DivInstrument* ins)
|
|||
DivWavetable* wave2=e->getWave(ins->ws.wave2);
|
||||
if (wavePreviewInit) {
|
||||
wavePreview.init(ins,wavePreviewLen,wavePreviewHeight,true);
|
||||
wavePreviewAccum=0.0f;
|
||||
wavePreviewInit=false;
|
||||
}
|
||||
float wavePreview1[257];
|
||||
|
|
@ -3315,7 +3316,19 @@ void FurnaceGUI::insTabWavetable(DivInstrument* ins)
|
|||
wavePreview2[wave2->len]=wave2->data[wave2->len-1];
|
||||
}
|
||||
if (ins->ws.enabled && (!wavePreviewPaused || wavePreviewInit)) {
|
||||
wavePreview.tick(true);
|
||||
if (wavePreviewInit) {
|
||||
wavePreview.tick(true);
|
||||
} else {
|
||||
wavePreviewAccum+=ImGui::GetIO().DeltaTime;
|
||||
double accumRate=e->getCurHz();
|
||||
if (accumRate<1.0) accumRate=1.0;
|
||||
if (accumRate>1023.0) accumRate=1023.0;
|
||||
accumRate=1.0/accumRate;
|
||||
while (wavePreviewAccum>=accumRate) {
|
||||
wavePreviewAccum-=accumRate;
|
||||
wavePreview.tick(true);
|
||||
}
|
||||
}
|
||||
WAKE_UP;
|
||||
}
|
||||
for (int i=0; i<wavePreviewLen; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue