Re: [linux-audio-dev] patch MIDI apps together?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] patch MIDI apps together?
From: Benno Senoner (sbenno_AT_gardena.net)
Date: Tue Apr 18 2000 - 15:16:15 EEST


On Tue, 18 Apr 2000, Paul Winkler wrote:
> Hi,
>
> I've seen occasional posts here regarding the possibility of some
> kind of MIDI loopback. I have both OSS/Linux and Alsa 0.5.7
> installed, and I can't figure out from the documentation of either
> if such a thing already exists. I found an old message on l.a.d.
> from PBD saying OSS already has some kind of midi loopback, but
> (sorry if I'm dense) I can't find it.
>
> Basically I want to see if I can route the output of Jazz++ or some
> other sequencer directly into a soft-synth (ANY soft synth...
> TiMidity, Xsynth, aRts, what have you...)
>
> I thought of using plain old FIFOs, but there are two problems
> there:
> 1) Sequencers seem to rely on the soundcard driver for timing, which
> the FIFO can't provide.
> 2) application designers continue to present users with a limited
> selection of input/output devices so pipe tricks like that are
> disallowed.

ok, here my thoughts:

CASE1: (easy to solve)

program uses RAW midi IO devices direcly:

solution:
just use the LD_PRELOAD trick (write a small wrapper (like esddsp does)),
that overrides the open() read() and write() syscalls and check for
/dev/midi* if yes then simply route to your preferred FIFO , socket, etc.
That means a program started with the LD_PRELOAD trick, will think that it
is writing/reading to/from the real /dev/midi* device.

CASE2: (harder)

program uses /dev/sequencer

solution:
use LD_PRELOAD as above PLUS implement the OSS sequencer in userspace
which then extracts and produces/requests events at the right time (using some
high precision timer like RTC).
At this point you are done since you can send the single MIDI events where you
want. (pipe/socket/ other /dev/midi devices) etc.

Unfortunately it seems that most of the cool programs use the /dev/sequencer ,
therefore implementing CASE1 will only solve the problem for a small fraction
of the MIDI apps.

But again with the /dev/sequencer specs at hand it shouldn't be too hard to get
a such redirector working.

Benno.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Apr 18 2000 - 18:45:38 EEST