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

[MiNT] Re: midi.xdd



Hi Martin,

>> I've written a midi handler that can be included in a extended device
>> driver (I think), and I'd like to try to build such a driver but I have
>> no example nor source.

>Is this ready yet?  Just want to know if any progress happened.

Well, no it's not ready. In fact I decided to not include this midi driver
in a XDD because 
- It's no an 'all purpose' driver. It can only be used for midi application
 with music instruments because it doesn't care about errors (I've never
 seen a Midi error since I use it). But it can be changed with a few lines.
- I had no example of how to build a XDD, and the MiNT docs & sources don't
  seem to be very friendly :-(
  But I found an example of XDD in asm a few weeks ago : it's "the Moose",
  which is the mouse driver for XaAES.
- I think the overhead would be too heavy for a time-critical application
  like midi real time datas.
- My driver had no wonderful function, and a midi.xdd would have no 
  advantage compared to u:/dev/midi
  
Since this time I added some features to the driver, like midi message
recognition, and I tried to optimize it. It can run on both 030 and 68000
as I expect it to work with my old 1040STf TOS 1.000000 ;-p
The purpose is to build a Midi Server. Applications will register to this
server, and it will give them 2 IOrec structures for input and ouput. The
server will be able to redirect the Inputs and the outputs and the
applications to one or several other apps, or the Midi ports.
The messages will have a certain structure in the IOrec :
- One byte for length of the message (like in Pascal strings)
- The whole message, without running status.
I expect this to avoid too heavy message recognition routs in the client 
apps ...

I'm currently working on the client manager (in C), but I have a problem :
I don't know how the midi driver (in interrupt) should aware the client
manager (in user mode) there are bytes available in the Midi input buffer...
I've not tried yet but I think I won't be able to use Psemaphore, Pmsg,
Psignal and all these in interruption ....
I'd like the server to be blocked until midi bytes arrive, just like
when I do a Bconin(3) ! I know if I make a XDD it will be possible !
 
I realized this problem 2 days ago ... in fact I had thought about it
a while before but I tought it would be easy to solve it.
As you can see, I'll probably have to write a XDD, but it will most
probably be something dedicated to my Midi Server.
It's almost difficult for me because I'm a beginner and I've nobody to help
me to understand how works the MiNT IO system (I'm a lonesome Falconist)
But it _WILL_WORK_ one day :-)

I'll have a look at this this week-end.
I hope all this answers your question :-)
Bye

Vincent

PS : of course all my sources are free, if you want them don't hesitate
to ask me. There are tons of comments ;-)