sequencer: handling non-registered parameter numbers....
hello alsa gurus !
i have bought a peavey studiomix midi controller on ebay, and it sends NRPN messages (non-registered parameter numbers). when i move a slider, it sends the slider number encoded in 98 and 99 and the value in the DATA ENTRY controllers 6 and 38. i would like to map these to ordinary midi controllers, or better yet, get nrpn support into ardour.
how do i get nrpn controller values from the alsa sequencer without having to parse the individual events and put them together by hand ?
grepping through alsa-lib, i found
static struct extra_event_list_t {
int event;
int (*decode)(snd_midi_event_t *dev, unsigned char *buf, int
len, snd_seq_event_t *ev);
} extra_event[] = {
{SND_SEQ_EVENT_CONTROL14, extra_decode_ctrl14},
/*{SND_SEQ_EVENT_NONREGPARAM, extra_decode_nrpn},*/
/*{SND_SEQ_EVENT_REGPARAM, extra_decode_rpn},*/
};which makes me think it might not yet be implemented....
any hints or fine manuals around ?
(disclaimer: i know absolutely *nothing* about the alsa seq code, my level of understanding is matthias' example client.)
best,
jörn
Signature · 21 lines
All Members shall refrain in their international relations from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations. -- Charter of the United Nations, Article 2.4 Jörn Nettingsmeier Kurfürstenstr 49, 45138 Essen, Germany http://spunk.dnsalias.org (my server) http://www.linuxdj.com/audio/lad/ (Linux Audio Developers) ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
On Sunday 15 June 2003 18.16, Joern Nettingsmeier wrote:
[...]
Quoted 5 lines
/*{SND_SEQ_EVENT_NONREGPARAM, extra_decode_nrpn},*/ /*{SND_SEQ_EVENT_REGPARAM, extra_decode_rpn},*/ };which makes me think it might not yet be implemented....
I'm using NRPNs to control the mixer in the current development version of Audiality, and they appear to be working just fine, and just like one would expect.
Quoted 1 line
any hints or fine manuals around ?
Do you need one? :-)
What you get is plain <control, value> tuples, and that's all there is to it. (Well, it's all I *want* anyway, as I don't want to do stuff that's outside the MIDI spec...)
Here's some code, which isn't heavily tested, but does seem to do the job:
static void alsaseq_read(struct A_device *dev, unsigned frames)
{
int more = 1;
snd_seq_event_t *ev;
ALSASEQ_data *d = (ALSASEQ_data *) dev->driver_data;
dev->read_ms->time = aev_timer;
while(more)
{
more = snd_seq_event_input(d->seq_handle, &ev);
if(more < 0)
break;
switch (ev->type)
{
case SND_SEQ_EVENT_CONTROLLER:
dev->read_ms->control(
ev->data.control.channel,
ev->data.control.param,
ev->data.control.value);
break;
case SND_SEQ_EVENT_NONREGPARAM:
dev->read_ms->nrpn(ev->data.control.channel,
ev->data.control.param,
ev->data.control.value);
break;
...
case SND_SEQ_EVENT_PITCHBEND:
dev->read_ms->bend(ev->data.control.channel,
ev->data.control.value);
break;
}
snd_seq_free_event(ev);
}
}//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. | | RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
hello david !
thanks for your reply.
Quoted 10 lines · David Olofson
On Sunday 15 June 2003 18.16, Joern Nettingsmeier wrote:
[...]Quoted 5 lines
/*{SND_SEQ_EVENT_NONREGPARAM, extra_decode_nrpn},*/ /*{SND_SEQ_EVENT_REGPARAM, extra_decode_rpn},*/ };which makes me think it might not yet be implemented....
Quoted 8 lines
I'm using NRPNs to control the mixer in the current development version of Audiality, and they appear to be working just fine, and just like one would expect.
Quoted 1 line
any hints or fine manuals around ?
Do you need one? :-)
where did i make the impression that i have *any* clue about progamming ? yes i do :)
Quoted 3 lines
What you get is plain <control, value> tuples, and that's all there is to it. (Well, it's all I *want* anyway, as I don't want to do stuff that's outside the MIDI spec...)
Here's some code, which isn't heavily tested, but does seem to do the job:
either i have not understood the semantics of nrpm, or nrpm events are not detected as such. when i move a slider, i always get four separate normal controller events: two on 98/99 encoding the control number as a 14bit value, and two on 6 and 38 encoding the data.
the case SND_EVENT_NONREGPARAM is never reached.
now one of three things must be broken (in decreasing order of likelihood): me, my wacky peavey controller, or alsa-lib.
?
Signature · 21 lines
All Members shall refrain in their international relations from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations. -- Charter of the United Nations, Article 2.4 Jörn Nettingsmeier Kurfürstenstr 49, 45138 Essen, Germany http://spunk.dnsalias.org (my server) http://www.linuxdj.com/audio/lad/ (Linux Audio Developers) ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
On Monday 16 June 2003 09.51, Joern Nettingsmeier wrote:
[...]
Quoted 4 lines
Quoted 4 lines
What you get is plain <control, value> tuples, and that's all there is to it. (Well, it's all I *want* anyway, as I don't want to do stuff that's outside the MIDI spec...)
Quoted 8 lines
Quoted 2 lines
Here's some code, which isn't heavily tested, but does seem to do the job:
either i have not understood the semantics of nrpm, or nrpm events are not detected as such. when i move a slider, i always get four separate normal controller events: two on 98/99 encoding the control number as a 14bit value, and two on 6 and 38 encoding the data.
Well, that does sound like your ALSA setup isn't parsing those CCs, but just letting them through. I don't get the raw CCs at all here, but I do get the decoded NRPNs. (IIRC, that's why I threw the NRPN code in in the first place. I have CC parsing code for it as well, but those CCs never arrived.)
I've been using an Audigy card with various ALSA drivers from 0.9.0rc6 and up, but I'm not entirely sure this works with versions before 0.9.3. The ALSA sequencer support in Audiality isn't very old, so it might be that I've only used it with 0.9.3.
Quoted 3 lines
the case
SND_EVENT_NONREGPARAMis never reached.
now one of three things must be broken (in decreasing order of likelihood): me, my wacky peavey controller, or alsa-lib.
I dunno 'bout *you*, but your code makes one suspect. ;-) If the controller actually sends the CCs involved in NRPNs, it *should* work, if ALSA cares to decode it - and this is a generic MIDI thing, so one would assume it's done in some place like alsa-lib, rather than inside drivers. I'm not sure about that, though.
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. | | RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 8 lines · Joern Nettingsmeier
either i have not understood the semantics of nrpm, or nrpm events are not detected as such. when i move a slider, i always get four separate normal controller events: two on 98/99 encoding the control number as a 14bit value, and two on 6 and 38 encoding the data.
the case
SND_EVENT_NONREGPARAMis never reached.
now one of three things must be broken (in decreasing order of likelihood): me, my wacky peavey controller, or alsa-lib.
The driver code and alsa-lib does not handle nonreg and reg parameters. They simply pass them like standard controllers, so the four event sequence is ok. I think that we may add this piece code to seq_midi_event.c.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
On Monday 16 June 2003 10.29, Jaroslav Kysela wrote:
[...]
Quoted 4 lines
The driver code and alsa-lib does not handle nonreg and reg parameters. They simply pass them like standard controllers, so the four event sequence is ok. I think that we may add this piece code to
seq_midi_event.c.
This is weird... Wonder what's actually happening in there. :-)
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. | | RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 8 lines · David Olofson
On Monday 16 June 2003 10.29, Jaroslav Kysela wrote:
[...]Quoted 4 lines
The driver code and alsa-lib does not handle nonreg and reg parameters. They simply pass them like standard controllers, so the four event sequence is ok. I think that we may add this piece code to
seq_midi_event.c.This is weird... Wonder what's actually happening in there. :-)
If you have USB midi device, I think that we had driver versions which works directly with sequencer events so probably it is the case.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 9 lines · Jaroslav Kysela
Quoted 8 lines · David Olofson
On Monday 16 June 2003 10.29, Jaroslav Kysela wrote:
[...]Quoted 4 lines
The driver code and alsa-lib does not handle nonreg and reg parameters. They simply pass them like standard controllers, so the four event sequence is ok. I think that we may add this piece code to
seq_midi_event.c.
Quoted 5 lines
Quoted 1 line
This is weird... Wonder what's actually happening in there. :-)
If you have USB midi device, I think that we had driver versions which works directly with sequencer events so probably it is the case.
Nope, I don't have any USB MIDI devices; only an SB Audigy Platinum... (And a Layla20, for which there is no MIDI support yet.)
I'm going to have another look at it. There has to be some explanation why it mysteriously Just Works(TM).
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. | | RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
On Monday 16 June 2003 11.10, David Olofson wrote:
[...]
Quoted 2 lines
I'm going to have another look at it. There has to be some explanation why it mysteriously Just Works(TM).
Yep, the explanation is most probably that I was using ALSA rawmidi input... :-) With the ALSA sequencer "driver" I get the CC events and no NRPNs or anything.
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. | | RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 5 lines · Jaroslav Kysela
Quoted 2 lines · Joern Nettingsmeier
either i have not understood the semantics of nrpm, or nrpm events are not detected as such. when i move a slider, i always get four separate normal controller events: two on 98/99 encoding the control number as a 14bit value, and two on 6 and 38 encoding the data.
Quoted 8 lines
Quoted 2 lines
the case
SND_EVENT_NONREGPARAMis never reached.
now one of three things must be broken (in decreasing order of likelihood): me, my wacky peavey controller, or alsa-lib.The driver code and alsa-lib does not handle nonreg and reg parameters.
They simply pass them like standard controllers, so the four event sequence is ok. I think that we may add this piece code toseq_midi_event.c.Jaroslav
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it.
do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.
best,
jörn
Signature · 21 lines
All Members shall refrain in their international relations from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations. -- Charter of the United Nations, Article 2.4 Jörn Nettingsmeier Kurfürstenstr 49, 45138 Essen, Germany http://spunk.dnsalias.org (my server) http://www.linuxdj.com/audio/lad/ (Linux Audio Developers) ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 18 lines · Joern Nettingsmeier
Quoted 17 lines · Jaroslav Kysela
Quoted 8 lines · Joern Nettingsmeier
either i have not understood the semantics of nrpm, or nrpm events are not detected as such. when i move a slider, i always get four separate normal controller events: two on 98/99 encoding the control number as a 14bit value, and two on 6 and 38 encoding the data.
the case
SND_EVENT_NONREGPARAMis never reached.
now one of three things must be broken (in decreasing order of likelihood): me, my wacky peavey controller, or alsa-lib.The driver code and alsa-lib does not handle nonreg and reg parameters. They simply pass them like standard controllers, so the four event sequence is ok. I think that we may add this piece code to
seq_midi_event.c.
Quoted 7 lines
Quoted 1 line
Jaroslav
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it. do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.
I am working on it right now, but it requires to add new states to sequencer event encoder...
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 8 lines · Jaroslav Kysela
Quoted 5 lines
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it. do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.
I am working on it right now, but it requires to add new states to sequencer event encoder...
Initial code is in CVS. It is not tested, but hopefully, without any major bugs. It seems that we have also missing encoding of CONTROL14 events.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 2 lines
Initial code is in CVS. It is not tested, but hopefully, without any major bugs. It seems that we have also missing encoding of CONTROL14 events.
14 bit MIDI is almost impossible to parse in any sane fashion. if you read the spec carefully, you'll see that it requires a timeout be attached to each and every CC message received. why? because of the order they transmit the low and high nibbles. the basic idea embodied in the protocol is to send the low byte and then the high byte if *and only if* necessary. thus, when you receive the low byte, you don't know if the high byte is coming or not.
its clearly designed for hardware rather than software implementations, and its really, really ugly.
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 8 lines · Jaroslav Kysela
Quoted 7 lines · Jaroslav Kysela
Quoted 6 lines
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it. do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.
Quoted 5 lines
Quoted 2 lines
I am working on it right now, but it requires to add new states to sequencer event encoder...
Initial code is in CVS. It is not tested, but hopefully, without any major bugs.
Does this code remove the (N)RPN related CC events, or does it just decode (N)RNPs in parallel? The latter will cause (N)RPNs to be doubled in apps that understand both "raw" CCs and cooked (N)RPNs. (Like Audiality as of a few minutes back.)
I think filtering the CCs out is the Right Thing(TM) to do when (N)RPNs are actually used, but if some apps want to use the full range of "raw" CCs, that won't work. Those apps won't see the (N)RPN related CCs, and they won't look for (NON)REGPARAM events. (Even if they did, they wouldn't be able to extract the underlying CCs reliably.)
Maybe ALSA shouldn't mess with (N)RPNs at all, unless applications ask for it?
Quoted 2 lines
It seems that we have also missing encoding of
CONTROL14 events.
Now *that's* fun stuff... *heh*
BTW, I think "applications might know better" applies here too. Apps that want to bother with 14 bit controls might do stuff that's intimately tied to the control intperpolation/smoothing. The only "correct" way to implement 14 bit CCs seems to involve a timeout, which will add latency to all CCs that can be 14 bit, and apps that want to be smart about it to reduce latency may not be able to do so without getting at the raw CCs.
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. | | RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 27 lines · David Olofson
Quoted 8 lines · Jaroslav Kysela
Quoted 7 lines · Jaroslav Kysela
Quoted 6 lines
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it. do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.
Quoted 5 lines
Quoted 2 lines
I am working on it right now, but it requires to add new states to sequencer event encoder...
Initial code is in CVS. It is not tested, but hopefully, without any major bugs.
Does this code remove the (N)RPN related CC events, or does it just decode (N)RNPs in parallel? The latter will cause (N)RPNs to be doubled in apps that understand both "raw" CCs and cooked (N)RPNs. (Like Audiality as of a few minutes back.)
I think filtering the CCs out is the Right Thing(TM) to do when (N)RPNs are actually used, but if some apps want to use the full range of "raw" CCs, that won't work. Those apps won't see the (N)RPN related CCs, and they won't look for (NON)REGPARAM events. (Even if they did, they wouldn't be able to extract the underlying CCs reliably.)
Quoted 2 lines
Maybe ALSA shouldn't mess with (N)RPNs at all, unless applications ask for it?
I think that events are clear, so all applications using direct sequencer API should handle them as well.
Quoted 5 lines
Quoted 2 lines
It seems that we have also missing encoding of
CONTROL14 events.Now *that's* fun stuff... *heh*
Quoted 7 lines
BTW, I think "applications might know better" applies here too. Apps that want to bother with 14 bit controls might do stuff that's intimately tied to the control intperpolation/smoothing. The only "correct" way to implement 14 bit CCs seems to involve a timeout, which will add latency to all CCs that can be 14 bit, and apps that want to be smart about it to reduce latency may not be able to do so without getting at the raw CCs.
Yes, Paul mentioned it and I see that the standard is not so good. Does it affect also XRPN encoding (some LSB or MSB bytes might be missing)? In that case the current implementation is broken.
I see some ways to do things correctly:
1) duplicate events (deliver both raw CONTROLLER + combo events)
2) do not generate combo events at all, use only raw controller events
3) introduce timeouts (I hate this idea)
I will stay with 2) for the moment (so nothing will change).
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 3 lines
Yes, Paul mentioned it and I see that the standard is not so good. Does it affect also XRPN encoding (some LSB or MSB bytes might be missing)? In that case the current implementation is broken.
now that i think about it, i recall what i realized was the MIDI spec's intent: you are supposed to be stateful when parsing 14 bit controls. you always know the most recent MSnibble, and so when the new LSnibble comes in, you just merge them. libmidi++ does this already. the problem remains that you can't provide "atomic" access to the controller state: if it changes so that both the high and low nibbles need to be transmitted, an application can end up seeing it in the intermediate, undefined state where the LSnibble has been updated, but not the MSnibble.
hence the timeouts needed to be able to delay updating the LSnibble so that you can be sure no pending change to the MSnibble is coming.
--p
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
On Monday 16 June 2003 18.03, Jaroslav Kysela wrote:
[...]
Quoted 5 lines
Quoted 2 lines
Maybe ALSA shouldn't mess with (N)RPNs at all, unless applications ask for it?
I think that events are clear, so all applications using direct sequencer API should handle them as well.
Yes, that's a point... However, if ALSA intercepts the underlying CCs for (N)RPNs, there is no way to use them as normal CCs by just looking at the (NON)REGPARAM events. For examyple, if something sends only CC 98 ("NRPN fine"), the app will get nothing.
[...14 bit controls...]
Quoted 3 lines
Yes, Paul mentioned it and I see that the standard is not so good. Does it affect also XRPN encoding (some LSB or MSB bytes might be missing)?
Well, the "Data Entry" CC pair *is* one of those ugly 14 bit things.
Quoted 1 line
In that case the current implementation is broken.
That goes for Audiality too. Dunno if I care, because I can't really do anything useful with 7 bit values anyway. I just store the other CC values and act on CC 38 ("Data Entry (fine)").
I think people would expect ALSA to do the Right Thing, though - whatever that is....
Quoted 6 lines
I see some ways to do things correctly:
1) duplicate events (deliver both raw CONTROLLER + combo events)
2) do not generate combo events at all, use only raw controller events
3) introduce timeouts (I hate this idea)
Unless I'm mistaken about the (N)RPNs being normal 14 bit controllers,
1) would require timeouts as well - although it would allow applications to bypass them by grabbing the raw CCs instead.
Either way, if that timeout isn't part of the spec, there is no way of implementing this correcly. You can't wait forever, and it's not safe to set it short and let occasional wrong values through. :-/
Quoted 1 line
I will stay with 2) for the moment (so nothing will change).
Ok.
BTW, what about apps sending (NON)REGPARAM events? Is it possible, and if so, are they converted into CCs even when passed directly to other ALSA sequencer apps?
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. | | RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
Quoted 10 lines · Jaroslav Kysela
Quoted 4 lines · Jaroslav Kysela
Quoted 2 lines
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it.
do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.I am working on it right now, but it requires to add new states to sequencer event encoder...
Initial code is in CVS. It is not tested, but hopefully, without any major bugs. It seems that we have also missing encoding of CONTROL14 events.
rats. sourceforge is soooo broken. it's a great service they have provided, but if they go belly up, most of open-source development grinds to a halt... :(
whatever. thanks very much, jaroslav!
i'm checking it out as i type (the umpteenth attempt succeeded at last)...
regards,
jörn
Signature · 22 lines
All Members shall refrain in their international relations from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations. -- Charter of the United Nations, Article 2.4 Jörn Nettingsmeier Kurfürstenstr 49, 45138 Essen, Germany http://spunk.dnsalias.org (my server) http://www.linuxdj.com/audio/lad/ (Linux Audio Developers) ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 6 lines · Jaroslav Kysela
Quoted 3 lines · Jaroslav Kysela
Quoted 2 lines
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it.
do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.
Quoted 6 lines
Quoted 1 line
I am working on it right now, but it requires to add new states to sequencer event encoder...
Initial code is in CVS. It is not tested, but hopefully, without any major bugs. It seems that we have also missing encoding of CONTROL14 events.
Jaroslav
shit. anon cvs seems to be lagging behind. do you happen to have a patch ? otherwise it will probably be another day before i can test it...
Signature · 22 lines
All Members shall refrain in their international relations from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations. -- Charter of the United Nations, Article 2.4 Jörn Nettingsmeier Kurfürstenstr 49, 45138 Essen, Germany http://spunk.dnsalias.org (my server) http://www.linuxdj.com/audio/lad/ (Linux Audio Developers) ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 14 lines · Joern Nettingsmeier
Quoted 13 lines · Jaroslav Kysela
Quoted 8 lines · Jaroslav Kysela
Quoted 5 lines
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it. do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.
I am working on it right now, but it requires to add new states to sequencer event encoder...
Quoted 7 lines
Quoted 4 lines
Initial code is in CVS. It is not tested, but hopefully, without any major bugs. It seems that we have also missing encoding of CONTROL14 events.
Jaroslav
shit. anon cvs seems to be lagging behind. do you happen to have a patch ? otherwise it will probably be another day before i can test it...
Attached.
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
Index: seq_midi_event.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/seq_midi_event.h,v retrieving revision 1.4
retrieving revision 1.5
seq_midi_event.h +5 -4
@@ -30,13 +30,14 @@/* midi status */ struct snd_midi_event_t { -int qlen;/* queue length */ -int read;/* chars read */ -int type;/* current event type */ +int qlen;/* queue length */ +int read;/* chars read */ +int type;/* current event type */ unsigned char lastcmd;unsigned char nostat; +unsigned char xreg_hit;int bufsize; -unsigned char *buf;/* input buffer */ +unsigned char *buf;/* input buffer */ spinlock_t lock; };
Index: seq_midi_event.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/seq/seq_midi_event.c,v retrieving revision 1.10
retrieving revision 1.11
seq_midi_event.c +127 -7
223 lines not on this page · raw message
Quoted 15 lines · Jaroslav Kysela
Quoted 12 lines · Joern Nettingsmeier
Quoted 10 lines · Jaroslav Kysela
Quoted 4 lines · Jaroslav Kysela
Quoted 2 lines
thanks for the clarification. i'd be glad to help, but i doubt i could meet the coding standards of alsa-lib. at least i could help test it.
do you or anyone of the alsa core developers have plans to tackle this some time soon ? i'd love to be able to use my controller box for the LinuxTag presentations in mid-July.I am working on it right now, but it requires to add new states to sequencer event encoder...
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Initial code is in CVS. It is not tested, but hopefully, without any major bugs. It seems that we have also missing encoding of CONTROL14 events.
Jaroslav
shit. anon cvs seems to be lagging behind. do you happen to have a patch ? otherwise it will probably be another day before i can test it...
Attached.
hi jaroslav !
i've read and tried to understand the patch... now since this is against alsa-core, how am i supposed to test it, since it's not in alsa-lib ?
i read some files in alsa-lib, and it seems a lot of code in alsa-core is duplicated there. i played around a bit, but i couldn't figure out how to make the new alsa-core functions available to alsa-lib...
is there some (dirty) way to use the alsa-core api directly for testing?
(sorry for such elementary questions, but i'm really green and alsa is a frightening thing for beginners :)
btw, current (anonymous) cvs is broken, there are a number of warnings related to alsa-kernel/core/seq/seq_midi_event.c and the nrpn functions...
best regards,
jörn
Signature · 22 lines
All Members shall refrain in their international relations from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations. -- Charter of the United Nations, Article 2.4 Jörn Nettingsmeier Kurfürstenstr 49, 45138 Essen, Germany http://spunk.dnsalias.org (my server) http://www.linuxdj.com/audio/lad/ (Linux Audio Developers) ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
Quoted 10 lines
hello alsa gurus !
i have bought a peavey studiomix midi controller on ebay, and it sends NRPN messages (non-registered parameter numbers). when i move a slider, it sends the slider number encoded in 98 and 99 and the value in the DATA ENTRY controllers 6 and 38. i would like to map these to ordinary midi controllers, or better yet, get nrpn support into ardour.
how do i get nrpn controller values from the alsa sequencer without having to parse the individual events and put them together by hand ?
ardour doesn't use the sequencer.
and i don't consider the nrpn messages any different from any other controller. from libmidi++'s persepective, there are 127 controller ID's, each with a value. whatever standard mapping they may have to gain, pan, or nrpn is completely ignored.
14 bit value support is almost impossible to provide: the midi spec is just ridiculous for that.
--p
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 8 lines · Paul Davis
Quoted 5 lines
hello alsa gurus !
i have bought a peavey studiomix midi controller on ebay, and it sends NRPN messages (non-registered parameter numbers). when i move a slider, it sends the slider number encoded in 98 and 99 and the value in the DATA ENTRY controllers 6 and 38. i would like to map these to ordinary midi controllers, or better yet, get nrpn support into ardour.
how do i get nrpn controller values from the alsa sequencer without having to parse the individual events and put them together by hand ?
ardour doesn't use the sequencer.
i'm aware of that. i was planning to use a virmidi card, which ardour could grab raw, and to write a little mapper that maps nrpns to arbitrary normal controllers. this can be patched between the midi in port and the virtual device with aconnect. (if i have understood virmidi devices correctly.)
Quoted 4 lines
and i don't consider the nrpn messages any different from any other controller. from libmidi++'s persepective, there are 127 controller ID's, each with a value. whatever standard mapping they may have to gain, pan, or nrpn is completely ignored.
understood. the problem is, it won't work automatically with nrpn-based controllers, since two nrpn "events" and two data entry events (yes, both 14 bit) must be grouped together and transmogrified into one [controller,value] tuple.
Quoted 2 lines
14 bit value support is almost impossible to provide: the midi spec is just ridiculous for that.
i wouldn't have dared to say so for lack of experience, but i had this creeping feeling it might be the case. :)
maybe i should consider dropping 14-bit resolution (the crappy faders on the peavey hardly manage 127 distinct positions) and just use the MSB part of the 14bit controller. ardour does perform lowpass filtering of controller values, right ?
Signature · 21 lines
All Members shall refrain in their international relations from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations. -- Charter of the United Nations, Article 2.4 Jörn Nettingsmeier Kurfürstenstr 49, 45138 Essen, Germany http://spunk.dnsalias.org (my server) http://www.linuxdj.com/audio/lad/ (Linux Audio Developers) ------------------------------------------------------- This SF.NET email is sponsored by: eBay Great deals on office technology -- on eBay now! Click here: http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Quoted 4 lines
maybe i should consider dropping 14-bit resolution (the crappy faders on the peavey hardly manage 127 distinct positions) and just use the MSB part of the 14bit controller. ardour does perform lowpass filtering of controller values, right ?
it doesn't filter the values directly, but the various things that use them do interpolate. for example, if you bind to a gain fader, there is no smoothing of the changes in terms of what is sent to the core, but the core will interpolate to avoid zipper noise. this is so that the interpolation is centralized, and we don't have to care where gain changes (for example) come from.
when bound to plugin parameters, its really up to the plugin author. most of steve's set interpolate where necessary.
--p
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5