Re: [linux-audio-user] sending program change to alsa

From: Clemens Ladisch <clemens@email-addr-hidden>
Date: Sat Jun 18 2005 - 15:01:45 EEST

Atte André Jensen wrote:
> I need a program that will allow me to send predefined program changes
> to alsa clients.

You could load snd-virmidi, connect its port(s) to the destination
port(s), and then call something like

amidi -p hw:X,Y -S "c1 23"

> If not, could anyone point me in the right direction of some
> documentation on how to write such a program, esp how to register as an
> alsa-client and exactly what should be send out how for it to be program
> change.

In C, this would be something like this:

snd_seq_t *seq;
snd_seq_event_t ev;

snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0);
snd_seq_set_client_name(seq, "my funky program changer");
snd_seq_create_simple_port(seq, "source port",
                           SND_SEQ_PORT_TYPE_MIDI_GENERIC |
snd_seq_ev_set_dest(&ev, dest_client, dest_port);
snd_seq_ev_set_pgmchange(&ev, channel, program);
snd_seq_event_output_direct(seq, &ev);

Received on Sat Jun 18 16:15:15 2005

This archive was generated by hypermail 2.1.8 : Sat Jun 18 2005 - 16:15:16 EEST