Lines Matching defs:voice
117 static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice)
127 opl3->use_time, s, voice, buf);
132 * Get a FM voice (channel) to play a note on.
136 int chan_4op_1; /* first voice for 4op instrument */
137 int chan_4op_2; /* second voice for 4op instrument */
155 int voice;
161 best[i].voice = -1;
179 /* allocate 4op voice */
185 /* kill one voice, CHEAP */
196 /* allocate 2op voice */
201 /* kill one voice on 2op channel, CHEAP */
209 bp->voice = i;
214 if (best[i].voice >= 0) {
217 "%s %iop allocation on voice %i\n",
219 best[i].voice);
221 return best[i].voice;
287 int voice;
315 /* in SEQ mode, drum voice numbers are notes on drum channel */
364 /* in SEQ mode, allocate voice on free OPL3 channel */
366 voice = opl3_get_voice(opl3, instr_4op, chan);
368 /* remap OSS voice */
369 voice = snd_opl3_oss_map[chan->number];
372 if (voice < 0)
375 if (voice < MAX_OPL2_VOICES) {
378 voice_offset = voice;
383 voice_offset = voice - MAX_OPL2_VOICES;
387 /* kill voice on channel */
388 vp = &opl3->voices[voice];
395 vp2 = &opl3->voices[voice + 3];
452 /* Program the FM voice characteristics */
457 /* Set OPL3 AM_VIB register of requested voice/operator */
462 /* Set OPL3 KSL_LEVEL register of requested voice/operator */
467 /* Set OPL3 ATTACK_DECAY register of requested voice/operator */
472 /* Set OPL3 SUSTAIN_RELEASE register of requested voice/operator */
485 /* Set output voice connection */
497 /* Set output voice connection */
523 /* Set OPL3 FNUM_LOW register of requested voice */
527 opl3->voices[voice].keyon_reg = blocknum;
532 opl3_dbg(opl3, " --> trigger voice %i\n", voice);
533 /* Set OPL3 KEYON_BLOCK register of requested voice */
539 opl3->voices[voice].note_off = jiffies +
542 opl3->voices[voice].note_off_check = 1;
544 opl3->voices[voice].note_off_check = 0;
557 vp2 = &opl3->voices[voice + 3];
564 /* 4op killed by 2op, release bounded voice */
565 vp2 = &opl3->voices[voice + 3];
573 debug_alloc(opl3, "note on ", voice);
591 static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)
599 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES))
602 vp = &opl3->voices[voice];
603 if (voice < MAX_OPL2_VOICES) {
606 voice_offset = voice;
610 voice_offset = voice - MAX_OPL2_VOICES;
613 /* kill voice */
614 opl3_dbg(opl3, " --> kill voice %i\n", voice);
623 vp2 = &opl3->voices[voice + 3];
630 debug_alloc(opl3, "note off", voice);
643 int voice;
658 for (voice = 0; voice < opl3->max_voices; voice++) {
659 vp = &opl3->voices[voice];
661 snd_opl3_kill_voice(opl3, voice);
667 voice = snd_opl3_oss_map[chan->number];
668 snd_opl3_kill_voice(opl3, voice);
700 static void snd_opl3_update_pitch(struct snd_opl3 *opl3, int voice)
710 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES))
713 vp = &opl3->voices[voice];
717 if (voice < MAX_OPL2_VOICES) {
720 voice_offset = voice;
724 voice_offset = voice - MAX_OPL2_VOICES;
729 /* Set OPL3 FNUM_LOW register of requested voice */
738 /* Set OPL3 KEYON_BLOCK register of requested voice */
746 * Update voice pitch controller
750 int voice;
756 for (voice = 0; voice < opl3->max_voices; voice++) {
757 vp = &opl3->voices[voice];
759 snd_opl3_update_pitch(opl3, voice);
765 voice = snd_opl3_oss_map[chan->number];
766 snd_opl3_update_pitch(opl3, voice);