prepare to fix pitch linearity issues
This commit is contained in:
parent
b5faddf319
commit
c064cf089d
13 changed files with 49 additions and 454 deletions
|
|
@ -42,8 +42,6 @@
|
|||
#include <fmt/printf.h>
|
||||
#include <chrono>
|
||||
|
||||
int curEngineState=-1;
|
||||
|
||||
void process(void* u, float** in, float** out, int inChans, int outChans, unsigned int size) {
|
||||
((DivEngine*)u)->nextBuf(in,out,inChans,outChans,size);
|
||||
}
|
||||
|
|
@ -4020,31 +4018,6 @@ bool DivEngine::prePreInit() {
|
|||
logD("config path: %s",configPath.c_str());
|
||||
|
||||
configLoaded=true;
|
||||
curEngineState=-1;
|
||||
time_t thisMakesNoSense=time(NULL);
|
||||
struct tm curTime;
|
||||
#ifdef _WIN32
|
||||
struct tm* tempTM=localtime(&thisMakesNoSense);
|
||||
if (tempTM!=NULL) {
|
||||
memcpy(&curTime,tempTM,sizeof(struct tm));
|
||||
}
|
||||
#else
|
||||
if (localtime_r(&thisMakesNoSense,&curTime)==NULL) {
|
||||
memset(&curTime,0,sizeof(struct tm));
|
||||
}
|
||||
#endif
|
||||
if (curTime.tm_year==125) {
|
||||
if (curTime.tm_mon==2 && curTime.tm_mday==31 && curTime.tm_hour>=23) {
|
||||
curEngineState=curTime.tm_hour;
|
||||
} else if (curTime.tm_mon==3 && curTime.tm_mday==1) {
|
||||
curEngineState=curTime.tm_hour;
|
||||
} else if (curTime.tm_mon==3 && curTime.tm_mday==2 && curTime.tm_hour<6) {
|
||||
curEngineState=curTime.tm_hour;
|
||||
} else {
|
||||
curEngineState=-1;
|
||||
}
|
||||
}
|
||||
|
||||
return loadConf();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -432,7 +432,6 @@ enum DivChanTypes {
|
|||
};
|
||||
|
||||
extern const char* cmdName[];
|
||||
extern int curEngineState;
|
||||
|
||||
class DivEngine {
|
||||
DivDispatchContainer disCont[DIV_MAX_CHIPS];
|
||||
|
|
@ -448,7 +447,6 @@ class DivEngine {
|
|||
bool playing;
|
||||
bool freelance;
|
||||
bool shallStop, shallStopSched;
|
||||
bool reverse;
|
||||
bool endOfSong;
|
||||
bool consoleMode;
|
||||
bool disableStatusOut;
|
||||
|
|
@ -1402,7 +1400,6 @@ class DivEngine {
|
|||
freelance(false),
|
||||
shallStop(false),
|
||||
shallStopSched(false),
|
||||
reverse(false),
|
||||
endOfSong(false),
|
||||
consoleMode(false),
|
||||
disableStatusOut(false),
|
||||
|
|
|
|||
|
|
@ -29,11 +29,6 @@
|
|||
void DivEngine::nextOrder() {
|
||||
curRow=0;
|
||||
if (repeatPattern) return;
|
||||
if (curEngineState==3 || curEngineState==17) {
|
||||
if ((rand()%80)==0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (++curOrder>=curSubSong->ordersLen) {
|
||||
logV("end of orders reached");
|
||||
endOfSong=true;
|
||||
|
|
@ -331,18 +326,6 @@ const char* formatNote(unsigned char note, unsigned char octave) {
|
|||
}
|
||||
|
||||
int DivEngine::dispatchCmd(DivCommand c) {
|
||||
if (curEngineState==2 || curEngineState==14 || curEngineState==22) {
|
||||
if (c.cmd==DIV_CMD_NOTE_ON) {
|
||||
if ((rand()&255)==0) {
|
||||
c.value++;
|
||||
}
|
||||
}
|
||||
if (c.cmd==DIV_CMD_NOTE_OFF) {
|
||||
if ((rand()&127)==0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (view==DIV_STATUS_COMMANDS) {
|
||||
if (!skipping) {
|
||||
switch (c.cmd) {
|
||||
|
|
@ -1441,26 +1424,13 @@ void DivEngine::nextRow() {
|
|||
changeOrd=-1;
|
||||
}
|
||||
if (haltOn==DIV_HALT_PATTERN) halted=true;
|
||||
} else if (playing) {
|
||||
if (reverse) {
|
||||
if (--curRow<1) reverse=false;
|
||||
} else if (playing) if (++curRow>=curSubSong->patLen) {
|
||||
if (shallStopSched) {
|
||||
curRow=curSubSong->patLen-1;
|
||||
} else {
|
||||
curRow++;
|
||||
}
|
||||
if (curRow>=curSubSong->patLen) {
|
||||
if (shallStopSched) {
|
||||
curRow=curSubSong->patLen-1;
|
||||
} else {
|
||||
nextOrder();
|
||||
}
|
||||
if (haltOn==DIV_HALT_PATTERN) halted=true;
|
||||
}
|
||||
|
||||
if ((curEngineState==4 || curEngineState==21) && (curRow&3)==0 && !skipping) {
|
||||
if ((rand()%600)==0) {
|
||||
reverse=true;
|
||||
}
|
||||
nextOrder();
|
||||
}
|
||||
if (haltOn==DIV_HALT_PATTERN) halted=true;
|
||||
}
|
||||
|
||||
// new loop detection routine
|
||||
|
|
@ -1489,17 +1459,6 @@ void DivEngine::nextRow() {
|
|||
nextSpeed=speeds.val[curSpeed];
|
||||
}
|
||||
|
||||
if (curEngineState==3 || curEngineState==17) {
|
||||
if ((rand()%300)==0) {
|
||||
ticks++;
|
||||
nextSpeed++;
|
||||
}
|
||||
if ((rand()%15000)==0) {
|
||||
ticks=128;
|
||||
nextSpeed+=128;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (skipping) {
|
||||
ticks=1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue