Re: [LAU] strange behaviour with novation launchpad

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-user@...>
Date: Friday, July 13, 2012 - 8:59 am

On Fri, Jul 13, 2012 at 08:50:18AM +0200, Atte André Jensen wrote:

That seems to apply only to messages sent *to* the LP: it wants
a status byte in each one. But doesn't do the same in the LP->
app direction.

I also tried the reset command, but it too does not clear the
running status. AFAIK only a power cycle will.

> Is there anyway to get a status byte to the driver/launchpad from my

You'd have to switch the power on the USB socket... It's not the
USB drivers failing to reset, but the LP firware.

> I've been using the launcpad a bit with renoise, esp the duplex

It is possible if you have LP-specific driver code. Only two keys
are ambiguous without a status byte: both have 0x68 as the first
data byte (the second is press/release, encoded the same way in
all cases). For all others you can infer the status byte form the
data.

When I got my LP I wrote a python extension and class that uses
it directly via libusb, without going via ALSA, and it solves
the problem, except if the first event has data byte 0x68.
This is part of the code, with _cstat being the current status,
initialised to 0, and p is an array of n received bytes:

i = 0;
while (i < n)
{
t = p [i++];
if (t & 0x80) // First byte is status ?
{
_cstat = t & 0xF0;
t = p [i++];
}
v = p [i++] ? 1 : 0;
// If we don't have status, find it from the data.
if (! _cstat && (t != 0x68))
{
_cstat = ((t & 0x0F) > 8) ? 0xB0 : 0x90;
}
// Keys are encoded with x,y = 0...8.
// x == 8 means the right column.
// y == 8 means the top row.
if (_cstat == 0x90) rx_action (v, t & 0x0F, t >> 4);
if (_cstat == 0xB0) rx_action (v, t & 0x07, 8);
}.

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] strange behaviour with novation launchpad, Atte André Jensen, (Thu Jul 12, 7:28 pm)
Re: [LAU] strange behaviour with novation launchpad, Fons Adriaensen, (Thu Jul 12, 9:02 pm)
Re: [LAU] strange behaviour with novation launchpad, Atte André Jensen, (Fri Jul 13, 6:55 am)
Re: [LAU] strange behaviour with novation launchpad, Fons Adriaensen, (Fri Jul 13, 8:59 am)
Re: [LAU] strange behaviour with novation launchpad, Kaspar Bumke, (Fri Jul 13, 3:56 pm)
Re: [LAU] strange behaviour with novation launchpad, Fons Adriaensen, (Fri Jul 13, 8:40 pm)
Re: [LAU] strange behaviour with novation launchpad, Atte André Jensen, (Fri Jul 13, 4:23 pm)
Re: [LAU] strange behaviour with novation launchpad, Kaspar Bumke, (Fri Jul 13, 4:41 pm)
Re: [LAU] strange behaviour with novation launchpad, Fons Adriaensen, (Fri Jul 13, 8:46 pm)
Re: [LAU] strange behaviour with novation launchpad, Robin Gareus, (Fri Jul 13, 6:59 pm)
Re: [LAU] strange behaviour with novation launchpad, Kaspar Bumke, (Fri Jul 13, 7:12 pm)
Re: [LAU] strange behaviour with novation launchpad, Fons Adriaensen, (Fri Jul 13, 8:32 pm)
Re: [LAU] strange behaviour with novation launchpad, Kaspar Bumke, (Fri Jul 13, 6:59 pm)
Re: [LAU] strange behaviour with novation launchpad, Fons Adriaensen, (Fri Jul 13, 8:34 pm)
Re: [LAU] strange behaviour with novation launchpad, Kaspar Bumke, (Fri Jul 13, 4:08 pm)