diff --git a/CMS.C b/CMS.C index 22fa13f..e406921 100644 --- a/CMS.C +++ b/CMS.C @@ -1,6 +1,7 @@ #ifdef CMS -//#define CMS_DEBUG 1 +//#define CMS_DEBUG // verbose to CMSLOG.TXT debug file +//#define DRUMS_ONLY // for percussion debug purpouses #ifdef CMS_DEBUG #include @@ -200,13 +201,13 @@ void cmsReset(unsigned short port) NotePriority = 0; } -#if 0 static void CMS_SetRegister(unsigned short regAddr, unsigned char reg, unsigned char val) { outp(regAddr + 1, reg); /* Select the register */ outp(regAddr, val); /* Set the value of the register */ } +#if 0 void cmsDisableVoice(unsigned char voice) { if (voice > 5) @@ -441,7 +442,9 @@ void cms_pitchwheel(unsigned short oplport, int channel, int pitchwheel) octave++; } +#ifndef DRUMS_ONLY cmsSound(cms_synth[i].voice,CMSFreqMap[((notefreq-489)*128) / 489],octave,atten[cms_synth[i].velocity],atten[cms_synth[i].velocity]); +#endif } } @@ -453,6 +456,18 @@ void cmsNoteOff(unsigned char channel, unsigned char note) unsigned char i; unsigned char voice; + if (channel == 9) + { +#ifdef CMS_DEBUG + debug_log("DRUM OFF note= %u\n",note); +#endif + CMS_SetRegister(cmsPort+2, 0x19, 0x0); + CMS_SetRegister(cmsPort+2, 0x15, 0x0); // noise ch 11 + cmsDisableVoice(11); + } + else + { + voice = MAX_CMS_CHANNELS; for(i=0; i