Lines Matching defs: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;
127 if (copy_from_user(&voice, argp, sizeof(struct snd_dm_fm_voice)))
129 return snd_opl3_set_voice(opl3, &voice);
361 /* Get register array side and offset of voice */
400 if (note->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ?
404 /* Get register array side and offset of voice */
405 if (note->voice < MAX_OPL2_VOICES) {
408 voice_offset = note->voice;
412 voice_offset = note->voice - MAX_OPL2_VOICES;
429 /* Set OPL3 KEYON_BLOCK register of requested voice */
437 static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice)
447 if (voice->op > 1)
451 if (voice->voice >= ((opl3->fm_mode == SNDRV_DM_FM_MODE_OPL3) ?
455 /* Get register array side and offset of voice */
456 if (voice->voice < MAX_OPL2_VOICES) {
459 voice_offset = voice->voice;
463 voice_offset = voice->voice - MAX_OPL2_VOICES;
467 voice_op = array_index_nospec(voice->op, 4);
472 if (voice->am)
475 if (voice->vibrato)
478 if (voice->do_sustain)
481 if (voice->kbd_scale)
484 reg_val |= voice->harmonic & OPL3_MULTIPLE_MASK;
486 /* Set OPL3 AM_VIB register of requested voice/operator */
491 reg_val = (voice->scale_level << 6) & OPL3_KSL_MASK;
493 reg_val |= ~voice->volume & OPL3_TOTAL_LEVEL_MASK;
495 /* Set OPL3 KSL_LEVEL register of requested voice/operator */
500 reg_val = (voice->attack << 4) & OPL3_ATTACK_MASK;
502 reg_val |= voice->decay & OPL3_DECAY_MASK;
504 /* Set OPL3 ATTACK_DECAY register of requested voice/operator */
509 reg_val = (voice->sustain << 4) & OPL3_SUSTAIN_MASK;
511 reg_val |= voice->release & OPL3_RELEASE_MASK;
513 /* Set OPL3 SUSTAIN_RELEASE register of requested voice/operator */
518 reg_val = (voice->feedback << 1) & OPL3_FEEDBACK_MASK;
520 if (voice->connection)
524 if (voice->left)
526 if (voice->right)
529 /* Feedback/connection bits are applicable to voice */
534 reg_val = voice->waveform & OPL3_WAVE_SELECT_MASK;