Lines Matching refs:vp

30 static int start_voice(struct snd_emux_voice *vp);
31 static void trigger_voice(struct snd_emux_voice *vp);
32 static void release_voice(struct snd_emux_voice *vp);
33 static void update_voice(struct snd_emux_voice *vp, int update);
34 static void terminate_voice(struct snd_emux_voice *vp);
35 static void free_voice(struct snd_emux_voice *vp);
36 static u32 make_fmmod(struct snd_emux_voice *vp);
37 static u32 make_fm2frq2(struct snd_emux_voice *vp);
83 struct snd_emux_voice *vp; in snd_emu10k1_synth_get_voice() local
93 vp = &emu->voices[best[i].voice]; in snd_emu10k1_synth_get_voice()
94 ch = vp->ch; in snd_emu10k1_synth_get_voice()
102 vp->emu->num_voices--; in snd_emu10k1_synth_get_voice()
103 vp->ch = -1; in snd_emu10k1_synth_get_voice()
104 vp->state = SNDRV_EMUX_ST_OFF; in snd_emu10k1_synth_get_voice()
118 release_voice(struct snd_emux_voice *vp) in release_voice() argument
122 hw = vp->hw; in release_voice()
123 snd_emu10k1_ptr_write_multiple(hw, vp->ch, in release_voice()
124 DCYSUSM, (unsigned char)vp->reg.parm.modrelease | DCYSUSM_PHASE1_MASK, in release_voice()
125 …DCYSUSV, (unsigned char)vp->reg.parm.volrelease | DCYSUSV_PHASE1_MASK | DCYSUSV_CHANNELENABLE_MASK, in release_voice()
134 terminate_voice(struct snd_emux_voice *vp) in terminate_voice() argument
138 if (snd_BUG_ON(!vp)) in terminate_voice()
140 hw = vp->hw; in terminate_voice()
141 snd_emu10k1_ptr_write_multiple(hw, vp->ch, in terminate_voice()
148 if (vp->block) { in terminate_voice()
150 emem = (struct snd_emu10k1_memblk *)vp->block; in terminate_voice()
160 free_voice(struct snd_emux_voice *vp) in free_voice() argument
164 hw = vp->hw; in free_voice()
169 if (hw && (vp->ch >= 0)) { in free_voice()
170 snd_emu10k1_voice_free(hw, &hw->voices[vp->ch]); in free_voice()
171 vp->emu->num_voices--; in free_voice()
172 vp->ch = -1; in free_voice()
181 update_voice(struct snd_emux_voice *vp, int update) in update_voice() argument
185 hw = vp->hw; in update_voice()
187 snd_emu10k1_ptr_write(hw, IFATN_ATTENUATION, vp->ch, vp->avol); in update_voice()
189 snd_emu10k1_ptr_write(hw, IP, vp->ch, vp->apitch); in update_voice()
191 snd_emu10k1_ptr_write(hw, PTRX_FXSENDAMOUNT_A, vp->ch, vp->apan); in update_voice()
192 snd_emu10k1_ptr_write(hw, PTRX_FXSENDAMOUNT_B, vp->ch, vp->aaux); in update_voice()
195 snd_emu10k1_ptr_write(hw, FMMOD, vp->ch, make_fmmod(vp)); in update_voice()
197 snd_emu10k1_ptr_write(hw, TREMFRQ, vp->ch, vp->reg.parm.tremfrq); in update_voice()
199 snd_emu10k1_ptr_write(hw, FM2FRQ2, vp->ch, make_fm2frq2(vp)); in update_voice()
201 snd_emu10k1_ptr_write(hw, CCCA_RESONANCE, vp->ch, vp->reg.parm.filterQ); in update_voice()
213 struct snd_emux_voice *vp; in lookup_voices() local
229 vp = &emu->voices[i]; in lookup_voices()
230 state = vp->state; in lookup_voices()
232 if (vp->ch < 0) { in lookup_voices()
243 val = snd_emu10k1_ptr_read(hw, CVCF_CURRENTVOL, vp->ch); in lookup_voices()
257 (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) { in lookup_voices()
258 val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch); in lookup_voices()
259 if (val >= vp->reg.loopstart) in lookup_voices()
263 if (vp->time < bp->time) { in lookup_voices()
264 bp->time = vp->time; in lookup_voices()
279 struct snd_emux_voice *vp; in get_voice() local
288 vp = &emu->voices[best[i].voice]; in get_voice()
289 if (vp->ch < 0) { in get_voice()
294 vp->ch = hwvoice->number; in get_voice()
297 return vp; in get_voice()
309 start_voice(struct snd_emux_voice *vp) in start_voice() argument
319 hw = vp->hw; in start_voice()
320 ch = vp->ch; in start_voice()
323 chan = vp->chan; in start_voice()
325 emem = (struct snd_emu10k1_memblk *)vp->block; in start_voice()
334 vp->reg.start += mapped_offset; in start_voice()
335 vp->reg.end += mapped_offset; in start_voice()
336 vp->reg.loopstart += mapped_offset; in start_voice()
337 vp->reg.loopend += mapped_offset; in start_voice()
351 temp = vp->reg.parm.reverb; in start_voice()
352 temp += (int)vp->chan->control[MIDI_CTL_E1_REVERB_DEPTH] * 9 / 10; in start_voice()
354 addr = vp->reg.loopstart; in start_voice()
357 addr = vp->reg.loopend; in start_voice()
358 temp = vp->reg.parm.chorus; in start_voice()
365 addr = vp->reg.start; in start_voice()
366 temp = vp->reg.parm.filterQ; in start_voice()
368 if (vp->apitch < 0xe400) in start_voice()
371 unsigned int shift = (vp->apitch - 0xe000) >> 10; in start_voice()
374 if (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS) in start_voice()
377 vtarget = (unsigned int)vp->vtarget << 16; in start_voice()
388 IP, vp->apitch, in start_voice()
391 ENVVAL, vp->reg.parm.moddelay, in start_voice()
392 ATKHLDM, vp->reg.parm.modatkhld, in start_voice()
393 DCYSUSM, vp->reg.parm.moddcysus, in start_voice()
394 ENVVOL, vp->reg.parm.voldelay, in start_voice()
395 ATKHLDV, vp->reg.parm.volatkhld, in start_voice()
400 IFATN, (unsigned int)vp->acutoff << 8 | (unsigned char)vp->avol, in start_voice()
403 PEFE, vp->reg.parm.pefe, in start_voice()
406 LFOVAL1, vp->reg.parm.lfo1delay, in start_voice()
407 LFOVAL2, vp->reg.parm.lfo2delay, in start_voice()
410 FMMOD, make_fmmod(vp), in start_voice()
412 TREMFRQ, vp->reg.parm.tremfrq, in start_voice()
414 FM2FRQ2, make_fm2frq2(vp), in start_voice()
434 VTFT, vtarget | vp->ftarget, in start_voice()
447 trigger_voice(struct snd_emux_voice *vp) in trigger_voice() argument
453 hw = vp->hw; in trigger_voice()
455 emem = (struct snd_emu10k1_memblk *)vp->block; in trigger_voice()
460 ptarget = (unsigned int)vp->ptarget << 16; in trigger_voice()
462 ptarget = IP_TO_CP(vp->apitch); in trigger_voice()
464 snd_emu10k1_ptr_write_multiple(hw, vp->ch, in trigger_voice()
466 PTRX, ptarget | (vp->apan << 8) | vp->aaux, in trigger_voice()
472 DCYSUSV, vp->reg.parm.voldcysus | DCYSUSV_CHANNELENABLE_MASK, in trigger_voice()
481 make_fmmod(struct snd_emux_voice *vp) in make_fmmod() argument
487 pitch = (char)(vp->reg.parm.fmmod>>8); in make_fmmod()
488 cutoff = (vp->reg.parm.fmmod & 0xff); in make_fmmod()
489 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in make_fmmod()
497 make_fm2frq2(struct snd_emux_voice *vp) in make_fm2frq2() argument
503 pitch = (char)(vp->reg.parm.fm2frq2>>8); in make_fm2frq2()
504 freq = vp->reg.parm.fm2frq2 & 0xff; in make_fm2frq2()
505 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in make_fm2frq2()