Lines Matching full:vp
18 static int start_voice(struct snd_emux_voice *vp);
19 static void trigger_voice(struct snd_emux_voice *vp);
20 static void release_voice(struct snd_emux_voice *vp);
21 static void update_voice(struct snd_emux_voice *vp, int update);
23 static void terminate_voice(struct snd_emux_voice *vp);
32 static void set_pitch(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
33 static void set_volume(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
34 static void set_pan(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
35 static void set_fmmod(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
36 static void set_tremfreq(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
37 static void set_fm2frq2(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
38 static void set_filterQ(struct snd_emu8000 *hw, struct snd_emux_voice *vp);
83 release_voice(struct snd_emux_voice *vp) in release_voice() argument
88 hw = vp->hw; in release_voice()
89 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease; in release_voice()
90 EMU8000_DCYSUS_WRITE(hw, vp->ch, dcysusv); in release_voice()
91 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.volrelease; in release_voice()
92 EMU8000_DCYSUSV_WRITE(hw, vp->ch, dcysusv); in release_voice()
99 terminate_voice(struct snd_emux_voice *vp) in terminate_voice() argument
103 hw = vp->hw; in terminate_voice()
104 EMU8000_DCYSUSV_WRITE(hw, vp->ch, 0x807F); in terminate_voice()
111 update_voice(struct snd_emux_voice *vp, int update) in update_voice() argument
115 hw = vp->hw; in update_voice()
117 set_volume(hw, vp); in update_voice()
119 set_pitch(hw, vp); in update_voice()
121 vp->port->ctrls[EMUX_MD_REALTIME_PAN]) in update_voice()
122 set_pan(hw, vp); in update_voice()
124 set_fmmod(hw, vp); in update_voice()
126 set_tremfreq(hw, vp); in update_voice()
128 set_fm2frq2(hw, vp); in update_voice()
130 set_filterQ(hw, vp); in update_voice()
140 * The channel index (vp->ch) must be initialized in this routine.
147 struct snd_emux_voice *vp; in get_voice() local
175 vp = &emu->voices[i]; in get_voice()
176 state = vp->state; in get_voice()
183 val = (EMU8000_CVCF_READ(hw, vp->ch) >> 16) & 0xffff; in get_voice()
194 (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) { in get_voice()
195 val = EMU8000_CCCA_READ(hw, vp->ch) & 0xffffff; in get_voice()
196 if (val >= vp->reg.loopstart) in get_voice()
200 if (vp->time < bp->time) { in get_voice()
201 bp->time = vp->time; in get_voice()
208 vp = &emu->voices[best[i].voice]; in get_voice()
209 vp->ch = best[i].voice; in get_voice()
210 return vp; in get_voice()
221 start_voice(struct snd_emux_voice *vp) in start_voice() argument
229 hw = vp->hw; in start_voice()
230 ch = vp->ch; in start_voice()
231 chan = vp->chan; in start_voice()
241 set_pitch(hw, vp); in start_voice()
244 EMU8000_ENVVAL_WRITE(hw, ch, vp->reg.parm.moddelay); in start_voice()
245 EMU8000_ATKHLD_WRITE(hw, ch, vp->reg.parm.modatkhld); in start_voice()
246 EMU8000_DCYSUS_WRITE(hw, ch, vp->reg.parm.moddcysus); in start_voice()
247 EMU8000_ENVVOL_WRITE(hw, ch, vp->reg.parm.voldelay); in start_voice()
248 EMU8000_ATKHLDV_WRITE(hw, ch, vp->reg.parm.volatkhld); in start_voice()
253 set_volume(hw, vp); in start_voice()
256 EMU8000_PEFE_WRITE(hw, ch, vp->reg.parm.pefe); in start_voice()
259 EMU8000_LFO1VAL_WRITE(hw, ch, vp->reg.parm.lfo1delay); in start_voice()
260 EMU8000_LFO2VAL_WRITE(hw, ch, vp->reg.parm.lfo2delay); in start_voice()
263 set_fmmod(hw, vp); in start_voice()
265 set_tremfreq(hw, vp); in start_voice()
267 set_fm2frq2(hw, vp); in start_voice()
269 set_pan(hw, vp); in start_voice()
272 addr = vp->reg.loopend - 1; in start_voice()
273 temp = vp->reg.parm.chorus; in start_voice()
280 addr = vp->reg.start - 1; in start_voice()
281 temp = vp->reg.parm.filterQ; in start_voice()
290 temp = vp->vtarget << 16; in start_voice()
291 EMU8000_VTFT_WRITE(hw, ch, temp | vp->ftarget); in start_voice()
301 trigger_voice(struct snd_emux_voice *vp) in trigger_voice() argument
303 int ch = vp->ch; in trigger_voice()
307 hw = vp->hw; in trigger_voice()
310 temp = vp->reg.parm.reverb; in trigger_voice()
311 temp += (int)vp->chan->control[MIDI_CTL_E1_REVERB_DEPTH] * 9 / 10; in trigger_voice()
313 temp = (temp << 8) | (vp->ptarget << 16) | vp->aaux; in trigger_voice()
315 EMU8000_CPF_WRITE(hw, ch, vp->ptarget << 16); in trigger_voice()
316 EMU8000_DCYSUSV_WRITE(hw, ch, vp->reg.parm.voldcysus); in trigger_voice()
336 set_pitch(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_pitch() argument
338 EMU8000_IP_WRITE(hw, vp->ch, vp->apitch); in set_pitch()
345 set_volume(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_volume() argument
349 ifatn = (unsigned char)vp->acutoff; in set_volume()
351 ifatn |= (unsigned char)vp->avol; in set_volume()
352 EMU8000_IFATN_WRITE(hw, vp->ch, ifatn); in set_volume()
359 set_pan(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_pan() argument
363 temp = ((unsigned int)vp->apan<<24) | ((unsigned int)vp->reg.loopstart - 1); in set_pan()
364 EMU8000_PSST_WRITE(hw, vp->ch, temp); in set_pan()
370 set_fmmod(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_fmmod() argument
377 pitch = (char)(vp->reg.parm.fmmod>>8); in set_fmmod()
378 cutoff = (vp->reg.parm.fmmod & 0xff); in set_fmmod()
379 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fmmod()
383 EMU8000_FMMOD_WRITE(hw, vp->ch, fmmod); in set_fmmod()
388 set_tremfreq(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_tremfreq() argument
390 EMU8000_TREMFRQ_WRITE(hw, vp->ch, vp->reg.parm.tremfrq); in set_tremfreq()
395 set_fm2frq2(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_fm2frq2() argument
402 pitch = (char)(vp->reg.parm.fm2frq2>>8); in set_fm2frq2()
403 freq = vp->reg.parm.fm2frq2 & 0xff; in set_fm2frq2()
404 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fm2frq2()
408 EMU8000_FM2FRQ2_WRITE(hw, vp->ch, fm2frq2); in set_fm2frq2()
413 set_filterQ(struct snd_emu8000 *hw, struct snd_emux_voice *vp) in set_filterQ() argument
416 addr = EMU8000_CCCA_READ(hw, vp->ch) & 0xffffff; in set_filterQ()
417 addr |= (vp->reg.parm.filterQ << 28); in set_filterQ()
418 EMU8000_CCCA_WRITE(hw, vp->ch, addr); in set_filterQ()