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