Skip to contentSkip to conversation

Quick question regarding raw midi access via alsa sequencer

DISCUSSION Ivica Ico Bukvic 3 participants 5 messages Mar 18, 2005 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi all,

I did a bit of hacking on my app trying to make it alsa sequencer compatible but did not want to do too much changing in terms of how it deals with raw MIDI data. From looking at the API reference it seems that I have 2 choices:

1) Use raw midi option and specify "virtual" name which makes my app's MIDI I/O appear in the alsa sequencer, *but* does not give me an option of changing the node names which obviously is very important when it comes to working with a lot of apps concurrently. So therefore here's my first question:

Is there a way to specify a "virtual" port so that I can receive raw MIDI data, have ports show in the alsa sequencer and on top of that be able to *rename* the port as necessary?

2) The other option is obviously to use alsa-sequencer API but in that case is there a way to simply convert the stream of received MIDI data into raw midi format so that I can use my built-in raw MIDI parsing engine for parsing the messages?

Any help is greatly appreciated!

Best wishes,

Ivica Ico Bukvic, composer & multimedia sculptor
http://meowing.ccm.uc.edu/~ico/

Signature · 3 lines
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005
#1 lore raw
Quoted 3 lines

I did a bit of hacking on my app trying to make it alsa sequencer compatible but did not want to do too much changing in terms of how it deals with raw MIDI data. From looking at the API reference it seems that I have 2 choices:

libmidi++ in the ardour source tree has what you need. at least as a model. ardour writes raw MIDI, never uses the sequencer API. libmidi++ provides "port" objects which support that, regardless of whether they correspond to a raw MIDI port, a FIFO (literally), CoreMIDI or ALSA sequencer.

see alsasequencer_midiport.cc for details.

--p

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

A message that is not in the archive (sent off-list or not yet received): 200503181550.j2IFoWvj011640-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#3 lore raw

RE: Quick question regarding raw midi access viaalsa sequencer

Thanks Paul,

I look into that particular file.

Best wishes,

Ivica Ico Bukvic, composer & multimedia sculptor
http://meowing.ccm.uc.edu/~ico/

Quoted 31 lines

-----Original Message-----
From: linux-audio-dev-bounces-oG0YroN0ZiqENrSoib9kfje48wsgrGvP@public.gmane.org [mailto:linux-audio-dev- [email protected]] On Behalf Of Paul Davis
Sent: Friday, March 18, 2005 10:51 AM
To: The Linux Audio Developers' Mailing List
Cc: [email protected]
Subject: Re: [linux-audio-dev] Quick question regarding raw midi access
viaalsa sequencer

Quoted 1 line

I did a bit of hacking on my app trying to make it alsa sequencer

compatible

Quoted 1 line

but did not want to do too much changing in terms of how it deals with

raw

Quoted 1 line

MIDI data. From looking at the API reference it seems that I have 2

choices:

libmidi++ in the ardour source tree has what you need. at least as a model. ardour writes raw MIDI, never uses the sequencer API. libmidi++ provides "port" objects which support that, regardless of whether they correspond to a raw MIDI port, a FIFO (literally), CoreMIDI or ALSA sequencer.

see alsasequencer_midiport.cc for details.

--p

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005

Signature · 3 lines
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005
#4 lore raw
In reply to Ivica Ico Bukvic
Quoted 4 lines · Ivica Ico Bukvic

2) The other option is obviously to use alsa-sequencer API but in that case is there a way to simply convert the stream of received MIDI data into raw midi format so that I can use my built-in raw MIDI parsing engine for parsing the messages?

If I understand the requirement right, then the snd_midi_event_* API can do
it: see <alsa/seq_midi_event.h>. I've used this a couple of times in the DSSI examples source code, and I'm sure there are plenty of examples elsewhere.

Chris

A message that is not in the archive (sent off-list or not yet received): 200503181551.22294.cannam-8XHTaEMpybawskZW6HU+u9vLeJWuRmrY@public.gmane.org

#6 lore raw

RE: Quick question regarding raw midi access viaalsa sequencer

Thanks all for your replies. I tried messing with the snd_midi_event_* stuff but none provided proper data as when I tried accessing the struct with 8-bit data I got number like 15360 or something like that. I am sure that I am misreading something or simply doing something incorrectly, pointers to a working code would be highly appreciated!

Best wishes,

Ivica Ico Bukvic, composer & multimedia sculptor
http://meowing.ccm.uc.edu/~ico/

Quoted 31 lines

-----Original Message-----
From: linux-audio-dev-bounces-oG0YroN0ZiqENrSoib9kfje48wsgrGvP@public.gmane.org [mailto:linux-audio-dev- [email protected]] On Behalf Of Chris Cannam
Sent: Friday, March 18, 2005 10:51 AM
To: linux-audio-dev-oG0YroN0ZiqENrSoib9kfje48wsgrGvP@public.gmane.org
Cc: Ivica Ico Bukvic; [email protected]
Subject: Re: [linux-audio-dev] Quick question regarding raw midi access
viaalsa sequencer

Quoted 1 line · Ivica Ico Bukvic

2) The other option is obviously to use alsa-sequencer API but in that

case

Quoted 1 line

is there a way to simply convert the stream of received MIDI data into

raw

Quoted 2 lines

midi format so that I can use my built-in raw MIDI parsing engine for parsing the messages?

If I understand the requirement right, then the snd_midi_event_* API can do
it: see <alsa/seq_midi_event.h>. I've used this a couple of times in the DSSI examples source code, and I'm sure there are plenty of examples elsewhere.

Chris

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005

Signature · 3 lines
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005