volume changes

as of now the master volume is 1.0x (it was 2.0x before)
NES has also been amplified.
these changes should not affect older songs.
This commit is contained in:
tildearrow 2022-02-24 17:56:19 -05:00
parent 82c8b97d9c
commit 4b6d9adcb9
7 changed files with 36 additions and 10 deletions

View file

@ -841,7 +841,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (tchans>DIV_MAX_CHANS) tchans=DIV_MAX_CHANS;
// system volume
for (int i=0; i<32; i++) ds.systemVol[i]=reader.readC();
for (int i=0; i<32; i++) {
ds.systemVol[i]=reader.readC();
if (ds.version<59 && ds.system[i]==DIV_SYSTEM_NES) {
ds.systemVol[i]/=4;
}
}
// system panning
for (int i=0; i<32; i++) ds.systemPan[i]=reader.readC();
@ -999,6 +1004,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
ds.notes=reader.readString();
}
if (ds.version>=59) {
ds.masterVol=reader.readF();
} else {
ds.masterVol=2.0f;
}
// read instruments
for (int i=0; i<ds.insLen; i++) {
DivInstrument* ins=new DivInstrument;
@ -1444,6 +1455,8 @@ SafeWriter* DivEngine::saveFur() {
w->writeString(song.notes,false);
w->writeF(song.masterVol);
/// INSTRUMENT
for (int i=0; i<song.insLen; i++) {
DivInstrument* ins=song.ins[i];