Lines Matching full:voice
25 * with another voice to a 4 OP voice. For example voice 0
26 * can be connected with voice 3. The operators of voice 3 are
27 * used as operators 3 and 4 of the new 4 OP voice.
28 * In this case the 2 OP voice number 0 is the 'first half' and
29 * voice 3 is the second.
61 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice);
126 struct snd_dm_fm_voice voice; in snd_opl3_ioctl() local
127 if (copy_from_user(&voice, argp, sizeof(struct snd_dm_fm_voice))) in snd_opl3_ioctl()
129 return snd_opl3_set_voice(opl3, &voice); in snd_opl3_ioctl()
359 /* Get register array side and offset of voice */ in snd_opl3_reset()
398 if (note->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ? in snd_opl3_play_note()
402 /* Get register array side and offset of voice */ in snd_opl3_play_note()
403 if (note->voice < MAX_OPL2_VOICES) { in snd_opl3_play_note()
406 voice_offset = note->voice; in snd_opl3_play_note()
410 voice_offset = note->voice - MAX_OPL2_VOICES; in snd_opl3_play_note()
427 /* Set OPL3 KEYON_BLOCK register of requested voice */ in snd_opl3_play_note()
435 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice) in snd_opl3_set_voice() argument
445 if (voice->op > 1) in snd_opl3_set_voice()
449 if (voice->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ? in snd_opl3_set_voice()
453 /* Get register array side and offset of voice */ in snd_opl3_set_voice()
454 if (voice->voice < MAX_OPL2_VOICES) { in snd_opl3_set_voice()
457 voice_offset = voice->voice; in snd_opl3_set_voice()
461 voice_offset = voice->voice - MAX_OPL2_VOICES; in snd_opl3_set_voice()
465 voice_op = array_index_nospec(voice->op, 4); in snd_opl3_set_voice()
470 if (voice->am) in snd_opl3_set_voice()
473 if (voice->vibrato) in snd_opl3_set_voice()
476 if (voice->do_sustain) in snd_opl3_set_voice()
479 if (voice->kbd_scale) in snd_opl3_set_voice()
482 reg_val |= voice->harmonic & OPL3_MULTIPLE_MASK; in snd_opl3_set_voice()
484 /* Set OPL3 AM_VIB register of requested voice/operator */ in snd_opl3_set_voice()
489 reg_val = (voice->scale_level << 6) & OPL3_KSL_MASK; in snd_opl3_set_voice()
491 reg_val |= ~voice->volume & OPL3_TOTAL_LEVEL_MASK; in snd_opl3_set_voice()
493 /* Set OPL3 KSL_LEVEL register of requested voice/operator */ in snd_opl3_set_voice()
498 reg_val = (voice->attack << 4) & OPL3_ATTACK_MASK; in snd_opl3_set_voice()
500 reg_val |= voice->decay & OPL3_DECAY_MASK; in snd_opl3_set_voice()
502 /* Set OPL3 ATTACK_DECAY register of requested voice/operator */ in snd_opl3_set_voice()
507 reg_val = (voice->sustain << 4) & OPL3_SUSTAIN_MASK; in snd_opl3_set_voice()
509 reg_val |= voice->release & OPL3_RELEASE_MASK; in snd_opl3_set_voice()
511 /* Set OPL3 SUSTAIN_RELEASE register of requested voice/operator */ in snd_opl3_set_voice()
516 reg_val = (voice->feedback << 1) & OPL3_FEEDBACK_MASK; in snd_opl3_set_voice()
518 if (voice->connection) in snd_opl3_set_voice()
522 if (voice->left) in snd_opl3_set_voice()
524 if (voice->right) in snd_opl3_set_voice()
527 /* Feedback/connection bits are applicable to voice */ in snd_opl3_set_voice()
532 reg_val = voice->waveform & OPL3_WAVE_SELECT_MASK; in snd_opl3_set_voice()