int cur_blip = 0;
struct blip blips[NUM_BLIPS];
+uint16_t channels = 0;
+
snd_seq_t *open_seq(void) {
snd_seq_t *seq_handle;
snd_seq_event_input(seq_handle, &ev);
switch (ev->type) {
case SND_SEQ_EVENT_NOTEON:
+ if (channels && !(channels & (1<<ev->data.note.channel)))
+ break;
if (ev->data.note.velocity != 0) {
note_on(ev->data.note.note, ev->data.note.velocity);
cnt++;
pfd = malloc(npfd * sizeof(*pfd));
snd_seq_poll_descriptors(seq_handle, pfd, npfd, POLLIN);
- if (argc == 2) {
+ if (argc >= 2) {
snd_seq_addr_t addr;
if (snd_seq_parse_address(seq_handle, &addr, argv[1]) == 0) {
if (snd_seq_connect_from(seq_handle, portid, addr.client, addr.port) == 0) {
}
}
+ int i;
+ for (i=2; i<argc; i++)
+ channels |= 1<<(atoi(argv[i])-1);
+
OLRenderParams params;
memset(¶ms, 0, sizeof params);
float time = 0;
float ftime;
- int i,j;
int frames = 0;
if (poll(pfd, npfd, 0) > 0)
notes = midi_action(seq_handle);
- int pnotes = notes;
- if (pnotes > 1)
- pnotes = 1;
+ int pnotes = (notes+2)/3;
nps = pnotes / ftime * 1.2;