Lines Matching full:voice

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