On Sun, Sep 30, 2007 at 01:59:09AM +0000, Jacob Meuser wrote:
> 
> DESCR:
> ZynAddSubFX is an opensource software synthesizer capable of making a
> countless number of instruments, from some commonly heard from expensive
> hardware to interesting sounds that you'll boost to an amazing universe
> of sounds.
> 
> 
> this has a midi interface, but unfortunately, it uses /dev/sequencer
> which does not support read()ing.
> 

actually it's using /dev/sequencer as a raw midi device, so the
following makes midi input work:

--- Input/OSSMidiIn.C.ok        Mon Oct  1 22:07:04 2007
+++ Input/OSSMidiIn.C   Mon Oct  1 22:33:52 2007
@@ -56,11 +56,11 @@
 
 unsigned char OSSMidiIn::readbyte(){
     unsigned char tmp[4];
-    read(midi_handle,&tmp[0],1);
-    while (tmp[0]!=SEQ_MIDIPUTC){
-       read(midi_handle,&tmp[0],4);
-    };
-    return(tmp[1]);
+    if (read(midi_handle,&tmp[0],1) < 0) {
+      inputok = 0;
+      return 0xff;
+    }
+    return tmp[0];
 };
 
 unsigned char OSSMidiIn::getmidibyte(){


--- Misc/Config.C.ok    Mon Oct  1 22:38:05 2007
+++ Misc/Config.C       Mon Oct  1 22:38:25 2007
@@ -49,7 +49,7 @@
     snprintf(cfg.LinuxOSSWaveOutDev,MAX_STRING_SIZE,"/dev/dsp");
 #endif
     cfg.LinuxOSSSeqInDev=new char[MAX_STRING_SIZE];
-    snprintf(cfg.LinuxOSSSeqInDev,MAX_STRING_SIZE,"/dev/sequencer");
+    snprintf(cfg.LinuxOSSSeqInDev,MAX_STRING_SIZE,"/dev/rmidi1");
 
     cfg.DumpFile=new char[MAX_STRING_SIZE];
     snprintf(cfg.DumpFile,MAX_STRING_SIZE,"zynaddsubfx_dump.txt");


-- Alexandre

Reply via email to