From: Roger E Critchlow Jr <rec@elf.org>
To: Peter Enderborg <pme@ufh.se>
Cc: "alsa-devel@lists.sourceforge.net" <alsa-devel@lists.sourceforge.net>
Subject: Re: Rawmidi bug or missed feature?
Date: Sat, 2 Mar 2002 10:55:08 -0700 [thread overview]
Message-ID: <15489.4604.699052.853933@elf2.elf.org> (raw)
In-Reply-To: <3C80D439.90AC04A9@ufh.se>
Peter Enderborg writes:
> Jaroslav Kysela wrote:
>
> > On Fri, 1 Mar 2002, Peter Enderborg wrote:
> >
> > > Paul Davis wrote:
> > >
> > > > >Yes! And the device that is using running status is alsa rawmidi device.
> > > >
> > > > What makes you think that? AFAIK, the raw MIDI device code does no
> > > > parsing of MIDI data at all ...
> > >
> > > Parsing? It sends raw midi on a stream. That stream is _from_ alsa seq.
> > > It is doing the bandwith optimize by it self. I do the parsing.
> >
> > Ok, please, specify your problem in a more detailed way. At least, we need
> > to know about midi paths in your applications and what sequencer clients
> > are involved to help you. And yes, there could be a problem with running
> > status, because our converts work with it.
> >
>
> I don't know how to be more specific. I have a program that listen to a raw midi
>
> stream generated by alsa. But I try.
>
> I have a midisport 8x8. It have a serial port. I have a computer linux. Alsa
> don't have
> driver for the unit. So I have writen a daemon that open the snd-card-virmidi
> with
> snd_rawmidi_open(). I have also writen a processor that handels event on a
> sequencer level
> to interface my Roland MCR-8 with varius applications, synths. Roland MCR-8 a
> "multicontroler"
> but it is not progammable. It have 9 knobs,9 slides a lot of buttons an a dialer
> wheel.
> But not all apps have the same mapping of events. So the processor mapps them i
> the way I like
> to have them. But it is only control messages. On the daemon side that
> interfaces to the
> raw midi stream in encapsulate them in to midimans format and sent them over the
> serial port
> to the unit. The unit is decapsulate them and send it to the right midi port.
> But when I open the
> virmidi device in raw mode. I is already assuming that I know what was the last
> command. In my case
> a control message. Is this clear enougth? I know that this a very common midi
> problem, but it should not have to be a problem within the same machine.
>
I think you want to do this differently.
Your program for patching the midisport into the alsa sequencer
should connect to the midisport driver on one side and the sequencer
event interface on the other side and use the alsa/snd_midi_event.h
routines to translate between the two.
So, as you read raw midi bytes from the midisport driver, use
/* encode from byte stream -
return number of written bytes if success */
long snd_midi_event_encode(snd_midi_event_t *dev,
unsigned char *buf,
long count,
snd_seq_event_t *ev);
to encode the incoming byte stream into snd_seq_event_t and send the
events the sequencer using the event interface.
As you receive events from the sequencer, use
/* decode from event to bytes -
return number of written bytes if success */
long snd_midi_event_decode(snd_midi_event_t *dev,
unsigned char *buf,
long count,
snd_seq_event_t *ev);
to decode the incoming event stream into a midi byte stream which you
can then write() to the midisport.
You will need to send a reset on the midisport side when you first
connect to get the snd_midi_event_t state synchronized to the incoming
running status.
But you won't see any running status from the alsa side because the
event interface fully identifies each event. snd_midi_event_decode
will use running status on the decode side, but the stream generated
will start from the first event decoded.
Does this help?
-- rec --
_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel
next prev parent reply other threads:[~2002-03-02 17:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-28 22:56 Rawmidi bug or missed feature? Peter Enderborg
2002-03-01 13:45 ` Paul Davis
2002-03-01 14:58 ` Ricardo Colon
2002-03-01 19:22 ` Peter Enderborg
2002-03-01 20:30 ` Paul Davis
2002-03-01 21:06 ` Peter Enderborg
2002-03-01 21:31 ` Paul Davis
2002-03-01 22:18 ` Peter Enderborg
2002-03-02 11:14 ` Jaroslav Kysela
2002-03-02 13:31 ` Peter Enderborg
2002-03-02 17:11 ` Paul Davis
2002-03-02 17:45 ` Peter Enderborg
2002-03-02 18:01 ` Paul Davis
2002-03-02 18:37 ` Peter Enderborg
2002-03-02 18:58 ` Paul Davis
2002-03-02 19:15 ` Peter Enderborg
2002-03-02 19:31 ` Paul Davis
2002-03-02 22:22 ` ALSA sequencer in user land (was: Rawmidi bug or missed feature?) Frank van de Pol
2002-03-02 17:55 ` Paul Davis
2002-03-03 0:34 ` Frank van de Pol
2002-03-02 20:18 ` Paul Davis
2002-03-03 4:13 ` CAPs Bob Ham
2002-03-02 17:55 ` Roger E Critchlow Jr [this message]
2002-03-02 18:36 ` Rawmidi bug or missed feature? Peter Enderborg
2002-03-02 20:43 ` Roger E Critchlow Jr
2002-03-02 22:20 ` Peter Enderborg
2002-03-01 21:32 ` Paul Davis
2002-03-02 10:28 ` Jaroslav Kysela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15489.4604.699052.853933@elf2.elf.org \
--to=rec@elf.org \
--cc=alsa-devel@lists.sourceforge.net \
--cc=pme@ufh.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.