On Tue, Mar 15, 2016 at 9:26 PM, Yassin Philip <philcm@gnu.org> wrote:
Hello!

Some LV2 plugins seem to now the MIDI channel # of the track on which they are inserted, and some don't.

There is no such concept in LV2.

The idea of a track "having" "a" MIDI channel is entirely host specific and isn't covered by any part of LV2 that i'm aware of.
 
If I had to guess I'd say that nobody knows, only some plugins can receive data from several MIDI channels, and some only work with one, so they never mistake ; Am I right?

As with all other plugin APIs, yes.
 

Last year I made a GUI around so-404 to learn about LV2 (and C, C++, DSP code, etc. :)) ; And it has the same problem, just sightly different:
Worse: It starts numbering at 0, so if it's inserted on a track w/ MIDI #4, you have to select 3
Better: It remembers said channel # on session reload (ZynAddSubFx doesn't. Yoshimi does)

MIDI channel numbering has always been a problem. Ardour has an option so that the user can decide if MIDI channels start at zero or 1.
 

Can somebody point me towards the light? I'd like my plugin to only listen to one channel: The one of the host track it's inserted into.

Given that there is no such thing, there's nothing you can do inside a plugin to make it do this precise thing. You could make it listen to just one MIDI channel, but that's not the same thing.