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 void set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
37 static void set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
38 static void set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
82 struct snd_emux_voice *vp; in snd_emu10k1_synth_get_voice() local
92 vp = &emu->voices[best[i].voice]; in snd_emu10k1_synth_get_voice()
93 if ((ch = vp->ch) < 0) { in snd_emu10k1_synth_get_voice()
100 vp->emu->num_voices--; in snd_emu10k1_synth_get_voice()
101 vp->ch = -1; in snd_emu10k1_synth_get_voice()
102 vp->state = SNDRV_EMUX_ST_OFF; in snd_emu10k1_synth_get_voice()
116 release_voice(struct snd_emux_voice *vp) in release_voice() argument
121 hw = vp->hw; in release_voice()
122 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease; in release_voice()
123 snd_emu10k1_ptr_write(hw, DCYSUSM, vp->ch, dcysusv); in release_voice()
124 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.volrelease | DCYSUSV_CHANNELENABLE_MASK; in release_voice()
125 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, dcysusv); in release_voice()
133 terminate_voice(struct snd_emux_voice *vp) in terminate_voice() argument
137 if (snd_BUG_ON(!vp)) in terminate_voice()
139 hw = vp->hw; in terminate_voice()
140 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); in terminate_voice()
141 if (vp->block) { in terminate_voice()
143 emem = (struct snd_emu10k1_memblk *)vp->block; in terminate_voice()
153 free_voice(struct snd_emux_voice *vp) in free_voice() argument
157 hw = vp->hw; in free_voice()
162 if (hw && (vp->ch >= 0)) { in free_voice()
163 snd_emu10k1_ptr_write(hw, IFATN, vp->ch, 0xff00); in free_voice()
164 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); in free_voice()
166 snd_emu10k1_ptr_write(hw, VTFT, vp->ch, 0xffff); in free_voice()
167 snd_emu10k1_ptr_write(hw, CVCF, vp->ch, 0xffff); in free_voice()
168 snd_emu10k1_voice_free(hw, &hw->voices[vp->ch]); in free_voice()
169 vp->emu->num_voices--; in free_voice()
170 vp->ch = -1; in free_voice()
179 update_voice(struct snd_emux_voice *vp, int update) in update_voice() argument
183 hw = vp->hw; in update_voice()
185 snd_emu10k1_ptr_write(hw, IFATN_ATTENUATION, vp->ch, vp->avol); in update_voice()
187 snd_emu10k1_ptr_write(hw, IP, vp->ch, vp->apitch); in update_voice()
189 snd_emu10k1_ptr_write(hw, PTRX_FXSENDAMOUNT_A, vp->ch, vp->apan); in update_voice()
190 snd_emu10k1_ptr_write(hw, PTRX_FXSENDAMOUNT_B, vp->ch, vp->aaux); in update_voice()
193 set_fmmod(hw, vp); in update_voice()
195 snd_emu10k1_ptr_write(hw, TREMFRQ, vp->ch, vp->reg.parm.tremfrq); in update_voice()
197 set_fm2frq2(hw, vp); in update_voice()
199 set_filterQ(hw, vp); in update_voice()
211 struct snd_emux_voice *vp; in lookup_voices() local
227 vp = &emu->voices[i]; in lookup_voices()
228 state = vp->state; in lookup_voices()
230 if (vp->ch < 0) { in lookup_voices()
241 val = snd_emu10k1_ptr_read(hw, CVCF_CURRENTVOL, vp->ch); in lookup_voices()
255 (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) { in lookup_voices()
256 val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch); in lookup_voices()
257 if (val >= vp->reg.loopstart) in lookup_voices()
261 if (vp->time < bp->time) { in lookup_voices()
262 bp->time = vp->time; in lookup_voices()
277 struct snd_emux_voice *vp; in get_voice() local
286 vp = &emu->voices[best[i].voice]; in get_voice()
287 if (vp->ch < 0) { in get_voice()
292 vp->ch = hwvoice->number; in get_voice()
295 return vp; in get_voice()
307 start_voice(struct snd_emux_voice *vp) in start_voice() argument
316 hw = vp->hw; in start_voice()
317 ch = vp->ch; in start_voice()
320 chan = vp->chan; in start_voice()
322 emem = (struct snd_emu10k1_memblk *)vp->block; in start_voice()
331 vp->reg.start += mapped_offset; in start_voice()
332 vp->reg.end += mapped_offset; in start_voice()
333 vp->reg.loopstart += mapped_offset; in start_voice()
334 vp->reg.loopend += mapped_offset; in start_voice()
356 snd_emu10k1_ptr_write(hw, IP, vp->ch, vp->apitch); in start_voice()
359 snd_emu10k1_ptr_write(hw, ENVVAL, ch, vp->reg.parm.moddelay); in start_voice()
360 snd_emu10k1_ptr_write(hw, ATKHLDM, ch, vp->reg.parm.modatkhld); in start_voice()
361 snd_emu10k1_ptr_write(hw, DCYSUSM, ch, vp->reg.parm.moddcysus); in start_voice()
362 snd_emu10k1_ptr_write(hw, ENVVOL, ch, vp->reg.parm.voldelay); in start_voice()
363 snd_emu10k1_ptr_write(hw, ATKHLDV, ch, vp->reg.parm.volatkhld); in start_voice()
368 temp = (unsigned int)vp->acutoff << 8 | (unsigned char)vp->avol; in start_voice()
369 snd_emu10k1_ptr_write(hw, IFATN, vp->ch, temp); in start_voice()
372 snd_emu10k1_ptr_write(hw, PEFE, ch, vp->reg.parm.pefe); in start_voice()
375 snd_emu10k1_ptr_write(hw, LFOVAL1, ch, vp->reg.parm.lfo1delay); in start_voice()
376 snd_emu10k1_ptr_write(hw, LFOVAL2, ch, vp->reg.parm.lfo2delay); in start_voice()
379 set_fmmod(hw, vp); in start_voice()
381 snd_emu10k1_ptr_write(hw, TREMFRQ, vp->ch, vp->reg.parm.tremfrq); in start_voice()
383 set_fm2frq2(hw, vp); in start_voice()
386 temp = vp->reg.parm.reverb; in start_voice()
387 temp += (int)vp->chan->control[MIDI_CTL_E1_REVERB_DEPTH] * 9 / 10; in start_voice()
389 addr = vp->reg.loopstart; in start_voice()
390 snd_emu10k1_ptr_write(hw, PSST, vp->ch, (temp << 24) | addr); in start_voice()
393 addr = vp->reg.loopend; in start_voice()
394 temp = vp->reg.parm.chorus; in start_voice()
413 if (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS) in start_voice()
439 addr = vp->reg.start; in start_voice()
440 temp = vp->reg.parm.filterQ; in start_voice()
442 if (vp->apitch < 0xe400) in start_voice()
445 unsigned int shift = (vp->apitch - 0xe000) >> 10; in start_voice()
448 if (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS) in start_voice()
453 temp = (unsigned int)vp->vtarget << 16; in start_voice()
454 snd_emu10k1_ptr_write(hw, VTFT, ch, temp | vp->ftarget); in start_voice()
463 trigger_voice(struct snd_emux_voice *vp) in trigger_voice() argument
469 hw = vp->hw; in trigger_voice()
471 emem = (struct snd_emu10k1_memblk *)vp->block; in trigger_voice()
476 ptarget = (unsigned int)vp->ptarget << 16; in trigger_voice()
478 ptarget = IP_TO_CP(vp->apitch); in trigger_voice()
481 temp = ptarget | (vp->apan << 8) | vp->aaux; in trigger_voice()
482 snd_emu10k1_ptr_write(hw, PTRX, vp->ch, temp); in trigger_voice()
485 snd_emu10k1_ptr_write(hw, CPF, vp->ch, ptarget); in trigger_voice()
488 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, vp->reg.parm.voldcysus|DCYSUSV_CHANNELENABLE_MASK); in trigger_voice()
495 set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) in set_fmmod() argument
502 pitch = (char)(vp->reg.parm.fmmod>>8); in set_fmmod()
503 cutoff = (vp->reg.parm.fmmod & 0xff); in set_fmmod()
504 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fmmod()
508 snd_emu10k1_ptr_write(hw, FMMOD, vp->ch, fmmod); in set_fmmod()
513 set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) in set_fm2frq2() argument
520 pitch = (char)(vp->reg.parm.fm2frq2>>8); in set_fm2frq2()
521 freq = vp->reg.parm.fm2frq2 & 0xff; in set_fm2frq2()
522 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fm2frq2()
526 snd_emu10k1_ptr_write(hw, FM2FRQ2, vp->ch, fm2frq2); in set_fm2frq2()
531 set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp) in set_filterQ() argument
534 val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE; in set_filterQ()
535 val |= (vp->reg.parm.filterQ << 28); in set_filterQ()
536 snd_emu10k1_ptr_write(hw, CCCA, vp->ch, val); in set_filterQ()