|
|
|
@ -35,6 +35,7 @@ showUsage(const char* prog_name) |
|
|
|
printf("Usage: %s [options]\n", prog_name); |
|
|
|
printf("Usage: %s [options]\n", prog_name); |
|
|
|
printf(" options:\n"); |
|
|
|
printf(" options:\n"); |
|
|
|
printf(" -t: cycle test voltages on DAC\n"); |
|
|
|
printf(" -t: cycle test voltages on DAC\n"); |
|
|
|
|
|
|
|
printf(" -l: listen for midi events\n"); |
|
|
|
printf(" -k sequencer-port: attempt to connect to port \n"); |
|
|
|
printf(" -k sequencer-port: attempt to connect to port \n"); |
|
|
|
printf(" -f midi-file: play the first track, first channel of a MIDI file\n"); |
|
|
|
printf(" -f midi-file: play the first track, first channel of a MIDI file\n"); |
|
|
|
printf(" -h: show this help \n"); |
|
|
|
printf(" -h: show this help \n"); |
|
|
|
@ -109,11 +110,14 @@ main(i32 argc, char* argv[]) |
|
|
|
if (!midiOpen(&seq)) |
|
|
|
if (!midiOpen(&seq)) |
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
|
|
|
|
|
|
|
|
while ((opt = getopt(argc, argv, "tk:f:h")) != -1) { |
|
|
|
while ((opt = getopt(argc, argv, "tlk:f:h")) != -1) { |
|
|
|
switch (opt) { |
|
|
|
switch (opt) { |
|
|
|
case 'f': |
|
|
|
case 'f': |
|
|
|
printf("TODO: parse and play sequence from midi file\n"); |
|
|
|
printf("TODO: parse and play sequence from midi file\n"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'l': |
|
|
|
|
|
|
|
loopMIDI(&seq, &spi); |
|
|
|
|
|
|
|
break; |
|
|
|
case 'k': |
|
|
|
case 'k': |
|
|
|
if (!midiConnect(&seq, optarg)) { |
|
|
|
if (!midiConnect(&seq, optarg)) { |
|
|
|
printf("Error connecting to MIDI device, %s\n", optarg); |
|
|
|
printf("Error connecting to MIDI device, %s\n", optarg); |
|
|
|
|