[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-sound-dev
Subject:    <Sound Dev> Midi Strange behavior on MacOSX.
From:       bob.lang () blueyonder ! co ! uk (Bob Lang)
Date:       2012-12-10 16:31:46
Message-ID: F86C15A1-052A-411B-B148-FC45DBD1A4FD () blueyonder ! co ! uk
[Download RAW message or body]

Hi Guillaume

The problem you describe is most likely due to the Midi Device SPI that Apple ships \
as part of its Java system.  For a long time Apple didn't ship one at all and there \
was a thriving market in 3rd party Midi SPIs to fill the gap - and they mostly did a \
good job because they had to compete to survive.

Unfortunately, when Apple eventually wrote its own SPI, it was nowhere near as good \
as the 3rd party offerings but it still killed off the market.  I don't think that \
any 3rd party offerings can be found at all on the web now.

Bob
--
On 10 Dec 2012, at 15:19, guillaume wrote:

> Hello!
> I am writing an application that talks via midi/usb to a guitar effect 
> (Eleven Rack).
> I provide it for free and I have users on Linux, windows and Mac.
> The device sens big sysex messages of more that 1 kb on certain
> circumstances and the behavior on different platform is the following:
> 
> - Linux: receives 1 big sysex message each time.
> - Windows : Receives multpiple sysex messages. The first one is a
> regular sysex (F0...F7) and one or more SPECIAL_SYSEX (F7...F7). I was
> surprised but it seems from reading midi specs that it is the right
> behavior for split sysexes.
> - MacOSX: Receives 1 incomplete sysex (F0...F7) and then nothing... the
> other messages are discarded somwhere...
> 
> I am not a Java expert and I never try to compile Java myself, (this is
> my first java application). But I had a look at the source file
> src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_MidiUtils.c
> and saw that line 375 that Sysexes that starts with F7 are discarded.
> 
> As I understand the specs, some continued messages can start with F7 and
> end with F7. So maybe the solution is to arrange the code this way:
> 
> switch (byte) {
> case 0xF0:
> case 0xF7:
> // System exclusive
> // Allocates a CFMutableData reference to
> accumulate the SysEx data until EOX (0xF7) is reached.
> handle->readingSysExData =
> CFDataCreateMutable(NULL, 0);
> break;
> 
> So that messages starting with F7 outside of a sysex message are
> considered as sysex start.
> 
> Is there a way to rebuild only this part of the library to try on a mac?
> I borrowed a mac, installed Java 1.7 (downloaded from oracle) and I have
> the developper tools (clang as a compiler, I think).
> I would like to test the solution.
> Sorry, it may be a naive question, but as a java beginner, the jdk
> sources are really intimidating...
> 
> Yours,
> Guillaume.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic