First post, by vladr
Rank
Oldbie
- Rank
- Oldbie
If a given partial is muted then MidiChannel::SetPatch() will only set pcache[].playPartial/.usePartial to false and continue. If this was the first time the patch was set on the given channel, the remainder of pcache[] remains uninitialized and MidiChannel::PlayPoly() will crash miserably when attempting to compute the pulse width (pcache[].pwsens not being set).
Quick fix would be to zero out pcache in MidiChannel's constructor
bend = 0x1000;
memset(polyTable,0,sizeof(polyTable));
+ memset(pcache, 0, sizeof(pcache));
if(cnum==8) {