Hi,

I am new to this mailing list but not new to using ALSA and have used MIDI 
since it was invented.

Now I have bumped into an issue with amidi from the alsa-utils.

By default amidi filters away Active Sensing data (0xFE) from incoming 
MIDI data. This is good to keep the datastream on screen readable (-d, 
--dump) or to keep SysEx dumps to disk clean (--receive, -r) option. Also 
it is necessary with such MIDI gear for the timeout (-t) option to be 
usable.

But I have owned at least 2 synthesizers that not only send 0xFE 
continuously, but also 0xF8. 0xF8 is another of the so called "System 
Realtime" messages, it is the MIDI TIMING CLOCK message. My Yamaha V50 
(which I unfortunately sold long ago) was sending this message 
continously, but also my recently acquired Yamaha Reface DX. The V50 has a 
built in multitrack sequencer and drummachine, the Reface DX has a simple 
phrase loop sequencer built-in. The 0xF8 message is used for 
synchronisation of the sequencer clock with external gear. On the Reface 
it can't be switched off, I amnot sure about the V50.


Anyway, the stream of 0xF8 messages (24 times per quarternote I think) is 
a problem for amidi. If I try to make a SysEx dump from my RefaceDX:

- it does not react to the -t option. It "sees" data (F8 F8 F8 F8 ....) 
coming in even if the dump has finished.

- If I hit Ctrl-C I can force amidi to quit. The file that I used for 
"--receive=FILENAME" does contain the SysEx data I needed, but also a lot 
of redundant F8 bytes.


Now I tried first to fix the sourcecode myself.
In alsa-utils-1.0.29/amidi/amidi.c:529

I made the following changes

-                               if (!ignore_active_sensing || buf[i] != 0xfe)
+                               if (!ignore_active_sensing || buf[i] < 0xf8)


And compiled again.

This patch seems to help, sort of. It does block 0xF8 from the 
incoming data when using the --dump or --receive options. But the 
--timeout option still does not work as expected. For example if both 
use --timeout=5 and -d options with my patched amidi version and request a 
dump from my Reface DX, I can see the correct hexadecimal codes printed on 
screen, without those F8 bytes, and after the last F7 has been printed no 
more bytes are printed on screen. But: the program does not quit, even 
after the --timeout's 5 seconds have passed. If I disconnect the MIDI 
cable or switchoff the Reface DX, thus stopping the 0xF8 mididatastream, 
amidi quits, and shows the correct number of received bytes.

Bugreport/feature/fix-requests:

Let amidi, by default block all Midi System Realtime messages, not only 
0xFE, but also 0xF8, and F9, FA, FB, FC, FD, FF.

Let the --timeout option also be aware of this

-a, --active-sensing   don't ignore active sensing bytes

should be

-a, --system-realtime don't ignore system realtime bytes


I hope this makes sense to some of the developers.

-- 

MT


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to