VOGONS


First post, by Ictoagh

User metadata
Rank Newbie
Rank
Newbie

I've taken a look at the code, and I think I have figured out how to get modulation & pitch-bends to work correctly. They might be a bit off, still, but this should get closer to having them properly emulated:

/ This is a new version of the pitch-bend routine, this seems to give pretty faithful pitch bends. 
void MidiChannel::SetBend(int vol) {

// The maximum bend is over 2 octaves.
// Set the bend range to 2 oct / chosen range
float bend_range = (float)mt32ram.params.pSettings[storedpatch].benderRange/24;

// it appears 4096 is centered... this may be incorrect (bends can go from - to + ??
bend = 4096+(vol-8192)*bend_range;
}

// This is a new version of the SetModulation routine. The Mod controller controls modulation depth
// so, this is what is added here.
void MidiChannel::SetModulation(int vol) {

// Just a bloody guess, as always, before I get things figured out
int t;
for(t=0;t<4;t++) {
if(pcache[t].playPartial) {
int newrate = (pcache[t].modsense * vol) >> 7;
pcache[t].lfodepth = newrate;
}
}

}


Reply 1 of 5, by canadacow

User metadata
Rank Member
Rank
Member

Wow... this sounds great! Thexder 2 is much improved, as are several other games. As such I've posted an updated version (complete with DLL's this time) on my page at: http://www.artworxinn.com/alex/downloads.htm
Enjoy. In addition to this change, there are also some volume and sampling fixes. This one sounds closer than it ever has before!