Lines Matching refs:pSynth

125 EAS_INLINE const S_REGION* GetRegionPtr (S_SYNTH *pSynth, EAS_U16 regionIndex)  in GetRegionPtr()  argument
129 return &pSynth->pDLS->pDLSRegions[regionIndex & REGION_INDEX_MASK].wtRegion.region; in GetRegionPtr()
133 return &pSynth->pEAS->pFMRegions[regionIndex & REGION_INDEX_MASK].region; in GetRegionPtr()
135 return &pSynth->pEAS->pWTRegions[regionIndex].region; in GetRegionPtr()
137 return &pSynth->pEAS->pWTRegions[regionIndex].region; in GetRegionPtr()
139 return &pSynth->pEAS->pFMRegions[regionIndex].region; in GetRegionPtr()
165 EAS_INLINE EAS_U8 VSynthToChannel (S_SYNTH *pSynth, EAS_U8 channel) in VSynthToChannel() argument
168 return channel | (pSynth->vSynthNum << 4); in VSynthToChannel()
197 S_SYNTH *pSynth; in IncVoicePoolCount() local
206 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in IncVoicePoolCount()
207 pool = pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool; in IncVoicePoolCount()
211 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in IncVoicePoolCount()
212 pool = pSynth->channels[GET_CHANNEL(pVoice->channel)].pool; in IncVoicePoolCount()
215 pSynth->poolCount[pool]++; in IncVoicePoolCount()
230 S_SYNTH *pSynth; in DecVoicePoolCount() local
239 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in DecVoicePoolCount()
240 pool = pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool; in DecVoicePoolCount()
244 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in DecVoicePoolCount()
245 pool = pSynth->channels[GET_CHANNEL(pVoice->channel)].pool; in DecVoicePoolCount()
248 pSynth->poolCount[pool]--; in DecVoicePoolCount()
329 S_SYNTH *pSynth; in VMInitMIDI() local
337 if (pEASData->pVoiceMgr->pSynth[0] != NULL) in VMInitMIDI()
344 pSynth = EAS_CMEnumData(EAS_CM_MIDI_DATA); in VMInitMIDI()
352 if (pEASData->pVoiceMgr->pSynth[virtualSynthNum] == NULL) in VMInitMIDI()
359 pSynth = EAS_HWMalloc(pEASData->hwInstData, sizeof(S_SYNTH)); in VMInitMIDI()
363 if (pSynth == NULL) in VMInitMIDI()
368 EAS_HWMemSet(pSynth, 0, sizeof(S_SYNTH)); in VMInitMIDI()
371 if ((result = VMSetEASLib(pSynth, pEASData->pVoiceMgr->pGlobalEAS)) != EAS_SUCCESS) in VMInitMIDI()
373 VMMIDIShutdown(pEASData, pSynth); in VMInitMIDI()
381 pSynth->pDLS = pEASData->pVoiceMgr->pGlobalDLS; in VMInitMIDI()
382 DLSAddRef(pSynth->pDLS); in VMInitMIDI()
387 pSynth->synthFlags = DEFAULT_SYNTH_FLAGS; in VMInitMIDI()
388 pSynth->masterVolume = DEFAULT_SYNTH_MASTER_VOLUME; in VMInitMIDI()
389 pSynth->refCount = 1; in VMInitMIDI()
390 pSynth->priority = DEFAULT_SYNTH_PRIORITY; in VMInitMIDI()
391 pSynth->poolAlloc[0] = (EAS_U8) pEASData->pVoiceMgr->maxPolyphony; in VMInitMIDI()
393 VMInitializeAllChannels(pEASData->pVoiceMgr, pSynth); in VMInitMIDI()
395 pSynth->vSynthNum = (EAS_U8) virtualSynthNum; in VMInitMIDI()
396 pEASData->pVoiceMgr->pSynth[virtualSynthNum] = pSynth; in VMInitMIDI()
398 *ppSynth = pSynth; in VMInitMIDI()
408 void VMIncRefCount (S_SYNTH *pSynth) in VMIncRefCount() argument
410 pSynth->refCount++; in VMIncRefCount()
440 void VMReset (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_BOOL force) in VMReset() argument
450 pVoiceMgr->activeVoices -= pSynth->numActiveVoices; in VMReset()
451 pSynth->numActiveVoices = 0; in VMReset()
452 VMInitializeAllVoices(pVoiceMgr, pSynth->vSynthNum); in VMReset()
455 VMMuteAllVoices(pVoiceMgr, pSynth); in VMReset()
458 if (pSynth->numActiveVoices == 0) in VMReset()
466 VMInitializeAllChannels(pVoiceMgr, pSynth); in VMReset()
468 pSynth->poolCount[i] = 0; in VMReset()
471 if (pSynth->maxPolyphony < pVoiceMgr->maxPolyphony) in VMReset()
472 pSynth->poolAlloc[0] = (EAS_U8) pVoiceMgr->maxPolyphony; in VMReset()
474 pSynth->poolAlloc[0] = (EAS_U8) pSynth->maxPolyphony; in VMReset()
477 pSynth->synthFlags &= ~SYNTH_FLAG_RESET_IS_REQUESTED; in VMReset()
482 pSynth->synthFlags |= SYNTH_FLAG_RESET_IS_REQUESTED; in VMReset()
497 void VMInitializeAllChannels (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMInitializeAllChannels() argument
502 VMResetControllers(pSynth); in VMInitializeAllChannels()
505 pChannel = pSynth->channels; in VMInitializeAllChannels()
523 VMProgramChange(pVoiceMgr, pSynth, (EAS_U8) i, DEFAULT_SYNTH_PROGRAM_NUMBER); in VMInitializeAllChannels()
540 void VMResetControllers (S_SYNTH *pSynth) in VMResetControllers() argument
545 pChannel = pSynth->channels; in VMResetControllers()
556 pSynth->channels[i].reverbSend = DEFAULT_REVERB_SEND; in VMResetControllers()
560 pSynth->channels[i].chorusSend = DEFAULT_CHORUS_SEND; in VMResetControllers()
614 S_SYNTH *pSynth; in VMMuteVoice() local
625 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMMuteVoice()
626 GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum)); in VMMuteVoice()
637 void VMReleaseVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 voiceNum) in VMReleaseVoice() argument
652 …GetSynthPtr(voiceNum)->pfReleaseVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAdjusted… in VMReleaseVoice()
662 void VMInitMIPTable (S_SYNTH *pSynth) in VMInitMIPTable() argument
671 pSynth->synthFlags &= ~SYNTH_FLAG_SP_MIDI_ON; in VMInitMIPTable()
674 pSynth->channels[i].pool = 0; in VMInitMIPTable()
675 pSynth->channels[i].mip = 0; in VMInitMIPTable()
686 void VMSetMIPEntry (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 priority, EAS_U… in VMSetMIPEntry() argument
696 pSynth->channels[channel].pool = priority; in VMSetMIPEntry()
697 pSynth->channels[channel].mip = mip; in VMSetMIPEntry()
709 void VMMIPUpdateChannelMuting (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMMIPUpdateChannelMuting() argument
722 if (pSynth->maxPolyphony) in VMMIPUpdateChannelMuting()
723 maxPolyphony = pSynth->maxPolyphony; in VMMIPUpdateChannelMuting()
732 if ((pSynth->channels[i].mip != 0) && (pSynth->channels[i].mip <= maxPolyphony)) in VMMIPUpdateChannelMuting()
733 pSynth->channels[i].channelFlags &= ~CHANNEL_FLAG_MUTE; in VMMIPUpdateChannelMuting()
735 pSynth->channels[i].channelFlags |= CHANNEL_FLAG_MUTE; in VMMIPUpdateChannelMuting()
738 pSynth->poolCount[i] = 0; in VMMIPUpdateChannelMuting()
762 if (vSynthNum != pSynth->vSynthNum) in VMMIPUpdateChannelMuting()
766 pool = pSynth->channels[channel].pool; in VMMIPUpdateChannelMuting()
769 if (pSynth->channels[channel].channelFlags & CHANNEL_FLAG_MUTE) in VMMIPUpdateChannelMuting()
778 VMReleaseVoice(pVoiceMgr, pSynth, i); in VMMIPUpdateChannelMuting()
779 pSynth->poolCount[pool]++; in VMMIPUpdateChannelMuting()
785 pSynth->poolCount[pool]++; in VMMIPUpdateChannelMuting()
800 void VMUpdateMIPTable (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMUpdateMIPTable() argument
813 pSynth->synthFlags |= SYNTH_FLAG_SP_MIDI_ON; in VMUpdateMIPTable()
820 if (pSynth->channels[i].pool != DEFAULT_SP_MIDI_PRIORITY) in VMUpdateMIPTable()
821 priority[pSynth->channels[i].pool] = i; in VMUpdateMIPTable()
833 pChannel = &pSynth->channels[priority[i]]; in VMUpdateMIPTable()
845 pSynth->poolAlloc[currentPool] = (EAS_U8) (pChannel->mip - currentMIP); in VMUpdateMIPTable()
851 pSynth->synthFlags |= SYNTH_FLAG_SP_MIDI_ON; in VMUpdateMIPTable()
854 VMMIPUpdateChannelMuting (pVoiceMgr, pSynth); in VMUpdateMIPTable()
874 void VMMuteAllVoices (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMMuteAllVoices() argument
887 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) == pSynth->vSynthNum) in VMMuteAllVoices()
891 else if (pSynth->vSynthNum == GET_VSYNTH(pVoiceMgr->voices[i].channel)) in VMMuteAllVoices()
915 void VMReleaseAllVoices (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMReleaseAllVoices() argument
922 if (pSynth->channels[ i ].channelFlags & CHANNEL_FLAG_SUSTAIN_PEDAL) in VMReleaseAllVoices()
924 VMReleaseAllDeferredNoteOffs(pVoiceMgr, pSynth, (EAS_U8) i); in VMReleaseAllVoices()
925 pSynth->channels[i].channelFlags &= ~CHANNEL_FLAG_SUSTAIN_PEDAL; in VMReleaseAllVoices()
938 if (GET_VSYNTH(pVoiceMgr->voices[i].channel) == pSynth->vSynthNum) in VMReleaseAllVoices()
939 VMReleaseVoice(pVoiceMgr, pSynth, i); in VMReleaseAllVoices()
943 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) == pSynth->vSynthNum) in VMReleaseAllVoices()
980 void VMAllNotesOff (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMAllNotesOff() argument
998 channel = VSynthToChannel(pSynth, channel); in VMAllNotesOff()
1008 … GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pSynth, pVoice, GetAdjustedVoiceNum(voiceNum)); in VMAllNotesOff()
1033 void VMDeferredStopNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMDeferredStopNote() argument
1097 if (pSynth->channels[channel].channelFlags & CHANNEL_FLAG_SUSTAIN_PEDAL) in VMDeferredStopNote()
1099 …GetSynthPtr(voiceNum)->pfSustainPedal(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], &pSynth->ch… in VMDeferredStopNote()
1104 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMDeferredStopNote()
1114 pSynth->synthFlags ^= SYNTH_FLAG_DEFERRED_MIDI_NOTE_OFF_PENDING; in VMDeferredStopNote()
1140 void VMReleaseAllDeferredNoteOffs (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMReleaseAllDeferredNoteOffs() argument
1158 channel = VSynthToChannel(pSynth, channel); in VMReleaseAllDeferredNoteOffs()
1170 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMReleaseAllDeferredNoteOffs()
1201 void VMCatchNotesForSustainPedal (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel) in VMCatchNotesForSustainPedal() argument
1215 channel = VSynthToChannel(pSynth, channel); in VMCatchNotesForSustainPedal()
1223 …GetSynthPtr(voiceNum)->pfSustainPedal(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], &pSynth->ch… in VMCatchNotesForSustainPedal()
1271 static void VMStolenVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 voiceNum, EAS_U8 channe… in VMStolenVoice() argument
1279 …GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)], &pVo… in VMStolenVoice()
1283 pVoice->nextChannel = VSynthToChannel(pSynth, channel); in VMStolenVoice()
1318 static void VMFreeVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice) in VMFreeVoice() argument
1339 pSynth->numActiveVoices--; in VMFreeVoice()
1369 S_SYNTH *pSynth; in VMRetargetStolenVoice() local
1374 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMRetargetStolenVoice()
1375 pMIDIChannel = &pSynth->channels[pVoice->channel & 15]; in VMRetargetStolenVoice()
1376 pNextSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->nextChannel)]; in VMRetargetStolenVoice()
1387 if ((pSynth->synthFlags & SYNTH_FLAG_SP_MIDI_ON) && in VMRetargetStolenVoice()
1390 VMFreeVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum]); in VMRetargetStolenVoice()
1400 pSynth->numActiveVoices--; in VMRetargetStolenVoice()
1447 void VMCheckKeyGroup (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U16 keyGroup, EAS_U8 channel) in VMCheckKeyGroup() argument
1456 channel = VSynthToChannel(pSynth, channel); in VMCheckKeyGroup()
1465 pRegion = GetRegionPtr(pSynth, pVoiceMgr->voices[voiceNum].regionIndex); in VMCheckKeyGroup()
1490 pRegion = GetRegionPtr(pSynth, pVoiceMgr->voices[voiceNum].nextRegionIndex); in VMCheckKeyGroup()
1535 EAS_BOOL VMCheckPolyphonyLimiting (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 … in VMCheckPolyphonyLimiting() argument
1548 channel = VSynthToChannel(pSynth, channel); in VMCheckPolyphonyLimiting()
1594 VMStolenVoice(pVoiceMgr, pSynth, oldestVoiceNum, channel, note, velocity, regionIndex); in VMCheckPolyphonyLimiting()
1610 void VMStartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 vel… in VMStartVoice() argument
1619 pChannel = &pSynth->channels[channel]; in VMStartVoice()
1620 pRegion = GetRegionPtr(pSynth, regionIndex); in VMStartVoice()
1649 if (pSynth->poolCount[pChannel->pool] != 0) in VMStartVoice()
1655 VMCheckKeyGroup(pVoiceMgr, pSynth, keyGroup, channel); in VMStartVoice()
1660 …if (VMCheckPolyphonyLimiting(pVoiceMgr, pSynth, channel, note, velocity, regionIndex, lowVoice, hi… in VMStartVoice()
1666 if ((pSynth->maxPolyphony == 0) || (pVoiceMgr->maxPolyphony < pSynth->maxPolyphony)) in VMStartVoice()
1669 maxSynthPoly = pSynth->maxPolyphony; in VMStartVoice()
1673 (pSynth->numActiveVoices < maxSynthPoly) && in VMStartVoice()
1684 pSynth->numActiveVoices++; in VMStartVoice()
1692 pVoiceMgr->voices[voiceNum].channel = VSynthToChannel(pSynth, channel); in VMStartVoice()
1707 …GetSynthPtr(voiceNum)->pfStartVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAdjustedVo… in VMStartVoice()
1712 … if (VMStealVoice(pVoiceMgr, pSynth, &voiceNum, channel, note, lowVoice, highVoice) == EAS_SUCCESS) in VMStartVoice()
1713 VMStolenVoice(pVoiceMgr, pSynth, voiceNum, channel, note, velocity, regionIndex); in VMStartVoice()
1747 void VMStartNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 velo… in VMStartNote() argument
1754 pSynth->totalNoteCount++; in VMStartNote()
1756 pChannel = &pSynth->channels[channel]; in VMStartNote()
1764 if ((pChannel->channelFlags & CHANNEL_FLAG_EXTERNAL_AUDIO) && (pSynth->cbEventFunc != NULL)) in VMStartNote()
1771 if (pSynth->cbEventFunc(pSynth->pExtAudioInstData, &event)) in VMStartNote()
1784 adjustedNote += pChannel->coarsePitch + pSynth->globalTranspose; in VMStartNote()
1803 const S_DLS_REGION *pDLSRegion = (S_DLS_REGION*) GetRegionPtr(pSynth, regionIndex); in VMStartNote()
1809 VMStartVoice(pVoiceMgr, pSynth, channel, note, velocity, regionIndex); in VMStartNote()
1828 const S_REGION *pRegion = GetRegionPtr(pSynth, regionIndex); in VMStartNote()
1833 VMStartVoice(pVoiceMgr, pSynth, channel, note, velocity, regionIndex); in VMStartNote()
1868 void VMStopNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 veloc… in VMStopNote() argument
1873 pChannel = &(pSynth->channels[channel]); in VMStopNote()
1876 if ((pChannel->channelFlags & CHANNEL_FLAG_EXTERNAL_AUDIO) && (pSynth->cbEventFunc != NULL)) in VMStopNote()
1883 if (pSynth->cbEventFunc(pSynth->pExtAudioInstData, &event)) in VMStopNote()
1891 channel = VSynthToChannel(pSynth, channel); in VMStopNote()
1922 pSynth->synthFlags |= SYNTH_FLAG_DEFERRED_MIDI_NOTE_OFF_PENDING; in VMStopNote()
1927 VMReleaseVoice(pVoiceMgr, pSynth, voiceNum); in VMStopNote()
2013 EAS_RESULT VMStealVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_INT *pVoiceNumber, EAS_U8 cha… in VMStealVoice() argument
2039 pCurrSynth = pVoiceMgr->pSynth[GET_VSYNTH(pCurrVoice->nextChannel)]; in VMStealVoice()
2045 pCurrSynth = pVoiceMgr->pSynth[GET_VSYNTH(pCurrVoice->channel)]; in VMStealVoice()
2051 if (pSynth->priority > pCurrSynth->priority) in VMStealVoice()
2075 if (pSynth->synthFlags & SYNTH_FLAG_SP_MIDI_ON) in VMStealVoice()
2079 if (pSynth->poolCount[pChannel->pool] >= pSynth->poolAlloc[pChannel->pool]) in VMStealVoice()
2080 …currentPriority += (pSynth->poolCount[pChannel->pool] -pSynth->poolAlloc[pChannel->pool] + 1) << C… in VMStealVoice()
2139 void VMChannelPressure (S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 value) in VMChannelPressure() argument
2143 pChannel = &(pSynth->channels[channel]); in VMChannelPressure()
2181 void VMPitchBend (S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 nPitchLSB, EAS_U8 nPitchMSB) in VMPitchBend() argument
2185 pChannel = &(pSynth->channels[channel]); in VMPitchBend()
2213 void VMControlChange (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 controller, E… in VMControlChange() argument
2217 pChannel = &(pSynth->channels[channel]); in VMControlChange()
2288 VMReleaseAllDeferredNoteOffs(pVoiceMgr, pSynth, channel); in VMControlChange()
2312 VMCatchNotesForSustainPedal(pVoiceMgr, pSynth, channel); in VMControlChange()
2323 pSynth->channels[channel].reverbSend = value; in VMControlChange()
2329 pSynth->channels[channel].chorusSend = value; in VMControlChange()
2371 VMUpdateRPNStateMachine(pSynth, channel, controller, value); in VMControlChange()
2381 VMAllNotesOff(pVoiceMgr, pSynth, channel); in VMControlChange()
2422 EAS_RESULT VMUpdateRPNStateMachine (S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 controller, EAS_U8 valu… in VMUpdateRPNStateMachine() argument
2435 pChannel = &(pSynth->channels[channel]); in VMUpdateRPNStateMachine()
2513 void VMUpdateStaticChannelParameters (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth) in VMUpdateStaticChannelParameters() argument
2517 if (pSynth->synthFlags & SYNTH_FLAG_UPDATE_ALL_CHANNEL_PARAMETERS) in VMUpdateStaticChannelParameters()
2527 if (pSynth->channels[channel].regionIndex & FLAG_RGN_IDX_FM_SYNTH) in VMUpdateStaticChannelParameters()
2528 pSecondarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2530 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2532 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2540 pSynth->synthFlags &= ~SYNTH_FLAG_UPDATE_ALL_CHANNEL_PARAMETERS; in VMUpdateStaticChannelParameters()
2548 … if ( 0 != (pSynth->channels[channel].channelFlags & CHANNEL_FLAG_UPDATE_CHANNEL_PARAMETERS)) in VMUpdateStaticChannelParameters()
2551 if (pSynth->channels[channel].regionIndex & FLAG_RGN_IDX_FM_SYNTH) in VMUpdateStaticChannelParameters()
2552 pSecondarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2554 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2556 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel); in VMUpdateStaticChannelParameters()
2687 void VMProgramChange (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 program) in VMProgramChange() argument
2698 pChannel = &pSynth->channels[channel]; in VMProgramChange()
2717 if (pSynth->cbProgChgFunc != NULL) in VMProgramChange()
2723 if (pSynth->cbProgChgFunc(pSynth->pExtAudioInstData, &prgChg)) in VMProgramChange()
2732 if (VMFindDLSProgram(pSynth->pDLS, bank, program, &regionIndex) != EAS_SUCCESS) in VMProgramChange()
2739 if (VMFindProgram(pSynth->pEAS, bank, program, &regionIndex) != EAS_SUCCESS) in VMProgramChange()
2743 if (pSynth->channels[channel].channelFlags & CHANNEL_FLAG_RHYTHM_CHANNEL) in VMProgramChange()
2748 if (VMFindProgram(pSynth->pEAS, bank, program, &regionIndex) != EAS_SUCCESS) in VMProgramChange()
2752 if (VMFindProgram(pSynth->pEAS, bank, 0, &regionIndex) != EAS_SUCCESS) in VMProgramChange()
2792 S_SYNTH *pSynth; in VMAddSamples() local
2814 pSynth = pVoiceMgr->pSynth[pVoiceMgr->voices[voiceNum].channel >> 4]; in VMAddSamples()
2819 …done = GetSynthPtr(voiceNum)->pfUpdateVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], GetAd… in VMAddSamples()
2831 VMFreeVoice(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum]); in VMAddSamples()
2868 S_SYNTH *pSynth; in VMRender() local
2880 if (pVoiceMgr->pSynth[i] != NULL) in VMRender()
2881 VMUpdateStaticChannelParameters(pVoiceMgr, pVoiceMgr->pSynth[i]); in VMRender()
2896 pSynth = pVoiceMgr->pSynth[i]; in VMRender()
2898 if (pSynth== NULL) in VMRender()
2901 if (pSynth->synthFlags & SYNTH_FLAG_DEFERRED_MIDI_NOTE_OFF_PENDING) in VMRender()
2902 VMDeferredStopNote(pVoiceMgr, pSynth); in VMRender()
2905 if ((pSynth->synthFlags & SYNTH_FLAG_RESET_IS_REQUESTED) && in VMRender()
2906 (pSynth->numActiveVoices == 0)) in VMRender()
2916 VMInitializeAllChannels(pVoiceMgr, pSynth); in VMRender()
2917 VMInitializeAllVoices(pVoiceMgr, pSynth->vSynthNum); in VMRender()
2920 pSynth->synthFlags &= ~SYNTH_FLAG_RESET_IS_REQUESTED; in VMRender()
2925 pSynth->channels[channel].channelFlags &= ~CHANNEL_FLAG_UPDATE_CHANNEL_PARAMETERS; in VMRender()
3014 EAS_I32 VMActiveVoices (S_SYNTH *pSynth) in VMActiveVoices() argument
3016 return pSynth->numActiveVoices; in VMActiveVoices()
3090 if (pVoiceMgr->pSynth[i]) in VMSetSynthPolyphony()
3092 if (pVoiceMgr->pSynth[i]->synthFlags & SYNTH_FLAG_SP_MIDI_ON) in VMSetSynthPolyphony()
3093 VMMIPUpdateChannelMuting(pVoiceMgr, pVoiceMgr->pSynth[i]); in VMSetSynthPolyphony()
3095 pVoiceMgr->pSynth[i]->poolAlloc[0] = (EAS_U8) polyphonyCount; in VMSetSynthPolyphony()
3116 S_SYNTH *pSynth; in VMSetSynthPolyphony() local
3132 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)]; in VMSetSynthPolyphony()
3141 …currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STE… in VMSetSynthPolyphony()
3154 …currentPriority += pSynth->channels[GET_CHANNEL(pVoice->channel)].pool << CHANNEL_PRIORITY_STEAL_W… in VMSetSynthPolyphony()
3158 currentPriority += pSynth->priority << SYNTH_PRIORITY_WEIGHT; in VMSetSynthPolyphony()
3238 EAS_RESULT VMSetPolyphony (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 polyphonyCount) in VMSetPolyphony() argument
3250 pSynth->maxPolyphony = 0; in VMSetPolyphony()
3255 pSynth->maxPolyphony = (EAS_U16) polyphonyCount; in VMSetPolyphony()
3262 if (pSynth->synthFlags & SYNTH_FLAG_SP_MIDI_ON) in VMSetPolyphony()
3263 VMMIPUpdateChannelMuting(pVoiceMgr, pSynth); in VMSetPolyphony()
3265 pSynth->poolAlloc[0] = (EAS_U8) polyphonyCount; in VMSetPolyphony()
3268 if (pSynth->numActiveVoices <= polyphonyCount) in VMSetPolyphony()
3276 if (GET_VSYNTH(pVoiceMgr->voices[i].nextChannel) != pSynth->vSynthNum) in VMSetPolyphony()
3298 if (GET_VSYNTH(pVoice->nextChannel) != pSynth->vSynthNum) in VMSetPolyphony()
3308 …currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STE… in VMSetPolyphony()
3321 …currentPriority += pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool << CHANNEL_PRIORITY_STE… in VMSetPolyphony()
3366 EAS_RESULT VMGetPolyphony (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 *pPolyphonyCount) in VMGetPolyphony() argument
3368 *pPolyphonyCount = (EAS_U16) pSynth->maxPolyphony; in VMGetPolyphony()
3391 EAS_RESULT VMSetPriority (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 priority) in VMSetPriority() argument
3393 pSynth->priority = (EAS_U8) priority ; in VMSetPriority()
3416 EAS_RESULT VMGetPriority (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 *pPriority) in VMGetPriority() argument
3418 *pPriority = pSynth->priority; in VMGetPriority()
3440 void VMSetVolume (S_SYNTH *pSynth, EAS_U16 masterVolume) in VMSetVolume() argument
3442 pSynth->masterVolume = masterVolume; in VMSetVolume()
3443 pSynth->synthFlags |= SYNTH_FLAG_UPDATE_ALL_CHANNEL_PARAMETERS; in VMSetVolume()
3452 void VMSetPitchBendRange (S_SYNTH *pSynth, EAS_INT channel, EAS_I16 pitchBendRange) in VMSetPitchBendRange() argument
3454 pSynth->channels[channel].pitchBendSensitivity = pitchBendRange; in VMSetPitchBendRange()
3551 EAS_RESULT VMSetEASLib (S_SYNTH *pSynth, EAS_SNDLIB_HANDLE pEAS) in VMSetEASLib() argument
3559 pSynth->pEAS = pEAS; in VMSetEASLib()
3606 EAS_RESULT VMSetDLSLib (S_SYNTH *pSynth, EAS_DLSLIB_HANDLE pDLS) in VMSetDLSLib() argument
3608 pSynth->pDLS = pDLS; in VMSetDLSLib()
3631 void VMSetTranposition (S_SYNTH *pSynth, EAS_I32 transposition) in VMSetTranposition() argument
3633 pSynth->globalTranspose = (EAS_I8) transposition; in VMSetTranposition()
3654 void VMGetTranposition (S_SYNTH *pSynth, EAS_I32 *pTransposition) in VMGetTranposition() argument
3656 *pTransposition = pSynth->globalTranspose; in VMGetTranposition()
3665 EAS_I32 VMGetNoteCount (S_SYNTH *pSynth) in VMGetNoteCount() argument
3667 return pSynth->totalNoteCount; in VMGetNoteCount()
3686 void VMMIDIShutdown (S_EAS_DATA *pEASData, S_SYNTH *pSynth) in VMMIDIShutdown() argument
3691 if (--pSynth->refCount > 0) in VMMIDIShutdown()
3694 vSynthNum = pSynth->vSynthNum; in VMMIDIShutdown()
3699 if (pSynth->pDLS != NULL) in VMMIDIShutdown()
3702 if ((result = DLSCleanup(pEASData->hwInstData, pSynth->pDLS)) != EAS_SUCCESS) in VMMIDIShutdown()
3704 pSynth->pDLS = NULL; in VMMIDIShutdown()
3708 VMReset(pEASData->pVoiceMgr, pSynth, EAS_TRUE); in VMMIDIShutdown()
3712 EAS_HWFree(pEASData->hwInstData, pSynth); in VMMIDIShutdown()
3715 pEASData->pVoiceMgr->pSynth[vSynthNum] = NULL; in VMMIDIShutdown()
3763 void VMRegExtAudioCallback (S_SYNTH *pSynth, EAS_VOID_PTR pInstData, EAS_EXT_PRG_CHG_FUNC cbProgChg… in VMRegExtAudioCallback() argument
3765 pSynth->pExtAudioInstData = pInstData; in VMRegExtAudioCallback()
3766 pSynth->cbProgChgFunc = cbProgChgFunc; in VMRegExtAudioCallback()
3767 pSynth->cbEventFunc = cbEventFunc; in VMRegExtAudioCallback()
3776 void VMGetMIDIControllers (S_SYNTH *pSynth, EAS_U8 channel, S_MIDI_CONTROLLERS *pControl) in VMGetMIDIControllers() argument
3778 pControl->modWheel = pSynth->channels[channel].modWheel; in VMGetMIDIControllers()
3779 pControl->volume = pSynth->channels[channel].volume; in VMGetMIDIControllers()
3780 pControl->pan = pSynth->channels[channel].pan; in VMGetMIDIControllers()
3781 pControl->expression = pSynth->channels[channel].expression; in VMGetMIDIControllers()
3782 pControl->channelPressure = pSynth->channels[channel].channelPressure; in VMGetMIDIControllers()
3785 pControl->reverbSend = pSynth->channels[channel].reverbSend; in VMGetMIDIControllers()
3789 pControl->chorusSend = pSynth->channels[channel].chorusSend; in VMGetMIDIControllers()
3851 S_SYNTH *pSynth; in VMSanityCheck() local
3881 pSynth = pEASData->pVoiceMgr->pSynth[vSynthNum]; in VMSanityCheck()
3898 pSynth = pEASData->pVoiceMgr->pSynth[vSynthNum]; in VMSanityCheck()
3901 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->nextChannel)].pool]++; in VMSanityCheck()
3908 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->channel)].pool]++; in VMSanityCheck()
3914 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->channel)].pool]++; in VMSanityCheck()
3947 if (pEASData->pVoiceMgr->pSynth[i] == NULL) in VMSanityCheck()
3951 if (pEASData->pVoiceMgr->pSynth[i]->numActiveVoices > MAX_SYNTH_VOICES) in VMSanityCheck()
3958 if (poolCount[i][j] != pEASData->pVoiceMgr->pSynth[i]->poolCount[j]) in VMSanityCheck()