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 */
186 /* allocate 2op voice */
191 /* kill one voice on 2op channel, CHEAP */
199 bp->voice = i;
204 if (best[i].voice >= 0) {
206 printk(KERN_DEBUG "%s %iop allocation on voice %i\n",
208 best[i].voice);
210 return best[i].voice;
280 int voice;
311 /* in SEQ mode, drum voice numbers are notes on drum channel */
366 /* in SEQ mode, allocate voice on free OPL3 channel */
368 voice = opl3_get_voice(opl3, instr_4op, chan);
370 /* remap OSS voice */
371 voice = snd_opl3_oss_map[chan->number];
374 if (voice < 0) {
379 if (voice < MAX_OPL2_VOICES) {
382 voice_offset = voice;
387 voice_offset = voice - MAX_OPL2_VOICES;
391 /* kill voice on channel */
392 vp = &opl3->voices[voice];
399 vp2 = &opl3->voices[voice + 3];
458 /* Program the FM voice characteristics */
465 /* Set OPL3 AM_VIB register of requested voice/operator */
470 /* Set OPL3 KSL_LEVEL register of requested voice/operator */
475 /* Set OPL3 ATTACK_DECAY register of requested voice/operator */
480 /* Set OPL3 SUSTAIN_RELEASE register of requested voice/operator */
493 /* Set output voice connection */
505 /* Set output voice connection */
531 /* Set OPL3 FNUM_LOW register of requested voice */
535 opl3->voices[voice].keyon_reg = blocknum;
541 snd_printk(KERN_DEBUG " --> trigger voice %i\n", voice);
543 /* Set OPL3 KEYON_BLOCK register of requested voice */
549 opl3->voices[voice].note_off = jiffies +
552 opl3->voices[voice].note_off_check = 1;
554 opl3->voices[voice].note_off_check = 0;
567 vp2 = &opl3->voices[voice + 3];
574 /* 4op killed by 2op, release bounded voice */
575 vp2 = &opl3->voices[voice + 3];
583 debug_alloc(opl3, "note on ", voice);
604 static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)
612 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES))
615 vp = &opl3->voices[voice];
616 if (voice < MAX_OPL2_VOICES) {
619 voice_offset = voice;
623 voice_offset = voice - MAX_OPL2_VOICES;
626 /* kill voice */
628 snd_printk(KERN_DEBUG " --> kill voice %i\n", voice);
638 vp2 = &opl3->voices[voice + 3];
645 debug_alloc(opl3, "note off", voice);
658 int voice;
675 for (voice = 0; voice < opl3->max_voices; voice++) {
676 vp = &opl3->voices[voice];
678 snd_opl3_kill_voice(opl3, voice);
684 voice = snd_opl3_oss_map[chan->number];
685 snd_opl3_kill_voice(opl3, voice);
723 static void snd_opl3_update_pitch(struct snd_opl3 *opl3, int voice)
733 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES))
736 vp = &opl3->voices[voice];
740 if (voice < MAX_OPL2_VOICES) {
743 voice_offset = voice;
747 voice_offset = voice - MAX_OPL2_VOICES;
752 /* Set OPL3 FNUM_LOW register of requested voice */
761 /* Set OPL3 KEYON_BLOCK register of requested voice */
769 * Update voice pitch controller
773 int voice;
781 for (voice = 0; voice < opl3->max_voices; voice++) {
782 vp = &opl3->voices[voice];
784 snd_opl3_update_pitch(opl3, voice);
790 voice = snd_opl3_oss_map[chan->number];
791 snd_opl3_update_pitch(opl3, voice);