Lines Matching refs:vp
31 static int start_voice(struct snd_emux_voice *vp);
32 static void trigger_voice(struct snd_emux_voice *vp);
33 static void release_voice(struct snd_emux_voice *vp);
34 static void update_voice(struct snd_emux_voice *vp, int update);
36 static void terminate_voice(struct snd_emux_voice *vp);
45 static void set_pitch(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
46 static void set_volume(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
47 static void set_pan(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
48 static void set_fmmod(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
49 static void set_tremfreq(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
50 static void set_fm2frq2(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
51 static void set_filterQ(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
96 release_voice(struct snd_emux_voice *vp) in release_voice() argument
101 hw = vp->hw; in release_voice()
102 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease; in release_voice()
103 EMU8000_DCYSUS_WRITE(hw, vp->ch, dcysusv); in release_voice()
104 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.volrelease; in release_voice()
105 EMU8000_DCYSUSV_WRITE(hw, vp->ch, dcysusv); in release_voice()
112 terminate_voice(struct snd_emux_voice *vp) in terminate_voice() argument
116 hw = vp->hw; in terminate_voice()
117 EMU8000_DCYSUSV_WRITE(hw, vp->ch, 0x807F); in terminate_voice()
124 update_voice(struct snd_emux_voice *vp, int update) in update_voice() argument
128 hw = vp->hw; in update_voice()
130 set_volume(hw, vp); in update_voice()
132 set_pitch(hw, vp); in update_voice()
134 vp->port->ctrls[EMUX_MD_REALTIME_PAN]) in update_voice()
135 set_pan(hw, vp); in update_voice()
137 set_fmmod(hw, vp); in update_voice()
139 set_tremfreq(hw, vp); in update_voice()
141 set_fm2frq2(hw, vp); in update_voice()
143 set_filterQ(hw, vp); in update_voice()
160 struct snd_emux_voice *vp; in get_voice() local
188 vp = &emu->voices[i]; in get_voice()
189 state = vp->state; in get_voice()
196 val = (EMU8000_CVCF_READ(hw, vp->ch) >> 16) & 0xffff; in get_voice()
207 (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) { in get_voice()
208 val = EMU8000_CCCA_READ(hw, vp->ch) & 0xffffff; in get_voice()
209 if (val >= vp->reg.loopstart) in get_voice()
213 if (vp->time < bp->time) { in get_voice()
214 bp->time = vp->time; in get_voice()
221 vp = &emu->voices[best[i].voice]; in get_voice()
222 vp->ch = best[i].voice; in get_voice()
223 return vp; in get_voice()
234 start_voice(struct snd_emux_voice *vp) in start_voice() argument
242 hw = vp->hw; in start_voice()
243 ch = vp->ch; in start_voice()
244 chan = vp->chan; in start_voice()
254 set_pitch(hw, vp); in start_voice()
257 EMU8000_ENVVAL_WRITE(hw, ch, vp->reg.parm.moddelay); in start_voice()
258 EMU8000_ATKHLD_WRITE(hw, ch, vp->reg.parm.modatkhld); in start_voice()
259 EMU8000_DCYSUS_WRITE(hw, ch, vp->reg.parm.moddcysus); in start_voice()
260 EMU8000_ENVVOL_WRITE(hw, ch, vp->reg.parm.voldelay); in start_voice()
261 EMU8000_ATKHLDV_WRITE(hw, ch, vp->reg.parm.volatkhld); in start_voice()
266 set_volume(hw, vp); in start_voice()
269 EMU8000_PEFE_WRITE(hw, ch, vp->reg.parm.pefe); in start_voice()
272 EMU8000_LFO1VAL_WRITE(hw, ch, vp->reg.parm.lfo1delay); in start_voice()
273 EMU8000_LFO2VAL_WRITE(hw, ch, vp->reg.parm.lfo2delay); in start_voice()
276 set_fmmod(hw, vp); in start_voice()
278 set_tremfreq(hw, vp); in start_voice()
280 set_fm2frq2(hw, vp); in start_voice()
282 set_pan(hw, vp); in start_voice()
285 addr = vp->reg.loopend - 1; in start_voice()
286 temp = vp->reg.parm.chorus; in start_voice()
293 addr = vp->reg.start - 1; in start_voice()
294 temp = vp->reg.parm.filterQ; in start_voice()
303 temp = vp->vtarget << 16; in start_voice()
304 EMU8000_VTFT_WRITE(hw, ch, temp | vp->ftarget); in start_voice()
314 trigger_voice(struct snd_emux_voice *vp) in trigger_voice() argument
316 int ch = vp->ch; in trigger_voice()
320 hw = vp->hw; in trigger_voice()
323 temp = vp->reg.parm.reverb; in trigger_voice()
324 temp += (int)vp->chan->control[MIDI_CTL_E1_REVERB_DEPTH] * 9 / 10; in trigger_voice()
326 temp = (temp << 8) | (vp->ptarget << 16) | vp->aaux; in trigger_voice()
328 EMU8000_CPF_WRITE(hw, ch, vp->ptarget << 16); in trigger_voice()
329 EMU8000_DCYSUSV_WRITE(hw, ch, vp->reg.parm.voldcysus); in trigger_voice()
349 set_pitch(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_pitch() argument
351 EMU8000_IP_WRITE(hw, vp->ch, vp->apitch); in set_pitch()
358 set_volume(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_volume() argument
362 ifatn = (unsigned char)vp->acutoff; in set_volume()
364 ifatn |= (unsigned char)vp->avol; in set_volume()
365 EMU8000_IFATN_WRITE(hw, vp->ch, ifatn); in set_volume()
372 set_pan(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_pan() argument
376 temp = ((unsigned int)vp->apan<<24) | ((unsigned int)vp->reg.loopstart - 1); in set_pan()
377 EMU8000_PSST_WRITE(hw, vp->ch, temp); in set_pan()
383 set_fmmod(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_fmmod() argument
390 pitch = (char)(vp->reg.parm.fmmod>>8); in set_fmmod()
391 cutoff = (vp->reg.parm.fmmod & 0xff); in set_fmmod()
392 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fmmod()
396 EMU8000_FMMOD_WRITE(hw, vp->ch, fmmod); in set_fmmod()
401 set_tremfreq(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_tremfreq() argument
403 EMU8000_TREMFRQ_WRITE(hw, vp->ch, vp->reg.parm.tremfrq); in set_tremfreq()
408 set_fm2frq2(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_fm2frq2() argument
415 pitch = (char)(vp->reg.parm.fm2frq2>>8); in set_fm2frq2()
416 freq = vp->reg.parm.fm2frq2 & 0xff; in set_fm2frq2()
417 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fm2frq2()
421 EMU8000_FM2FRQ2_WRITE(hw, vp->ch, fm2frq2); in set_fm2frq2()
426 set_filterQ(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_filterQ() argument
429 addr = EMU8000_CCCA_READ(hw, vp->ch) & 0xffffff; in set_filterQ()
430 addr |= (vp->reg.parm.filterQ << 28); in set_filterQ()
431 EMU8000_CCCA_WRITE(hw, vp->ch, addr); in set_filterQ()