• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/sound/drivers/opl4/

Lines Matching refs:voice

313 				 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
317 struct opl4_voice *voice;
321 voice = &opl4->voices[i];
322 if (voice->chan == chan && voice->note == note) {
323 func(opl4, voice);
334 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
338 struct opl4_voice *voice;
342 voice = &opl4->voices[i];
343 if (voice->chan == chan) {
344 func(opl4, voice);
354 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
358 struct opl4_voice *voice;
362 voice = &opl4->voices[i];
363 if (voice->chan)
364 func(opl4, voice);
369 static void snd_opl4_update_volume(struct snd_opl4 *opl4, struct opl4_voice *voice)
373 att = voice->sound->tone_attenuate;
375 att += snd_opl4_volume_table[voice->chan->gm_volume & 0x7f];
376 att += snd_opl4_volume_table[voice->chan->gm_expression & 0x7f];
377 att += snd_opl4_volume_table[voice->velocity];
378 att = 0x7f - (0x7f - att) * (voice->sound->volume_factor) / 0xfe - volume_boost;
383 snd_opl4_write(opl4, OPL4_REG_LEVEL + voice->number,
384 (att << 1) | voice->level_direct);
385 voice->level_direct = 0;
388 static void snd_opl4_update_pan(struct snd_opl4 *opl4, struct opl4_voice *voice)
390 int pan = voice->sound->panpot;
392 if (!voice->chan->drum_channel)
393 pan += (voice->chan->control[MIDI_CTL_MSB_PAN] - 0x40) >> 3;
398 voice->reg_misc = (voice->reg_misc & ~OPL4_PAN_POT_MASK)
400 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
404 struct opl4_voice *voice)
408 if (voice->chan->drum_channel)
410 depth = (7 - voice->sound->vibrato)
411 * (voice->chan->control[MIDI_CTL_VIBRATO_DEPTH] & 0x7f);
412 depth = (depth >> 7) + voice->sound->vibrato;
413 voice->reg_lfo_vibrato &= ~OPL4_VIBRATO_DEPTH_MASK;
414 voice->reg_lfo_vibrato |= depth & OPL4_VIBRATO_DEPTH_MASK;
415 snd_opl4_write(opl4, OPL4_REG_LFO_VIBRATO + voice->number,
416 voice->reg_lfo_vibrato);
420 struct opl4_voice *voice)
422 struct snd_midi_channel *chan = voice->chan;
425 note = chan->drum_channel ? 60 : voice->note;
430 pitch = ((note - 60) << 7) * voice->sound->key_scaling / 100 + (60 << 7);
431 pitch += voice->sound->pitch_offset;
443 snd_opl4_write(opl4, OPL4_REG_OCTAVE + voice->number,
445 voice->reg_f_number = (voice->reg_f_number & OPL4_TONE_NUMBER_BIT8)
447 snd_opl4_write(opl4, OPL4_REG_F_NUMBER + voice->number, voice->reg_f_number);
451 struct opl4_voice *voice)
453 snd_opl4_write(opl4, OPL4_REG_ATTACK_DECAY1 + voice->number,
454 voice->sound->reg_attack_decay1);
455 snd_opl4_write(opl4, OPL4_REG_LEVEL_DECAY2 + voice->number,
456 voice->sound->reg_level_decay2);
457 snd_opl4_write(opl4, OPL4_REG_RELEASE_CORRECTION + voice->number,
458 voice->sound->reg_release_correction);
459 snd_opl4_write(opl4, OPL4_REG_TREMOLO + voice->number,
460 voice->sound->reg_tremolo);
463 /* allocate one voice */
466 /* first, try to get the oldest key-off voice */
469 /* then get the oldest key-on voice */
486 struct opl4_voice *voice[2];
491 /* determine the number of voices and voice parameters */
506 voice[i] = snd_opl4_get_voice(opl4);
507 list_del(&voice[i]->list);
508 list_add_tail(&voice[i]->list, &opl4->on_voices);
509 voice[i]->chan = chan;
510 voice[i]->note = note;
511 voice[i]->velocity = vel & 0x7f;
512 voice[i]->sound = sound[i];
517 voice[i]->reg_f_number =
519 snd_opl4_write(opl4, OPL4_REG_F_NUMBER + voice[i]->number,
520 voice[i]->reg_f_number);
521 snd_opl4_write(opl4, OPL4_REG_TONE_NUMBER + voice[i]->number,
527 voice[i]->reg_misc = OPL4_LFO_RESET_BIT;
528 snd_opl4_update_pan(opl4, voice[i]);
529 snd_opl4_update_pitch(opl4, voice[i]);
530 voice[i]->level_direct = OPL4_LEVEL_DIRECT_BIT;
531 snd_opl4_update_volume(opl4, voice[i]);
541 snd_opl4_update_tone_parameters(opl4, voice[i]);
542 voice[i]->reg_lfo_vibrato = voice[i]->sound->reg_lfo_vibrato;
543 snd_opl4_update_vibrato_depth(opl4, voice[i]);
548 voice[i]->reg_misc =
549 (voice[i]->reg_misc & 0x1f) | OPL4_KEY_ON_BIT;
550 snd_opl4_write(opl4, OPL4_REG_MISC + voice[i]->number,
551 voice[i]->reg_misc);
556 static void snd_opl4_voice_off(struct snd_opl4 *opl4, struct opl4_voice *voice)
558 list_del(&voice->list);
559 list_add_tail(&voice->list, &opl4->off_voices);
561 voice->reg_misc &= ~OPL4_KEY_ON_BIT;
562 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
572 static void snd_opl4_terminate_voice(struct snd_opl4 *opl4, struct opl4_voice *voice)
574 list_del(&voice->list);
575 list_add_tail(&voice->list, &opl4->off_voices);
577 voice->reg_misc = (voice->reg_misc & ~OPL4_KEY_ON_BIT) | OPL4_DAMP_BIT;
578 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
617 * Each OPL4 voice has a bit called "Pseudo-Reverb", but