From alsa-devel-owner@alsa.jcu.cz  Wed Jul 29 21:28:26 1998
Received: from altrade.nijmegen.inter.nl.net (altrade.nijmegen.inter.nl.net [193.67.237.6])
	by marvin.jcu.cz (8.8.8/8.8.8) with ESMTP id VAA02041
	for <alsa-devel@jcu.cz>; Wed, 29 Jul 1998 21:28:03 +0200
Received: from obelix.fvdpol.inter.nl.net by altrade.nijmegen.inter.nl.net
	via bd99-18.Breda.NL.net [193.79.246.243] with ESMTP for <alsa-devel@jcu.cz>
	id VAA28554 (8.8.8/3.28); Wed, 29 Jul 1998 21:28:00 +0200 (MET DST)
Received: (from frank@localhost) by obelix.fvdpol.inter.nl.net (8.8.7/8.7.3) id VAA13281; Wed, 29 Jul 1998 21:14:54 +0200
From: Frank van de Pol <F.K.W.van.de.Pol@inter.nl.net>
Message-Id: <199807291914.VAA13281@obelix.fvdpol.inter.nl.net>
Subject: Re: kernel MIDI interface
To: alsa-devel@jcu.cz
Date: Wed, 29 Jul 1998 21:14:54 +0200 (MET DST)
Cc: alsa-devel@jcu.cz (Jaroslav Kysela)
In-Reply-To: <199807272139.XAA14741@obelix.fvdpol.inter.nl.net> from "Frank van de Pol" at Jul 27, 98 11:39:43 pm
Content-Type: text
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

I wrote:
> 
> I've been experimenting with the MIDI interface for kernel modules from the
> alsa-driver-0.2.0-pre2 driver. 
> 
> Playback works great. I get nice tight timing with the ALSA sequencer. Recording
> works ok for MIDI note on/off and program changes.
> 
> With control changes and pitchbend messages I receive an odd sequence.
> Instead of the expected 3 byte message I get 2 messages of 2 bytes. Instead
> of eg. a "bf,6c,xx" message I get a "bf,6c" and a "bf,xx" message. 

Some additional info:

The synth I used for generating the MIDI data is a Novation BassStation
(analogue monophonic synth). I've snapped a part of the MIDI stream produced
by my synth into a file, and made a 'od -t x1 ' dump of it. As can be seen I
played 2 notes, played with a controller, and ended with playing 2 notes.

0000000 9f 1f 7b 9f 1f 00 9f 1f 72 9f 1f 00 bf 6c 51 6c
0000020 4f 6c 4c 6c 49 6c 47 6c 44 6c 42 6c 3f 6c 3c 6c
0000040 39 6c 36 6c 32 6c 2f 6c 2c 6c 27 6c 23 6c 20 6c
0000060 1c 6c 19 6c 16 6c 14 6c 17 6c 1d 6c 23 6c 29 6c
0000100 2e 6c 32 6c 36 6c 3b 6c 3f 6c 40 9f 1d 7f 9f 1d
0000120 00
0000121

Weird thing is that no running state is used for the note events, but the
controller data is using running state. Should not matter, it still complies
to the MIDI spec. I think this running state confuses the ALSA MIDI input
routines. Here's the (dmesg) output from the test program included with the
'pre2' driver for a similar action:


snd: rx command 'GF1': 9f:1d:72:	(note on)
snd: rx command 'GF1': 9f:1d:00:	(note off)
snd: rx command 'GF1': 9f:1d:72:
snd: rx command 'GF1': 9f:1d:00:
snd: rx command 'GF1': bf:6c:18:	(1st controller event, went ok)
snd: rx command 'GF1': bf:6c:		(ALSA confused by running status???)
snd: rx command 'GF1': bf:19:		( part 2 of the confused message)
snd: rx command 'GF1': bf:6c:
snd: rx command 'GF1': bf:1a:
snd: rx command 'GF1': bf:6c:
snd: rx command 'GF1': bf:1b:
snd: rx command 'GF1': bf:6c:
snd: rx command 'GF1': bf:1c:
snd: rx command 'GF1': bf:6c:
snd: rx command 'GF1': bf:1d:
					(cut some data...)
snd: rx command 'GF1': bf:6c:
snd: rx command 'GF1': bf:1e:
snd: rx command 'GF1': bf:6c:
snd: rx command 'GF1': bf:1f:
snd: rx command 'GF1': bf:6d:
snd: rx command 'GF1': bf:36:
snd: rx command 'GF1': 9f:18:6d:	(finaly the note off...)
snd: rx command 'GF1': 9f:18:00:
snd: rx command 'GF1': 9f:1c:65:
snd: rx command 'GF1': 9f:1c:00:

The controller 0x6c, in case anyone wonders, is the Attack time for the
filter envelope :-)

Hope this helps,
Frank. 

+---- --- -- -  -   -    - 
|Frank van de Pol                  -o)
|F.K.W.van.de.Pol@inter.NL.net     /\\
|                                 _\_v
|Linux - Why use Windows, since there is a door?
|
|ALSA Sequencer: http://www.inter.nl.net/users/F.K.W.van.de.Pol/alsa/

