Home | History | Annotate | Download | only in lib_src

Lines Matching full:channel

165 EAS_INLINE EAS_U8 VSynthToChannel (S_SYNTH *pSynth, EAS_U8 channel)
168 return channel | (pSynth->vSynthNum << 4);
179 pVoice->channel = UNASSIGNED_SYNTH_CHANNEL;
211 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
212 pool = pSynth->channels[GET_CHANNEL(pVoice->channel)].pool;
244 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
245 pool = pSynth->channels[GET_CHANNEL(pVoice->channel)].pool;
504 /* init each channel */
514 /* the drum channel needs a different init */
569 /* update all voices on this channel */
595 if (GET_VSYNTH(pVoiceMgr->voices[i].channel) == vSynthNum)
625 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
682 * Sets the priority and MIP level for a MIDI channel
686 void VMSetMIPEntry (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 priority, EAS_U8 mip)
690 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMSetMIPEntry: channel=%d, priority=%d, MIP=%d\n", channel, priority, mip); */ }
696 pSynth->channels[channel].pool = priority;
697 pSynth->channels[channel].mip = mip;
713 EAS_INT channel;
731 /* channel must be in MIP message and must meet allocation target */
749 /* get channel and virtual synth */
752 vSynthNum = GET_VSYNTH(pVoiceMgr->voices[i].channel);
753 channel = GET_CHANNEL(pVoiceMgr->voices[i].channel);
758 channel = GET_CHANNEL(pVoiceMgr->voices[i].nextChannel);
766 pool = pSynth->channels[channel].pool;
769 if (pSynth->channels[channel].channelFlags & CHANNEL_FLAG_MUTE)
771 /* mute stolen voices scheduled to play on this channel */
853 /* update channel muting */
884 /* for stolen voices, check new channel */
891 else if (pSynth->vSynthNum == GET_VSYNTH(pVoiceMgr->voices[i].channel))
938 if (GET_VSYNTH(pVoiceMgr->voices[i].channel) == pSynth->vSynthNum)
967 * Quickly mute all notes on the given channel.
970 * nChannel - quickly turn off all notes on this channel
976 * - forces all voices on this channel to update their envelope states to mute
980 void VMAllNotesOff (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel)
986 if (channel >= NUM_SYNTH_CHANNELS)
988 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMAllNotesOff: error, %d invalid channel number\n",
989 channel); */ }
998 channel = VSynthToChannel(pSynth, channel);
1004 if (((pVoice->voiceState != eVoiceStateStolen) && (channel == pVoice->channel)) ||
1005 ((pVoice->voiceState == eVoiceStateStolen) && (channel == pVoice->nextChannel)))
1007 /* this voice is assigned to the requested channel */
1036 EAS_INT channel;
1068 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMDeferredStopNote: defer request to stop voice %d (channel=%d note=%d) - voice not started\n",
1088 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMDeferredStopNote: Stop voice %d (channel=%d note=%d)\n",
1094 channel = pVoiceMgr->voices[voiceNum].channel & 15;
1097 if (pSynth->channels[channel].channelFlags & CHANNEL_FLAG_SUSTAIN_PEDAL)
1099 GetSynthPtr(voiceNum)->pfSustainPedal(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], &pSynth->channels[channel], GetAdjustedVoiceNum(voiceNum));
1123 * damper pedal off. This means all notes in this channel
1129 * nChannel - this channel has its sustain pedal transitioning from on to off
1134 * any voice with deferred note offs on this channel are updated such that
1140 void VMReleaseAllDeferredNoteOffs (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel)
1146 if (channel >= NUM_SYNTH_CHANNELS)
1148 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMReleaseAllDeferredNoteOffs: error, %d invalid channel number\n",
1149 channel); */ }
1157 /* find all the voices assigned to this channel */
1158 channel = VSynthToChannel(pSynth, channel);
1163 if (channel == pVoice->channel)
1195 * nChannel - this channel has its sustain pedal transitioning from on to off
1201 void VMCatchNotesForSustainPedal (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel)
1206 if (channel >= NUM_SYNTH_CHANNELS)
1208 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMCatchNotesForSustainPedal: error, %d invalid channel number\n",
1209 channel); */ }
1215 channel = VSynthToChannel(pSynth, channel);
1217 /* find all the voices assigned to this channel */
1220 if (channel == pVoiceMgr->voices[voiceNum].channel)
1223 GetSynthPtr(voiceNum)->pfSustainPedal(pVoiceMgr, pSynth, &pVoiceMgr->voices[voiceNum], &pSynth->channels[channel], GetAdjustedVoiceNum(voiceNum));
1263 * nChannel - the channel to start a note on
1271 static void VMStolenVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_I32 voiceNum, EAS_U8 channel, EAS_U8 note, EAS_U8 velocity, EAS_U16 regionIndex)
1279 GetSynthPtr(voiceNum)->pfMuteVoice(pVoiceMgr, pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)], &pVoiceMgr->voices[voiceNum], GetAdjustedVoiceNum(voiceNum));
1283 pVoice->nextChannel = VSynthToChannel(pSynth, channel);
1374 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
1375 pMIDIChannel = &pSynth->channels[pVoice->channel & 15];
1379 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMRetargetStolenVoice: retargeting stolen voice %d on channel %d\n",
1380 voiceNum, pVoice->channel); */ }
1382 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\to channel %d note: %d velocity: %d\n",
1386 /* make sure new channel hasn't been muted by SP-MIDI since the voice was stolen */
1395 if (pVoice->channel != pVoice->nextChannel)
1404 /* assign new channel number, and increase channel voice count */
1405 pVoice->channel = pVoice->nextChannel;
1406 pMIDIChannel = &pNextSynth->channels[pVoice->channel & 15];
1447 void VMCheckKeyGroup (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U16 keyGroup, EAS_U8 channel)
1456 channel = VSynthToChannel(pSynth, channel);
1461 /* voice must be on the same channel */
1462 if (channel == pVoiceMgr->voices[voiceNum].channel)
1486 /* voice must be on the same channel */
1487 if (channel == pVoiceMgr->voices[voiceNum].nextChannel)
1515 * We only play at most 2 of the same note on a MIDI channel.
1521 * nChannel - synth channel that wants to start a new note
1535 EAS_BOOL VMCheckPolyphonyLimiting (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 velocity, EAS_U16 regionIndex, EAS_I32 lowVoice, EAS_I32 highVoice)
1548 channel = VSynthToChannel(pSynth, channel);
1550 /* examine each voice on this channel playing this note */
1557 /* same channel and note ? */
1558 if ((channel == pVoiceMgr->voices[voiceNum].channel) && (note == pVoiceMgr->voices[voiceNum].note))
1575 /* same channel and note ? */
1576 if ((channel == pVoiceMgr->voices[voiceNum].nextChannel) && (note == pVoiceMgr->voices[voiceNum].nextNote))
1594 VMStolenVoice(pVoiceMgr, pSynth, oldestVoiceNum, channel, note, velocity, regionIndex);
1610 void VMStartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 velocity, EAS_U16 regionIndex)
1619 pChannel = &pSynth->channels[channel];
1655 VMCheckKeyGroup(pVoiceMgr, pSynth, keyGroup, channel);
1660 if (VMCheckPolyphonyLimiting(pVoiceMgr, pSynth, channel, note, velocity, regionIndex, lowVoice, highVoice) == EAS_TRUE)
1687 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMStartVoice: voice %d assigned to channel %d note %d velocity %d\n",
1688 voiceNum, channel, note, velocity); */ }
1692 pVoiceMgr->voices[voiceNum].channel = VSynthToChannel(pSynth, channel);
1712 if (VMStealVoice(pVoiceMgr, pSynth, &voiceNum, channel, note, lowVoice, highVoice) == EAS_SUCCESS)
1713 VMStolenVoice(pVoiceMgr, pSynth, voiceNum, channel, note, velocity, regionIndex);
1718 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMStartVoice: Could not steal a voice for channel %d note %d velocity %d\n",
1719 channel, note, velocity); */ }
1731 * channel if possible.
1734 * nChannel - the channel to start a note on
1747 void VMStartNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 velocity)
1756 pChannel = &pSynth->channels[channel];
1758 /* check channel mute */
1767 event.channel = channel;
1809 VMStartVoice(pVoiceMgr, pSynth, channel, note, velocity, regionIndex);
1833 VMStartVoice(pVoiceMgr, pSynth, channel, note, velocity, regionIndex);
1852 * channel.
1855 * nChannel - the channel to stop a note on
1868 void VMStopNote (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 note, EAS_U8 velocity)
1873 pChannel = &(pSynth->channels[channel]);
1879 event.channel = channel;
1891 channel = VSynthToChannel(pSynth, channel);
1900 /* channel and key number must match */
1901 if ((channel == pVoiceMgr->voices[voiceNum].channel) && (note == pVoiceMgr->voices[voiceNum].note))
1904 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMStopNote: voice %d channel %d note %d\n",
1905 voiceNum, channel, note); */ }
1932 /* process stolen notes, new channel and key number must match */
1933 else if ((channel == pVoiceMgr->voices[voiceNum].nextChannel) && (note == pVoiceMgr->voices[voiceNum].nextNote))
1937 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMStopNote: voice %d channel %d note %d\n\tDeferred: Stolen voice\n",
1938 voiceNum, channel, note); */ }
1964 /* Check each voice to see if it has been assigned to a synth channel */
1967 /* check if this voice has been assigned to a synth channel */
1991 * account SP-Midi channel priorities and polyphony allocation.
1995 * Priority of the voice's MIDI channel
1996 * Number of voices over the polyphony allocation for voice's MIDI channel
2004 * nChannel - the channel that this voice wants to be started on
2013 EAS_RESULT VMStealVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_INT *pVoiceNumber, EAS_U8 channel, EAS_U8 note, EAS_I32 lowVoice, EAS_I32 highVoice)
2045 pCurrSynth = pVoiceMgr->pSynth[GET_VSYNTH(pCurrVoice->channel)];
2046 currChannel = pCurrVoice->channel;
2074 /* in SP-MIDI mode, include over poly allocation and channel priority */
2082 /* include channel priority */
2087 if ((note == currNote) && (channel == currChannel))
2127 * Change the channel pressure for the given channel
2130 * nChannel - the MIDI channel
2131 * nVelocity - the channel pressure value
2139 void VMChannelPressure (S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 value)
2143 pChannel = &(pSynth->channels[channel]);
2147 set a channel flag to request parameter updates
2148 for all the voices associated with this channel
2157 * Change the pitch wheel value for the given channel.
2169 * nChannel - the MIDI channel
2181 void VMPitchBend (S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 nPitchLSB, EAS_U8 nPitchMSB)
2185 pChannel = &(pSynth->channels[channel]);
2189 set a channel flag to request parameter updates
2190 for all the voices associated with this channel
2199 * Change the controller (or mode) for the given channel.
2202 * nChannel - the MIDI channel
2213 void VMControlChange (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 controller, EAS_U8 value)
2217 pChannel = &(pSynth->channels[channel]);
2220 set a channel flag to request parameter updates
2221 for all the voices associated with this channel
2283 damper pedal OFF. This means all notes in this channel
2288 VMReleaseAllDeferredNoteOffs(pVoiceMgr, pSynth, channel);
2312 VMCatchNotesForSustainPedal(pVoiceMgr, pSynth, channel);
2323 pSynth->channels[channel].reverbSend = value;
2329 pSynth->channels[channel].chorusSend = value;
2341 /* reset channel pressure */
2351 program change, bank select, channel volume CC7, pan CC10
2371 VMUpdateRPNStateMachine(pSynth, channel, controller, value);
2381 VMAllNotesOff(pVoiceMgr, pSynth, channel);
2407 * nChannel - the channel this controller message is coming from
2422 EAS_RESULT VMUpdateRPNStateMachine (S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 controller, EAS_U8 value)
2427 if (channel >= NUM_SYNTH_CHANNELS)
2429 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "VMUpdateRPNStateMachines: error, %d invalid channel number\n",
2430 channel); */ }
2435 pChannel = &(pSynth->channels[channel]);
2495 * Update all of the static channel parameters for channels that have had
2515 EAS_INT channel;
2520 the synth wants us to forcibly update all channel
2524 for (channel = 0; channel < NUM_SYNTH_CHANNELS; channel++)
2527 if (pSynth->channels[channel].regionIndex & FLAG_RGN_IDX_FM_SYNTH)
2528 pSecondarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel);
2530 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel);
2532 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel);
2538 updated all channel parameters
2545 /* only update channel params if signalled by a channel flag */
2546 for (channel = 0; channel < NUM_SYNTH_CHANNELS; channel++)
2548 if ( 0 != (pSynth->channels[channel].channelFlags & CHANNEL_FLAG_UPDATE_CHANNEL_PARAMETERS))
2551 if (pSynth->channels[channel].regionIndex & FLAG_RGN_IDX_FM_SYNTH)
2552 pSecondarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel);
2554 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel);
2556 pPrimarySynth->pfUpdateChannel(pVoiceMgr, pSynth, (EAS_U8) channel);
2666 * Change the instrument (program) for the given channel.
2668 * Depending on the program number, and the bank selected for this channel, the
2673 * wavetable to use for this channel. Also the channel may switch from a melodic
2674 * channel to a rhythm channel, or vice versa.
2687 void VMProgramChange (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel, EAS_U8 program)
2694 { /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "VMProgramChange: vSynthNum=%d, channel=%d, program=%d\n", pSynth->vSynthNum, channel, program); */ }
2697 /* setup pointer to MIDI channel data */
2698 pChannel = &pSynth->channels[channel];
2704 /* make it a rhythm channel */
2709 /* make it a melody channel */
2720 prgChg.channel = channel;
2743 if (pSynth->channels[channel].channelFlags & CHANNEL_FLAG_RHYTHM_CHANNEL)
2759 /* we have our new program change for this channel */
2764 set a channel flag to request parameter updates
2765 for all the voices associated with this channel
2814 pSynth = pVoiceMgr->pSynth[pVoiceMgr->voices[voiceNum].channel >> 4];
2870 EAS_INT channel;
2876 channel parameters */
2923 /* clear channel update flags */
2924 for (channel = 0; channel < NUM_SYNTH_CHANNELS; channel++)
2925 pSynth->channels[channel].channelFlags &= ~CHANNEL_FLAG_UPDATE_CHANNEL_PARAMETERS;
3087 /* if SPMIDI enabled, update channel masking based on new polyphony */
3132 pSynth = pVoiceMgr->pSynth[GET_VSYNTH(pVoice->channel)];
3140 /* include channel priority */
3153 /* include channel priority */
3154 currentPriority += pSynth->channels[GET_CHANNEL(pVoice->channel)].pool << CHANNEL_PRIORITY_STEAL_WEIGHT;
3261 /* if SP-MIDI mode, update the channel muting */
3307 /* include channel priority */
3320 /* include channel priority */
3449 * Set the pitch bend range for the given channel.
3452 void VMSetPitchBendRange (S_SYNTH *pSynth, EAS_INT channel, EAS_I16 pitchBendRange)
3454 pSynth->channels[channel].pitchBendSensitivity = pitchBendRange;
3773 * Returns the MIDI controller values on the specified channel
3776 void VMGetMIDIControllers (S_SYNTH *pSynth, EAS_U8 channel, S_MIDI_CONTROLLERS *pControl)
3778 pControl->modWheel = pSynth->channels[channel].modWheel;
3779 pControl->volume = pSynth->channels[channel].volume;
3780 pControl->pan = pSynth->channels[channel].pan;
3781 pControl->expression = pSynth->channels[channel].expression;
3782 pControl->channelPressure = pSynth->channels[channel].channelPressure;
3785 pControl->reverbSend = pSynth->channels[channel].reverbSend;
3789 pControl->chorusSend = pSynth->channels[channel].chorusSend;
3874 vSynthNum = GET_VSYNTH(pVoice->channel);
3908 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->channel)].pool]++;
3914 poolCount[vSynthNum][pSynth->channels[GET_CHANNEL(pVoice->channel)].pool]++;