Re: Raw Midi Bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 >> Your program behaves as if it reads two bytes in each call. Please 
print out the value of "err" when it succeeds.

This is for one note on, one note off.

Opening MIDI input port: "virtual"
90
Bytes read: 1
Byte type size: 1
3C
Bytes read: 1
Byte type size: 1
80
Bytes read: 1
Byte type size: 1
00
Bytes read: 1
Byte type size: 1

 >> How exactly have you defined "byte"?

typedef unsigned char byte;

As I said this works perfectly in blocking mode when connected directly 
to hardware. It only fails when using a virtual raw midi port.

 >> How does the loop look like?

     // Open the MIDI input device
     if ((err = snd_rawmidi_open(&m_inHandle, NULL, devName.c_str(), 0)) 
< 0)
     {
         std::cout << "Can't open MIDI input: " << snd_strerror(err) << 
std::endl;
         return false;
     }

     while (true)
     {
         byte byteVal;

         int err;

         if ((err = snd_rawmidi_read(m_inHandle, &byteVal, 
sizeof(byteVal))) < 0)
         {
             std::cout << "Can't read MIDI input: " << snd_strerror(err) 
<< std::endl;
             exit(0);
         }

         std::cout << charToHex(byteVal) << std::endl;
         std::cout << "Bytes read: " << err << std::endl;
         std::cout << "Byte type size: " << sizeof(byteVal) << std::endl;
     }

- Maxime

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux