Re: Raw Midi Bug?

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

 



Maxime Chevalier-Boisvert wrote:
> This is what I get for a single key press if I log each byte I read:
> 
> 90
> 4B
> 80
> 00
> 
> As you can see, there's a key on, and then a second byte (which seems to 
> be the velocity), but no byte to indicate which key is being pressed!
> 
> I'm reading the data byte per byte, from a blocking port:
> 
>    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;
>          throw BadInput();
>      }
> 
>      std::cout << charToHex(byteVal) << std::endl;

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

How exactly have you defined "byte"?
How does the loop look like?


Regards,
Clemens

------------------------------------------------------------------------------
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