DreamTeam Ltd. (dreamt++at++netvision.net.il)
Sun, 25 May 1997 15:10:35 -0700
After configuring midi by the command
>> startmidi -d /dev/ttyd1
The following program reads the events of the midi and prints them.
The problem is that this program works only on an indy and not on impact.
I think there is someting wrong in the configuration, I don't know what?
Does anyony have the pinout of a cable 8pin female mini din into a male 9 pin ddb
(We need to connect devices that connect into an Impact to an O2 (spacemouse,midi))
#include <stdio.h>
#include <dmedia/midi.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
int sigint = 0;
void cbreak(int) { sigint = 1; }
void main()
{
MDport port;
MDevent events[16];
sigset(SIGINT, cbreak);
sigset(SIGTERM, cbreak);
int nports = mdInit();
if (nports == 0) {
fprintf(stderr, "No MIDI devices configured.\n");
exit(1);
}
// Open the default input device
#if 0
port = mdOpenInPort("Serial Port 2");
#else
// Try this if you don't have an interface named "Serial Port 1"
// configured. This will open the default input device instead.
port = mdOpenInPort(NULL);
#endif
if (port == NULL) {
perror("port open()\n");
exit(1);
}
// Set non-blocking mode
if (fcntl(mdGetFd(port), F_SETFL, FNONBLOCK) < 0) {
perror("non-blocking");
exit(1);
}
while (!sigint) {
// Wait for midi event
int numrcvd = mdReceive(port, events, 16);
if (numrcvd > 0) {
char string[100];
mdPrintEvent(string, events, numrcvd);
printf("%s", string);
}
}
mdClosePort(port);
printf("Exiting...\n");
}
Tnx
Roni Kass
V.P. Research & Development
DreamTeam Ltd.
Tel: +972-9-9559855
Fax: +972-9-9559615
Email: dreamt++at++netvision.net.il
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:17 PDT