Thank you, the problem is solved now. It was caused by my
misunderstanding of Ardour MIDI channel controls - I thought that all
channels are off by default and then by clicking a channel button you
turn it on. Of course, I got it backwards: all channels are on by
default, which is indicated by the green color of their buttons, so I
actually turned off the channel which I wanted to use.