From 732f2f269d6be456b93af18c8cec035fc01b5eba Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 31 May 2019 22:07:21 +0300 Subject: Organize file formats parsers, and multi-bank AIL support --- utils/gen_adldata/file_formats/load_bisqwit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/gen_adldata/file_formats/load_bisqwit.h') diff --git a/utils/gen_adldata/file_formats/load_bisqwit.h b/utils/gen_adldata/file_formats/load_bisqwit.h index 9749a76..8686e90 100644 --- a/utils/gen_adldata/file_formats/load_bisqwit.h +++ b/utils/gen_adldata/file_formats/load_bisqwit.h @@ -4,7 +4,7 @@ #include "../progs_cache.h" #include "../midi_inst_list.h" -static bool LoadBisqwit(const char *fn, unsigned bank, const char *prefix) +bool BankFormats::LoadBisqwit(const char *fn, unsigned bank, const char *prefix) { #ifdef HARD_BANKS writeIni("Bisqwit", fn, prefix, bank, INI_Both); -- cgit v1.2.3 From 99cc4bfafcce3390bdd5d78ef8e55222d6507877 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Sat, 1 Jun 2019 02:43:59 +0300 Subject: Add Bisqwit, OP2 and TMB --- utils/gen_adldata/file_formats/load_bisqwit.h | 30 +++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'utils/gen_adldata/file_formats/load_bisqwit.h') diff --git a/utils/gen_adldata/file_formats/load_bisqwit.h b/utils/gen_adldata/file_formats/load_bisqwit.h index 8686e90..cf3a6a1 100644 --- a/utils/gen_adldata/file_formats/load_bisqwit.h +++ b/utils/gen_adldata/file_formats/load_bisqwit.h @@ -4,7 +4,7 @@ #include "../progs_cache.h" #include "../midi_inst_list.h" -bool BankFormats::LoadBisqwit(const char *fn, unsigned bank, const char *prefix) +bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, const std::string &bankTitle, const char *prefix) { #ifdef HARD_BANKS writeIni("Bisqwit", fn, prefix, bank, INI_Both); @@ -13,14 +13,25 @@ bool BankFormats::LoadBisqwit(const char *fn, unsigned bank, const char *prefix) if(!fp) return false; - for(uint32_t a = 0; a < 256; ++a) + size_t bankDb = db.initBank(bank, bankTitle, BanksDump::BankEntry::SETUP_Generic); + BanksDump::MidiBank bnkMelodique; + BanksDump::MidiBank bnkPercussion; + + for(uint32_t a = 0, patchId = 0; a < 256; ++a, patchId++) { //unsigned offset = a * 25; uint32_t gmno = a; + bool isPercussion = gmno >= 128; int32_t midi_index = gmno < 128 ? int32_t(gmno) : gmno < 128 + 35 ? -1 : gmno < 128 + 88 ? int32_t(gmno - 35) : -1; + if(patchId == 128) + patchId = 0; + + BanksDump::MidiBank &bnk = isPercussion ? bnkPercussion : bnkMelodique; + BanksDump::InstrumentEntry inst; + BanksDump::Operator ops[5]; struct ins tmp2; tmp2.notenum = (uint8_t)std::fgetc(fp); @@ -49,9 +60,24 @@ bool BankFormats::LoadBisqwit(const char *fn, unsigned bank, const char *prefix) tmp2.real4op = tmp[1].diff; size_t resno = InsertIns(tmp[0], tmp[1], tmp2, name, name2, (tmp[0] == tmp[1])); SetBank(bank, gmno, resno); + + db.toOps(tmp[0], ops, 0); + if(tmp[0] != tmp[1]) + { + inst.instFlags |= BanksDump::InstrumentEntry::WOPL_Ins_4op; + db.toOps(tmp[1], ops, 2); + } + + inst.fbConn = uint_fast16_t(tmp[0].data[10]) | (uint_fast16_t(tmp[1].data[10]) << 8); + inst.percussionKeyNumber = tmp2.notenum; + inst.noteOffset1 = tmp2.notenum; + db.addInstrument(bnk, patchId, inst, ops); } std::fclose(fp); + db.addMidiBank(bankDb, false, bnkMelodique); + db.addMidiBank(bankDb, true, bnkPercussion); + AdlBankSetup setup; setup.volumeModel = VOLUME_Generic; setup.deepTremolo = true; -- cgit v1.2.3 From d20e6b38692f4d1159fa4219c0985f8b322454e4 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Sat, 22 Jun 2019 03:59:56 +0300 Subject: Enable measurer for new database format too --- utils/gen_adldata/file_formats/load_bisqwit.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/gen_adldata/file_formats/load_bisqwit.h') diff --git a/utils/gen_adldata/file_formats/load_bisqwit.h b/utils/gen_adldata/file_formats/load_bisqwit.h index cf3a6a1..8ff91b1 100644 --- a/utils/gen_adldata/file_formats/load_bisqwit.h +++ b/utils/gen_adldata/file_formats/load_bisqwit.h @@ -69,8 +69,8 @@ bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, cons } inst.fbConn = uint_fast16_t(tmp[0].data[10]) | (uint_fast16_t(tmp[1].data[10]) << 8); - inst.percussionKeyNumber = tmp2.notenum; - inst.noteOffset1 = tmp2.notenum; + inst.percussionKeyNumber = a >= 128 ? tmp2.notenum : 0; + inst.noteOffset1 = a < 128 ? tmp2.notenum : 0; db.addInstrument(bnk, patchId, inst, ops); } std::fclose(fp); -- cgit v1.2.3 From bfd932874f5e107eaf81c40b87d5c722170a5ace Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Mon, 8 Jul 2019 02:28:48 +0300 Subject: More accurate silence detector Now, there are very low level of error! The only one weird condition is still be there... --- utils/gen_adldata/file_formats/load_bisqwit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/gen_adldata/file_formats/load_bisqwit.h') diff --git a/utils/gen_adldata/file_formats/load_bisqwit.h b/utils/gen_adldata/file_formats/load_bisqwit.h index 8ff91b1..7ea3a38 100644 --- a/utils/gen_adldata/file_formats/load_bisqwit.h +++ b/utils/gen_adldata/file_formats/load_bisqwit.h @@ -71,7 +71,7 @@ bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, cons inst.fbConn = uint_fast16_t(tmp[0].data[10]) | (uint_fast16_t(tmp[1].data[10]) << 8); inst.percussionKeyNumber = a >= 128 ? tmp2.notenum : 0; inst.noteOffset1 = a < 128 ? tmp2.notenum : 0; - db.addInstrument(bnk, patchId, inst, ops); + db.addInstrument(bnk, patchId, inst, ops, fn); } std::fclose(fp); -- cgit v1.2.3 From e4db1c263355202a9cb033f9e07d42c31e3ff4a5 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Thu, 20 Aug 2020 00:01:06 +0300 Subject: gen_adldata: First step of old code clean-up Verify that all code here is in safe --- utils/gen_adldata/file_formats/load_bisqwit.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'utils/gen_adldata/file_formats/load_bisqwit.h') diff --git a/utils/gen_adldata/file_formats/load_bisqwit.h b/utils/gen_adldata/file_formats/load_bisqwit.h index 7ea3a38..2c803dd 100644 --- a/utils/gen_adldata/file_formats/load_bisqwit.h +++ b/utils/gen_adldata/file_formats/load_bisqwit.h @@ -58,8 +58,8 @@ bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, cons tmp[1].diff = (tmp[0] != tmp[1]); tmp2.real4op = tmp[1].diff; - size_t resno = InsertIns(tmp[0], tmp[1], tmp2, name, name2, (tmp[0] == tmp[1])); - SetBank(bank, gmno, resno); +// size_t resno = InsertIns(tmp[0], tmp[1], tmp2, name, name2, (tmp[0] == tmp[1])); +// SetBank(bank, gmno, resno); db.toOps(tmp[0], ops, 0); if(tmp[0] != tmp[1]) @@ -78,12 +78,12 @@ bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, cons db.addMidiBank(bankDb, false, bnkMelodique); db.addMidiBank(bankDb, true, bnkPercussion); - AdlBankSetup setup; - setup.volumeModel = VOLUME_Generic; - setup.deepTremolo = true; - setup.deepVibrato = true; - setup.scaleModulators = false; - SetBankSetup(bank, setup); +// AdlBankSetup setup; +// setup.volumeModel = VOLUME_Generic; +// setup.deepTremolo = true; +// setup.deepVibrato = true; +// setup.scaleModulators = false; +// SetBankSetup(bank, setup); return true; } -- cgit v1.2.3 From f656802667e93be893ebc30a18b0f12482586e6f Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Sun, 23 Aug 2020 22:10:46 +0300 Subject: gen_adldata: remove the rest of old code --- utils/gen_adldata/file_formats/load_bisqwit.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'utils/gen_adldata/file_formats/load_bisqwit.h') diff --git a/utils/gen_adldata/file_formats/load_bisqwit.h b/utils/gen_adldata/file_formats/load_bisqwit.h index 2c803dd..478935f 100644 --- a/utils/gen_adldata/file_formats/load_bisqwit.h +++ b/utils/gen_adldata/file_formats/load_bisqwit.h @@ -78,13 +78,6 @@ bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, cons db.addMidiBank(bankDb, false, bnkMelodique); db.addMidiBank(bankDb, true, bnkPercussion); -// AdlBankSetup setup; -// setup.volumeModel = VOLUME_Generic; -// setup.deepTremolo = true; -// setup.deepVibrato = true; -// setup.scaleModulators = false; -// SetBankSetup(bank, setup); - return true; } -- cgit v1.2.3 From 1b4237dffce60e8546e550767b2816c1979bbb9d Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Sun, 23 Aug 2020 23:54:07 +0300 Subject: gen_adldata: Remove more old code --- utils/gen_adldata/file_formats/load_bisqwit.h | 31 +++++++++------------------ 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'utils/gen_adldata/file_formats/load_bisqwit.h') diff --git a/utils/gen_adldata/file_formats/load_bisqwit.h b/utils/gen_adldata/file_formats/load_bisqwit.h index 478935f..63d133f 100644 --- a/utils/gen_adldata/file_formats/load_bisqwit.h +++ b/utils/gen_adldata/file_formats/load_bisqwit.h @@ -6,9 +6,9 @@ bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, const std::string &bankTitle, const char *prefix) { - #ifdef HARD_BANKS +#ifdef HARD_BANKS writeIni("Bisqwit", fn, prefix, bank, INI_Both); - #endif +#endif FILE *fp = std::fopen(fn, "rb"); if(!fp) return false; @@ -33,18 +33,12 @@ bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, cons BanksDump::InstrumentEntry inst; BanksDump::Operator ops[5]; - struct ins tmp2; - tmp2.notenum = (uint8_t)std::fgetc(fp); - tmp2.pseudo4op = false; - tmp2.voice2_fine_tune = 0.0; - tmp2.midi_velocity_offset = 0; - tmp2.rhythmModeDrum = 0; + uint8_t notenum = static_cast(std::fgetc(fp)); - insdata tmp[2]; + InstBuffer tmp[2]; for(int side = 0; side < 2; ++side) { - tmp[side].finetune = (int8_t)std::fgetc(fp); - tmp[side].diff = false; + std::fseek(fp, +1, SEEK_CUR); // skip first byte, unused "fine tune" if(std::fread(tmp[side].data, 1, 11, fp) != 11) return false; } @@ -56,21 +50,16 @@ bool BankFormats::LoadBisqwit(BanksDump &db, const char *fn, unsigned bank, cons sprintf(name2, "%s%c%u", prefix, (gmno < 128 ? 'M' : 'P'), gmno & 127); - tmp[1].diff = (tmp[0] != tmp[1]); - tmp2.real4op = tmp[1].diff; -// size_t resno = InsertIns(tmp[0], tmp[1], tmp2, name, name2, (tmp[0] == tmp[1])); -// SetBank(bank, gmno, resno); - - db.toOps(tmp[0], ops, 0); - if(tmp[0] != tmp[1]) + db.toOps(tmp[0].d, ops, 0); + if(tmp[0].d != tmp[1].d) { inst.instFlags |= BanksDump::InstrumentEntry::WOPL_Ins_4op; - db.toOps(tmp[1], ops, 2); + db.toOps(tmp[1].d, ops, 2); } inst.fbConn = uint_fast16_t(tmp[0].data[10]) | (uint_fast16_t(tmp[1].data[10]) << 8); - inst.percussionKeyNumber = a >= 128 ? tmp2.notenum : 0; - inst.noteOffset1 = a < 128 ? tmp2.notenum : 0; + inst.percussionKeyNumber = a >= 128 ? notenum : 0; + inst.noteOffset1 = a < 128 ? notenum : 0; db.addInstrument(bnk, patchId, inst, ops, fn); } std::fclose(fp); -- cgit v1.2.3