dev188 - Merge branch 'linear_volume_rounding' of https://github.com/zeta0134/furnace
This commit is contained in:
commit
6ac348bbba
6 changed files with 23 additions and 7 deletions
|
|
@ -782,7 +782,7 @@ class DivDispatch {
|
|||
#define NOTE_FNUM_BLOCK(x,bits) parent->calcBaseFreqFNumBlock(chipClock,CHIP_FREQBASE,x,bits)
|
||||
|
||||
// this is for volume scaling calculation.
|
||||
#define VOL_SCALE_LINEAR(x,y,range) (((x)*(y))/(range))
|
||||
#define VOL_SCALE_LINEAR(x,y,range) ((parent->song.ceilVolumeScaling)?((((x)*(y))+(range-1))/(range)):(((x)*(y))/(range)))
|
||||
#define VOL_SCALE_LOG(x,y,range) (CLAMP(((x)+(y))-(range),0,(range)))
|
||||
#define VOL_SCALE_LINEAR_BROKEN(x,y,range) ((parent->song.newVolumeScaling)?(VOL_SCALE_LINEAR(x,y,range)):(VOL_SCALE_LOG(x,y,range)))
|
||||
#define VOL_SCALE_LOG_BROKEN(x,y,range) ((parent->song.newVolumeScaling)?(VOL_SCALE_LOG(x,y,range)):(VOL_SCALE_LINEAR(x,y,range)))
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ class DivWorkPool;
|
|||
|
||||
#define DIV_UNSTABLE
|
||||
|
||||
#define DIV_VERSION "dev187"
|
||||
#define DIV_ENGINE_VERSION 187
|
||||
#define DIV_VERSION "dev188"
|
||||
#define DIV_ENGINE_VERSION 188
|
||||
// for imports
|
||||
#define DIV_VERSION_MOD 0xff01
|
||||
#define DIV_VERSION_FC 0xff02
|
||||
|
|
|
|||
|
|
@ -1873,6 +1873,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
if (ds.version<184) {
|
||||
ds.resetArpPhaseOnNewNote=false;
|
||||
}
|
||||
if (ds.version<188) {
|
||||
ds.ceilVolumeScaling=false;
|
||||
}
|
||||
ds.isDMF=false;
|
||||
|
||||
reader.readS(); // reserved
|
||||
|
|
@ -2409,7 +2412,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
} else {
|
||||
reader.readC();
|
||||
}
|
||||
for (int i=0; i<3; i++) {
|
||||
if (ds.version>=188) {
|
||||
ds.ceilVolumeScaling=reader.readC();
|
||||
} else {
|
||||
reader.readC();
|
||||
}
|
||||
for (int i=0; i<2; i++) {
|
||||
reader.readC();
|
||||
}
|
||||
}
|
||||
|
|
@ -5494,7 +5502,8 @@ SafeWriter* DivEngine::saveFur(bool notPrimary, bool newPatternFormat) {
|
|||
w->writeC(song.preNoteNoEffect);
|
||||
w->writeC(song.oldDPCM);
|
||||
w->writeC(song.resetArpPhaseOnNewNote);
|
||||
for (int i=0; i<3; i++) {
|
||||
w->writeC(song.ceilVolumeScaling);
|
||||
for (int i=0; i<2; i++) {
|
||||
w->writeC(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -379,6 +379,7 @@ struct DivSong {
|
|||
bool preNoteNoEffect;
|
||||
bool oldDPCM;
|
||||
bool resetArpPhaseOnNewNote;
|
||||
bool ceilVolumeScaling;
|
||||
|
||||
std::vector<DivInstrument*> ins;
|
||||
std::vector<DivWavetable*> wave;
|
||||
|
|
@ -500,7 +501,8 @@ struct DivSong {
|
|||
brokenFMOff(false),
|
||||
preNoteNoEffect(false),
|
||||
oldDPCM(false),
|
||||
resetArpPhaseOnNewNote(false) {
|
||||
resetArpPhaseOnNewNote(false),
|
||||
ceilVolumeScaling(false) {
|
||||
for (int i=0; i<DIV_MAX_CHIPS; i++) {
|
||||
system[i]=DIV_SYSTEM_NULL;
|
||||
systemVol[i]=1.0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue