parent
8e5b3abab8
commit
8758277199
6 changed files with 123 additions and 6 deletions
|
|
@ -37,8 +37,8 @@
|
|||
warnings+=(String("\n")+x); \
|
||||
}
|
||||
|
||||
#define DIV_VERSION "dev62"
|
||||
#define DIV_ENGINE_VERSION 62
|
||||
#define DIV_VERSION "dev63"
|
||||
#define DIV_ENGINE_VERSION 63
|
||||
|
||||
enum DivStatusView {
|
||||
DIV_STATUS_NOTHING=0,
|
||||
|
|
|
|||
|
|
@ -371,6 +371,13 @@ void DivInstrument::putInsData(SafeWriter* w) {
|
|||
w->writeC(op.ksrMacro[j]);
|
||||
}
|
||||
}
|
||||
|
||||
// OPL drum data
|
||||
w->writeC(fm.fixedDrums);
|
||||
w->writeC(0); // reserved
|
||||
w->writeS(fm.kickFreq);
|
||||
w->writeS(fm.snareHatFreq);
|
||||
w->writeS(fm.tomTopFreq);
|
||||
}
|
||||
|
||||
DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) {
|
||||
|
|
@ -694,6 +701,15 @@ DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) {
|
|||
}
|
||||
}
|
||||
|
||||
// OPL drum data
|
||||
if (version>=63) {
|
||||
fm.fixedDrums=reader.readC();
|
||||
reader.readC(); // reserved
|
||||
fm.kickFreq=reader.readS();
|
||||
fm.snareHatFreq=reader.readS();
|
||||
fm.tomTopFreq=reader.readS();
|
||||
}
|
||||
|
||||
return DIV_DATA_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ enum DivInstrumentType {
|
|||
|
||||
struct DivInstrumentFM {
|
||||
unsigned char alg, fb, fms, ams, ops, opllPreset;
|
||||
bool fixedDrums;
|
||||
unsigned short kickFreq, snareHatFreq, tomTopFreq;
|
||||
struct Operator {
|
||||
unsigned char am, ar, dr, mult, rr, sl, tl, dt2, rs, dt, d2r, ssgEnv;
|
||||
unsigned char dam, dvb, egt, ksl, sus, vib, ws, ksr; // YMU759/OPL/OPZ
|
||||
|
|
@ -98,7 +100,11 @@ struct DivInstrumentFM {
|
|||
fms(0),
|
||||
ams(0),
|
||||
ops(4),
|
||||
opllPreset(0) {
|
||||
opllPreset(0),
|
||||
fixedDrums(false),
|
||||
kickFreq(0x520),
|
||||
snareHatFreq(0x550),
|
||||
tomTopFreq(0x1c0) {
|
||||
// default instrument
|
||||
fb=4;
|
||||
op[0].tl=42;
|
||||
|
|
|
|||
|
|
@ -377,7 +377,24 @@ int DivPlatformOPLL::dispatch(DivCommand c) {
|
|||
if (c.chan>=6 && properDrums) { // drums mode
|
||||
chan[c.chan].insChanged=false;
|
||||
if (c.value!=DIV_NOTE_NULL) {
|
||||
chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value);
|
||||
if (chan[c.chan].state.opllPreset==16 && chan[c.chan].state.fixedDrums) {
|
||||
switch (c.chan) {
|
||||
case 6:
|
||||
chan[c.chan].baseFreq=(chan[c.chan].state.kickFreq&511)<<(chan[c.chan].state.kickFreq>>9);
|
||||
break;
|
||||
case 7: case 10:
|
||||
chan[c.chan].baseFreq=(chan[c.chan].state.snareHatFreq&511)<<(chan[c.chan].state.snareHatFreq>>9);
|
||||
break;
|
||||
case 8: case 9:
|
||||
chan[c.chan].baseFreq=(chan[c.chan].state.tomTopFreq&511)<<(chan[c.chan].state.tomTopFreq>>9);
|
||||
break;
|
||||
default:
|
||||
chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value);
|
||||
}
|
||||
chan[c.chan].note=c.value;
|
||||
chan[c.chan].freqChanged=true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue