Re: Can midish match on CC number and parameters and then change the outgoing CC number?

From: midish _at_ oijn <midish_at_oijn.uk>
Date: Fri, 21 Nov 2025 16:00:19 +0000
On 2025-11-18 22:17, Alexandre Ratchov wrote:
> On Mon, Nov 17, 2025 at 10:36:23PM +0000, midish _at_ oijn wrote:
...
>> 
>> What I have been looking for is a MIDI router/filter/transform utility 
>> that
>> would go between the physical ALSA MIDI ports and the software input 
>> MIDI
>> ports and be able to sort out the mess.
>> 
...
> 
> This is not possible without changing the code.
> 
> There are two options:
> 
> - extend "fmap", but this requires many changes as a lot of code
>   assumes notes are mapped to notes. Not easy.
> 
> - create a new filter rule dedicated to buttons to handle such cases,
>   maybe it could handle scenario 1 as well.
> 
> diff --git a/ev.c b/ev.c
> index eb43aa7..f7626a0 100644
> --- a/ev.c
> +++ b/ev.c
> _at_@ -63,7 +63,7 @@ struct evinfo evinfo[EV_NUMCMD] =
>  	},
>  	{ "xctl", "xctl",
>  	  EV_HAS_DEV | EV_HAS_CH,
> -	  2, 1,
> +	  2, 2,
>  	  0, EV_MAXCOARSE, 0, EV_MAXFINE,
>  	  NULL
>  	},
> _at_@ -93,7 +93,7 @@ struct evinfo evinfo[EV_NUMCMD] =
>  	},
>  	{ "ctl", "ctl",
>  	  EV_HAS_DEV | EV_HAS_CH,
> -	  2, 1,
> +	  2, 2,
>  	  0, EV_MAXCOARSE, 0, EV_MAXCOARSE,
>  	  NULL
>  	},

Thanks for your detailed reply and example.

I haven't touched any real programming since University (decades ago) - 
so I cannot promise anything as it may be above my ability. The neurons 
have since gone grey.

However, I do have a real itch - so will have a go and see what knots I 
tie myself in.

I think creating a new filter rule run before fmap might be something I 
can try as it would have a limited impact to other parts of the 
codebase.  It would then also allow fmap to do its magic without 
reinventing the wheel.  Some of the other MIDI filters like 
(https://github.com/x42/midimap.lv2/blob/master/cfg/doc.cfg) have a raw 
MIDI byte match and rewrite which may be within my ability.

If the result is anything neat - I'll report back.
Received on Fri Nov 21 2025 - 17:00:19 CET

This archive was generated by hypermail 2.3.0 : Sat Nov 22 2025 - 01:30:01 CET