Lines Matching full:voice
117 static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice) in debug_alloc() argument
127 opl3->use_time, s, voice, buf); in debug_alloc()
132 * Get a FM voice (channel) to play a note on.
136 int chan_4op_1; /* first voice for 4op instrument */ in opl3_get_voice()
137 int chan_4op_2; /* second voice for 4op instrument */ in opl3_get_voice()
155 int voice; in opl3_get_voice() member
161 best[i].voice = -1; in opl3_get_voice()
179 /* allocate 4op voice */ in opl3_get_voice()
185 /* kill one voice, CHEAP */ in opl3_get_voice()
196 /* allocate 2op voice */ in opl3_get_voice()
201 /* kill one voice on 2op channel, CHEAP */ in opl3_get_voice()
209 bp->voice = i; in opl3_get_voice()
214 if (best[i].voice >= 0) { in opl3_get_voice()
217 "%s %iop allocation on voice %i\n", in opl3_get_voice()
219 best[i].voice); in opl3_get_voice()
221 return best[i].voice; in opl3_get_voice()
291 int voice; in snd_opl3_note_on() local
320 /* in SEQ mode, drum voice numbers are notes on drum channel */ in snd_opl3_note_on()
373 /* in SEQ mode, allocate voice on free OPL3 channel */ in snd_opl3_note_on()
375 voice = opl3_get_voice(opl3, instr_4op, chan); in snd_opl3_note_on()
377 /* remap OSS voice */ in snd_opl3_note_on()
378 voice = snd_opl3_oss_map[chan->number]; in snd_opl3_note_on()
381 if (voice < 0) { in snd_opl3_note_on()
386 if (voice < MAX_OPL2_VOICES) { in snd_opl3_note_on()
389 voice_offset = voice; in snd_opl3_note_on()
394 voice_offset = voice - MAX_OPL2_VOICES; in snd_opl3_note_on()
398 /* kill voice on channel */ in snd_opl3_note_on()
399 vp = &opl3->voices[voice]; in snd_opl3_note_on()
406 vp2 = &opl3->voices[voice + 3]; in snd_opl3_note_on()
463 /* Program the FM voice characteristics */ in snd_opl3_note_on()
468 /* Set OPL3 AM_VIB register of requested voice/operator */ in snd_opl3_note_on()
473 /* Set OPL3 KSL_LEVEL register of requested voice/operator */ in snd_opl3_note_on()
478 /* Set OPL3 ATTACK_DECAY register of requested voice/operator */ in snd_opl3_note_on()
483 /* Set OPL3 SUSTAIN_RELEASE register of requested voice/operator */ in snd_opl3_note_on()
496 /* Set output voice connection */ in snd_opl3_note_on()
508 /* Set output voice connection */ in snd_opl3_note_on()
534 /* Set OPL3 FNUM_LOW register of requested voice */ in snd_opl3_note_on()
538 opl3->voices[voice].keyon_reg = blocknum; in snd_opl3_note_on()
543 opl3_dbg(opl3, " --> 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()
603 static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice) in snd_opl3_kill_voice() argument
611 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES)) in snd_opl3_kill_voice()
614 vp = &opl3->voices[voice]; in snd_opl3_kill_voice()
615 if (voice < MAX_OPL2_VOICES) { in snd_opl3_kill_voice()
618 voice_offset = voice; in snd_opl3_kill_voice()
622 voice_offset = voice - MAX_OPL2_VOICES; in snd_opl3_kill_voice()
625 /* kill voice */ in snd_opl3_kill_voice()
626 opl3_dbg(opl3, " --> kill voice %i\n", voice); in snd_opl3_kill_voice()
635 vp2 = &opl3->voices[voice + 3]; in snd_opl3_kill_voice()
642 debug_alloc(opl3, "note off", voice); in snd_opl3_kill_voice()
655 int voice; in snd_opl3_note_off_unsafe() local
670 for (voice = 0; voice < opl3->max_voices; voice++) { in snd_opl3_note_off_unsafe()
671 vp = &opl3->voices[voice]; in snd_opl3_note_off_unsafe()
673 snd_opl3_kill_voice(opl3, voice); in snd_opl3_note_off_unsafe()
679 voice = snd_opl3_oss_map[chan->number]; in snd_opl3_note_off_unsafe()
680 snd_opl3_kill_voice(opl3, voice); in snd_opl3_note_off_unsafe()
714 static void snd_opl3_update_pitch(struct snd_opl3 *opl3, int voice) in snd_opl3_update_pitch() argument
724 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES)) in snd_opl3_update_pitch()
727 vp = &opl3->voices[voice]; in snd_opl3_update_pitch()
731 if (voice < MAX_OPL2_VOICES) { in snd_opl3_update_pitch()
734 voice_offset = voice; in snd_opl3_update_pitch()
738 voice_offset = voice - MAX_OPL2_VOICES; in snd_opl3_update_pitch()
743 /* Set OPL3 FNUM_LOW register of requested voice */ in snd_opl3_update_pitch()
752 /* Set OPL3 KEYON_BLOCK register of requested voice */ in snd_opl3_update_pitch()
760 * Update voice pitch controller
764 int voice; in snd_opl3_pitch_ctrl() local
772 for (voice = 0; voice < opl3->max_voices; voice++) { in snd_opl3_pitch_ctrl()
773 vp = &opl3->voices[voice]; in snd_opl3_pitch_ctrl()
775 snd_opl3_update_pitch(opl3, voice); in snd_opl3_pitch_ctrl()
781 voice = snd_opl3_oss_map[chan->number]; in snd_opl3_pitch_ctrl()
782 snd_opl3_update_pitch(opl3, voice); in snd_opl3_pitch_ctrl()