#include #include int main() { snd_seq_t* seq; int port; snd_seq_event_t ev; snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0); snd_seq_set_client_name(seq, "monprog"); port = snd_seq_create_simple_port(seq, "port1",SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ,SND_SEQ_PORT_TYPE_APPLICATION); getchar(); // time to start a softsynth ;) snd_seq_ev_clear(&ev); snd_seq_ev_set_source(&ev, port); snd_seq_ev_set_subs(&ev); snd_seq_ev_set_direct(&ev); snd_seq_ev_set_note(&ev, 0, 28, 127, 3); snd_seq_event_output_direct(seq, &ev); snd_seq_drain_output(seq); snd_seq_free_event(&ev); sleep(1) ; return 0; }