Lines Matching defs:voice
110 static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice) {
114 printk(KERN_DEBUG "time %.5i: %s [%.2i]: ", opl3->use_time, s, voice);
122 * Get a FM voice (channel) to play a note on.
126 int chan_4op_1; /* first voice for 4op instrument */
127 int chan_4op_2; /* second voice for 4op instrument */
145 int voice;
151 best[i].voice = -1;
169 /* allocate 4op voice */
175 /* kill one voice, CHEAP */
187 /* allocate 2op voice */
192 /* kill one voice on 2op channel, CHEAP */
200 bp->voice = i;
205 if (best[i].voice >= 0) {
207 printk(KERN_DEBUG "%s %iop allocation on voice %i\n",
209 best[i].voice);
211 return best[i].voice;
281 int voice;
312 /* in SEQ mode, drum voice numbers are notes on drum channel */
367 /* in SEQ mode, allocate voice on free OPL3 channel */
369 voice = opl3_get_voice(opl3, instr_4op, chan);
371 /* remap OSS voice */
372 voice = snd_opl3_oss_map[chan->number];
375 if (voice < 0) {
380 if (voice < MAX_OPL2_VOICES) {
383 voice_offset = voice;
388 voice_offset = voice - MAX_OPL2_VOICES;
392 /* kill voice on channel */
393 vp = &opl3->voices[voice];
400 vp2 = &opl3->voices[voice + 3];
459 /* Program the FM voice characteristics */
466 /* Set OPL3 AM_VIB register of requested voice/operator */
471 /* Set OPL3 KSL_LEVEL register of requested voice/operator */
476 /* Set OPL3 ATTACK_DECAY register of requested voice/operator */
481 /* Set OPL3 SUSTAIN_RELEASE register of requested voice/operator */
494 /* Set output voice connection */
506 /* Set output voice connection */
532 /* Set OPL3 FNUM_LOW register of requested voice */
536 opl3->voices[voice].keyon_reg = blocknum;
542 snd_printk(KERN_DEBUG " --> trigger voice %i\n", voice);
544 /* Set OPL3 KEYON_BLOCK register of requested voice */
550 opl3->voices[voice].note_off = jiffies +
553 opl3->voices[voice].note_off_check = 1;
555 opl3->voices[voice].note_off_check = 0;
568 vp2 = &opl3->voices[voice + 3];
575 /* 4op killed by 2op, release bounded voice */
576 vp2 = &opl3->voices[voice + 3];
584 debug_alloc(opl3, "note on ", voice);
605 static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)
613 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES))
616 vp = &opl3->voices[voice];
617 if (voice < MAX_OPL2_VOICES) {
620 voice_offset = voice;
624 voice_offset = voice - MAX_OPL2_VOICES;
627 /* kill voice */
629 snd_printk(KERN_DEBUG " --> kill voice %i\n", voice);
639 vp2 = &opl3->voices[voice + 3];
646 debug_alloc(opl3, "note off", voice);
659 int voice;
676 for (voice = 0; voice < opl3->max_voices; voice++) {
677 vp = &opl3->voices[voice];
679 snd_opl3_kill_voice(opl3, voice);
685 voice = snd_opl3_oss_map[chan->number];
686 snd_opl3_kill_voice(opl3, voice);
724 static void snd_opl3_update_pitch(struct snd_opl3 *opl3, int voice)
734 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES))
737 vp = &opl3->voices[voice];
741 if (voice < MAX_OPL2_VOICES) {
744 voice_offset = voice;
748 voice_offset = voice - MAX_OPL2_VOICES;
753 /* Set OPL3 FNUM_LOW register of requested voice */
762 /* Set OPL3 KEYON_BLOCK register of requested voice */
770 * Update voice pitch controller
774 int voice;
782 for (voice = 0; voice < opl3->max_voices; voice++) {
783 vp = &opl3->voices[voice];
785 snd_opl3_update_pitch(opl3, voice);
791 voice = snd_opl3_oss_map[chan->number];
792 snd_opl3_update_pitch(opl3, voice);