Lines Matching full: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) - 64 + 3; 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
320 hw = vp->hw; in start_voice()
321 ch = vp->ch; in start_voice()
324 chan = vp->chan; in start_voice()
325 w_16 = !(vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS); in start_voice()
327 emem = (struct snd_emu10k1_memblk *)vp->block; in start_voice()
336 vp->reg.start += mapped_offset; in start_voice()
337 vp->reg.end += mapped_offset; in start_voice()
338 vp->reg.loopstart += mapped_offset; in start_voice()
339 vp->reg.loopend += mapped_offset; in start_voice()
353 temp = vp->reg.parm.reverb; in start_voice()
354 temp += (int)vp->chan->control[MIDI_CTL_E1_REVERB_DEPTH] * 9 / 10; in start_voice()
356 addr = vp->reg.loopstart; in start_voice()
359 addr = vp->reg.loopend; in start_voice()
360 temp = vp->reg.parm.chorus; in start_voice()
367 addr = vp->reg.start + 64 - 3; in start_voice()
368 temp = vp->reg.parm.filterQ; in start_voice()
370 if (vp->apitch < 0xe400) in start_voice()
373 unsigned int shift = (vp->apitch - 0xe000) >> 10; in start_voice()
379 vtarget = (unsigned int)vp->vtarget << 16; in start_voice()
390 IP, vp->apitch, in start_voice()
393 ENVVAL, vp->reg.parm.moddelay, in start_voice()
394 ATKHLDM, vp->reg.parm.modatkhld, in start_voice()
395 DCYSUSM, vp->reg.parm.moddcysus, in start_voice()
396 ENVVOL, vp->reg.parm.voldelay, in start_voice()
397 ATKHLDV, vp->reg.parm.volatkhld, in start_voice()
402 IFATN, (unsigned int)vp->acutoff << 8 | (unsigned char)vp->avol, in start_voice()
405 PEFE, vp->reg.parm.pefe, in start_voice()
408 LFOVAL1, vp->reg.parm.lfo1delay, in start_voice()
409 LFOVAL2, vp->reg.parm.lfo2delay, in start_voice()
412 FMMOD, make_fmmod(vp), in start_voice()
414 TREMFRQ, vp->reg.parm.tremfrq, in start_voice()
416 FM2FRQ2, make_fm2frq2(vp), in start_voice()
439 VTFT, vtarget | vp->ftarget, in start_voice()
452 trigger_voice(struct snd_emux_voice *vp) in trigger_voice() argument
458 hw = vp->hw; in trigger_voice()
460 emem = (struct snd_emu10k1_memblk *)vp->block; in trigger_voice()
465 ptarget = (unsigned int)vp->ptarget << 16; in trigger_voice()
467 ptarget = IP_TO_CP(vp->apitch); in trigger_voice()
469 snd_emu10k1_ptr_write_multiple(hw, vp->ch, in trigger_voice()
471 PTRX, ptarget | (vp->apan << 8) | vp->aaux, in trigger_voice()
477 DCYSUSV, vp->reg.parm.voldcysus | DCYSUSV_CHANNELENABLE_MASK, in trigger_voice()
486 make_fmmod(struct snd_emux_voice *vp) in make_fmmod() argument
492 pitch = (char)(vp->reg.parm.fmmod>>8); in make_fmmod()
493 cutoff = (vp->reg.parm.fmmod & 0xff); in make_fmmod()
494 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in make_fmmod()
502 make_fm2frq2(struct snd_emux_voice *vp) in make_fm2frq2() argument
508 pitch = (char)(vp->reg.parm.fm2frq2>>8); in make_fm2frq2()
509 freq = vp->reg.parm.fm2frq2 & 0xff; in make_fm2frq2()
510 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in make_fm2frq2()