Re: [LAD] Fwd: Re: How can a LV2 plugin know on what host's MIDI Channel it's on?

2014-10-17 Thread Ralf Mardorf
I agree with Len.

On Thu, 2014-10-16 at 12:29 -0700, Len Ovens wrote:
 That control could have an option to accept all channels too so that
 the host could do filtering.

JFTR accept all channels, as if they were one channel is named omni
mode :).


___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


[LAD] Fwd: Re: How can a LV2 plugin know on what host's MIDI Channel it's on?

2014-10-16 Thread Phil CM




 Forwarded Message 
Subject: 	Re: [LAD] How can a LV2 plugin know on what host's MIDI 
Channel it's on?

Date:   Thu, 16 Oct 2014 13:16:38 -0400
From:   Paul Davis p...@linuxaudiosystems.com
To: Phil CM phi...@gnu.org





On Thu, Oct 16, 2014 at 12:59 PM, Phil CM phi...@gnu.org 
mailto:phi...@gnu.org wrote:



   On 16/10/14 17:15, Paul Davis wrote:



On Thu, Oct 16, 2014 at 11:42 AM, Phil CM phi...@gnu.org
mailto:phi...@gnu.org wrote:

Is there a way to retrieve this info (and others, ideally)
from the host, thus removing the need for a midi channel
control port?


I think you're confused. The host doesn't put a plugin on a MIDI
channel. It delivers MIDI events to the plugin which might be on
any channel.

   But in Qtractor I do have a choice of what MIDI channel (or
   any/omni, for that matter) I'm sending signal to on that particular
   track... So, no? No way for the plugin to retrieve any info from the
   host (I mean specific info, not just instantiated, port enum et al)
   I guess it makes sense since it would introduce a breaking point.
   Sorry, I don't really speak english, I'm just persuaded I do.


That is a host-specific issue. The part of the LV2 specification and the 
existing extensions don't describe that functionality. As far as the 
plugin is concerned, it just gets MIDI events. If the host is filtering 
some of them, the plugin has no way to determine this programmatically.




___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Fwd: Re: How can a LV2 plugin know on what host's MIDI Channel it's on?

2014-10-16 Thread Phil CM


On 16/10/14 18:19, Phil CM wrote:




 Forwarded Message 
Subject: 	Re: [LAD] How can a LV2 plugin know on what host's MIDI 
Channel it's on?

Date:   Thu, 16 Oct 2014 13:16:38 -0400
From:   Paul Davis p...@linuxaudiosystems.com
To: Phil CM phi...@gnu.org





On Thu, Oct 16, 2014 at 12:59 PM, Phil CM phi...@gnu.org 
mailto:phi...@gnu.org wrote:



On 16/10/14 17:15, Paul Davis wrote:



On Thu, Oct 16, 2014 at 11:42 AM, Phil CM phi...@gnu.org
mailto:phi...@gnu.org wrote:

Is there a way to retrieve this info (and others, ideally)
from the host, thus removing the need for a midi channel
control port?


I think you're confused. The host doesn't put a plugin on a MIDI
channel. It delivers MIDI events to the plugin which might be on
any channel.

But in Qtractor I do have a choice of what MIDI channel (or
any/omni, for that matter) I'm sending signal to on that
particular track... So, no? No way for the plugin to retrieve any
info from the host (I mean specific info, not just instantiated,
port enum et al) I guess it makes sense since it would introduce a
breaking point. Sorry, I don't really speak english, I'm just
persuaded I do.


That is a host-specific issue. The part of the LV2 specification and 
the existing extensions don't describe that functionality. As far as 
the plugin is concerned, it just gets MIDI events. If the host is 
filtering some of them, the plugin has no way to determine this 
programmatically.


Wow, not even the very channel it's broadcasting on in readable? Does 
that mean that I *have* to implement a MIDI channel selection in my 
synth? There is no way to go around this?


--Phil
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Fwd: Re: How can a LV2 plugin know on what host's MIDI Channel it's on?

2014-10-16 Thread Paul Davis
On Thu, Oct 16, 2014 at 1:44 PM, Phil CM phi...@gnu.org wrote:


 I think you're confused. The host doesn't put a plugin on a MIDI channel.
 It delivers MIDI events to the plugin which might be on any channel.

   But in Qtractor I do have a choice of what MIDI channel (or any/omni,
 for that matter) I'm sending signal to on that particular track... So, no?
 No way for the plugin to retrieve any info from the host (I mean specific
 info, not just instantiated, port enum et al) I guess it makes sense since
 it would introduce a breaking point. Sorry, I don't really speak english,
 I'm just persuaded I do.


  That is a host-specific issue. The part of the LV2 specification and the
 existing extensions don't describe that functionality. As far as the plugin
 is concerned, it just gets MIDI events. If the host is filtering some of
 them, the plugin has no way to determine this programmatically.


 Wow, not even the very channel it's broadcasting on in readable? Does that
 mean that I *have* to implement a MIDI channel selection in my synth?
 There is no way to go around this?


Again, you're confused. The host doesn't control what the plugin does when
it generates MIDI. The host *might* filter messages from the plugin based
on some user preference, or it might not. It sounds as if you need an LV2
extension so that the host and plugin can exchange information on preferred
MIDI channel(s). This isn't part of the core LV2 specification. The host is
free to deliver zero, one or more MIDI channels to the plugin; the plugin
can use any channels it wants, but the host might throw away zero, one or
more channels.

Sounds as if you want the host to allow the user to select a channel and
then have the plugin know about that choice. Not part LV2, and also not
part of AudioUnits or the VST plugin APIs.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Fwd: Re: How can a LV2 plugin know on what host's MIDI Channel it's on?

2014-10-16 Thread Len Ovens

On Thu, 16 Oct 2014, Phil CM wrote:


Wow, not even the very channel it's broadcasting on in readable? Does that
mean that I have to implement a MIDI channel selection in my synth? There is
no way to go around this?


A plugin, should take care of it's own midi channel setting/sensing in the 
same way as a HW synth does, or a hw control surface. Sensing channel is a 
one step deal and requires almost no cpu cycles (it is always the first 
byte of a midi event which has to be tested anyway). It would be normal 
for any one function to use the same channel for input/output unless 
the plugin itself was doing filtering or other MIDI manipulating. It would 
be possible to ignore channel and use any channel, but the host should not 
be expected to do filtering for the plugin.


Dispite what people have said about the posibility of the host filtering 
the MIDI channels, it is unlikey unless the user chooses that in which 
case they are also responsible for making sure your plugin is also set to 
the right channel. So you do need to expose a control to do that. That 
control could have an option to accept all channels too so that the host 
could do filtering.


Note I have written only one MIDI application so far. I do need to finish 
it and it is not a plugin, but standalone.




--
Len Ovens
www.ovenwerks.net

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev