• Home
  • Raw
  • Download

Lines Matching refs:chan

34 		     struct snd_midi_channel *chan,
38 struct snd_midi_channel *chan,
41 struct snd_midi_channel *chan,
44 struct snd_midi_channel *chan,
50 struct snd_midi_channel *chan);
52 struct snd_midi_channel *chan);
53 static void snd_midi_reset_controllers(struct snd_midi_channel *chan);
76 struct snd_midi_channel *chan; in snd_midi_process_event() local
96 chan = chanset->channels + dest_channel; in snd_midi_process_event()
118 if (chan->note[ev->data.note.note] & SNDRV_MIDI_NOTE_ON) { in snd_midi_process_event()
120 ops->note_off(drv, ev->data.note.note, 0, chan); in snd_midi_process_event()
122 chan->note[ev->data.note.note] = SNDRV_MIDI_NOTE_ON; in snd_midi_process_event()
124 ops->note_on(drv, ev->data.note.note, ev->data.note.velocity, chan); in snd_midi_process_event()
127 if (! (chan->note[ev->data.note.note] & SNDRV_MIDI_NOTE_ON)) in snd_midi_process_event()
130 note_off(ops, drv, chan, ev->data.note.note, ev->data.note.velocity); in snd_midi_process_event()
134 ops->key_press(drv, ev->data.note.note, ev->data.note.velocity, chan); in snd_midi_process_event()
137 do_control(ops, drv, chanset, chan, in snd_midi_process_event()
141 chan->midi_program = ev->data.control.value; in snd_midi_process_event()
144 chan->midi_pitchbend = ev->data.control.value; in snd_midi_process_event()
146 ops->control(drv, MIDI_CTL_PITCHBEND, chan); in snd_midi_process_event()
149 chan->midi_pressure = ev->data.control.value; in snd_midi_process_event()
151 ops->control(drv, MIDI_CTL_CHAN_PRESSURE, chan); in snd_midi_process_event()
157 chan->control[ev->data.control.param + 32] = in snd_midi_process_event()
159 do_control(ops, drv, chanset, chan, in snd_midi_process_event()
163 do_control(ops, drv, chanset, chan, in snd_midi_process_event()
169 chan->param_type = SNDRV_MIDI_PARAM_TYPE_NONREGISTERED; in snd_midi_process_event()
170 chan->control[MIDI_CTL_MSB_DATA_ENTRY] in snd_midi_process_event()
172 chan->control[MIDI_CTL_LSB_DATA_ENTRY] in snd_midi_process_event()
174 chan->control[MIDI_CTL_NONREG_PARM_NUM_MSB] in snd_midi_process_event()
176 chan->control[MIDI_CTL_NONREG_PARM_NUM_LSB] in snd_midi_process_event()
178 nrpn(ops, drv, chan, chanset); in snd_midi_process_event()
182 chan->param_type = SNDRV_MIDI_PARAM_TYPE_REGISTERED; in snd_midi_process_event()
183 chan->control[MIDI_CTL_MSB_DATA_ENTRY] in snd_midi_process_event()
185 chan->control[MIDI_CTL_LSB_DATA_ENTRY] in snd_midi_process_event()
187 chan->control[MIDI_CTL_REGIST_PARM_NUM_MSB] in snd_midi_process_event()
189 chan->control[MIDI_CTL_REGIST_PARM_NUM_LSB] in snd_midi_process_event()
191 rpn(ops, drv, chan, chanset); in snd_midi_process_event()
236 struct snd_midi_channel *chan, in note_off() argument
239 if (chan->gm_hold) { in note_off()
241 chan->note[note] |= SNDRV_MIDI_NOTE_RELEASED; in note_off()
242 } else if (chan->note[note] & SNDRV_MIDI_NOTE_SOSTENUTO) { in note_off()
245 chan->note[note] |= SNDRV_MIDI_NOTE_RELEASED; in note_off()
247 chan->note[note] = 0; in note_off()
249 ops->note_off(drv, note, vel, chan); in note_off()
260 struct snd_midi_channel *chan, int control, int value) in do_control() argument
264 if (control >= ARRAY_SIZE(chan->control)) in do_control()
272 chan->control[control] = value; in do_control()
279 if (chan->note[i] & SNDRV_MIDI_NOTE_RELEASED) { in do_control()
280 chan->note[i] = SNDRV_MIDI_NOTE_OFF; in do_control()
282 ops->note_off(drv, i, 0, chan); in do_control()
293 if (chan->note[i] & SNDRV_MIDI_NOTE_ON) in do_control()
294 chan->note[i] |= SNDRV_MIDI_NOTE_SOSTENUTO; in do_control()
299 if (chan->note[i] & SNDRV_MIDI_NOTE_SOSTENUTO) { in do_control()
300 chan->note[i] &= ~SNDRV_MIDI_NOTE_SOSTENUTO; in do_control()
301 if (chan->note[i] & SNDRV_MIDI_NOTE_RELEASED) { in do_control()
302 chan->note[i] = SNDRV_MIDI_NOTE_OFF; in do_control()
304 ops->note_off(drv, i, 0, chan); in do_control()
311 chan->control[MIDI_CTL_LSB_DATA_ENTRY] = 0; in do_control()
314 if (chan->param_type == SNDRV_MIDI_PARAM_TYPE_REGISTERED) in do_control()
315 rpn(ops, drv, chan, chset); in do_control()
317 nrpn(ops, drv, chan, chset); in do_control()
321 chan->param_type = SNDRV_MIDI_PARAM_TYPE_REGISTERED; in do_control()
325 chan->param_type = SNDRV_MIDI_PARAM_TYPE_NONREGISTERED; in do_control()
329 all_sounds_off(ops, drv, chan); in do_control()
333 all_notes_off(ops, drv, chan); in do_control()
339 chan->drum_channel = 1; in do_control()
341 chan->drum_channel = 0; in do_control()
348 snd_midi_reset_controllers(chan); in do_control()
368 ops->control(drv, control, chan); in do_control()
386 struct snd_midi_channel *chan = chset->channels + i; in snd_midi_channel_set_clear() local
387 memset(chan->note, 0, sizeof(chan->note)); in snd_midi_channel_set_clear()
389 chan->midi_aftertouch = 0; in snd_midi_channel_set_clear()
390 chan->midi_pressure = 0; in snd_midi_channel_set_clear()
391 chan->midi_program = 0; in snd_midi_channel_set_clear()
392 chan->midi_pitchbend = 0; in snd_midi_channel_set_clear()
393 snd_midi_reset_controllers(chan); in snd_midi_channel_set_clear()
394 chan->gm_rpn_pitch_bend_range = 256; /* 2 semitones */ in snd_midi_channel_set_clear()
395 chan->gm_rpn_fine_tuning = 0; in snd_midi_channel_set_clear()
396 chan->gm_rpn_coarse_tuning = 0; in snd_midi_channel_set_clear()
399 chan->drum_channel = 1; in snd_midi_channel_set_clear()
401 chan->drum_channel = 0; in snd_midi_channel_set_clear()
410 rpn(const struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, in rpn() argument
417 type = (chan->control[MIDI_CTL_REGIST_PARM_NUM_MSB] << 8) | in rpn()
418 chan->control[MIDI_CTL_REGIST_PARM_NUM_LSB]; in rpn()
419 val = (chan->control[MIDI_CTL_MSB_DATA_ENTRY] << 7) | in rpn()
420 chan->control[MIDI_CTL_LSB_DATA_ENTRY]; in rpn()
425 chan->gm_rpn_pitch_bend_range = val; in rpn()
430 chan->gm_rpn_fine_tuning = val - 8192; in rpn()
435 chan->gm_rpn_coarse_tuning = val - 8192; in rpn()
450 nrpn(const struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, in nrpn() argument
455 ops->nrpn(drv, chan, chset); in nrpn()
593 struct snd_midi_channel *chan) in all_sounds_off() argument
600 if (chan->note[n]) { in all_sounds_off()
601 ops->note_terminate(drv, n, chan); in all_sounds_off()
602 chan->note[n] = 0; in all_sounds_off()
612 struct snd_midi_channel *chan) in all_notes_off() argument
619 if (chan->note[n] == SNDRV_MIDI_NOTE_ON) in all_notes_off()
620 note_off(ops, drv, chan, n, 0); in all_notes_off()
650 struct snd_midi_channel *chan; in snd_midi_channel_init_set() local
653 chan = kmalloc_array(n, sizeof(struct snd_midi_channel), GFP_KERNEL); in snd_midi_channel_init_set()
654 if (chan) { in snd_midi_channel_init_set()
656 snd_midi_channel_init(chan+i, i); in snd_midi_channel_init_set()
659 return chan; in snd_midi_channel_init_set()
670 struct snd_midi_channel *chan = chset->channels + ch; in reset_all_channels() local
671 snd_midi_reset_controllers(chan); in reset_all_channels()
672 chan->gm_rpn_pitch_bend_range = 256; /* 2 semitones */ in reset_all_channels()
673 chan->gm_rpn_fine_tuning = 0; in reset_all_channels()
674 chan->gm_rpn_coarse_tuning = 0; in reset_all_channels()
677 chan->drum_channel = 1; in reset_all_channels()
679 chan->drum_channel = 0; in reset_all_channels()
704 static void snd_midi_reset_controllers(struct snd_midi_channel *chan) in snd_midi_reset_controllers() argument
706 memset(chan->control, 0, sizeof(chan->control)); in snd_midi_reset_controllers()
707 chan->gm_volume = 127; in snd_midi_reset_controllers()
708 chan->gm_expression = 127; in snd_midi_reset_controllers()
709 chan->gm_pan = 64; in snd_midi_reset_controllers()