Plugin to limit MIDI CC max value?

All your LV2 and LADSPA goodness and more.

Moderators: MattKingUSA, khz

Post Reply
User avatar
RyanH
Established Member
Posts: 248
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 169 times
Been thanked: 45 times

Plugin to limit MIDI CC max value?

Post by RyanH »

Does anyone know how I can use a plugin (in Carla) to limit the maximum and minimum MIDI CC values coming in from a device?

I have a controller connected to an effect where I don't want the CC going into the effect to exceed 124. I don't have options in the controller or in the effect to limit the values. I tried using the MIDI Scale CC Value plugin, and I can get it to alter the sound, but not in any way that I understand. Simply setting min to 0 and max to 124 doesn't lower the maximum value passing through to the effect.

Any ideas? I want to be able to do it outside of a DAW, in Carla.

User avatar
LAM
Established Member
Posts: 1011
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 145 times
Been thanked: 361 times

Re: Plugin to limit MIDI CC max value?

Post by LAM »

Indeed, it seems that Parameter (Min) and (Max) are not affecting the output, however a quick and dirty solution could be giving a Value Offset of -3.

in mix, nobody can hear your screen

User avatar
bluebell
Established Member
Posts: 2053
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 155 times
Been thanked: 174 times

Re: Plugin to limit MIDI CC max value?

Post by bluebell »

RyanH wrote: Mon Sep 02, 2024 9:08 am

Does anyone know how I can use a plugin (in Carla) to limit the maximum and minimum MIDI CC values coming in from a device?

I have a controller connected to an effect where I don't want the CC going into the effect to exceed 124. I don't have options in the controller or in the effect to limit the values. I tried using the MIDI Scale CC Value plugin, and I can get it to alter the sound, but not in any way that I understand. Simply setting min to 0 and max to 124 doesn't lower the maximum value passing through to the effect.

Any ideas? I want to be able to do it outside of a DAW, in Carla.

x42 midifilter collection, "scale CC value"

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

User avatar
RyanH
Established Member
Posts: 248
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 169 times
Been thanked: 45 times

Re: Plugin to limit MIDI CC max value?

Post by RyanH »

bluebell wrote: Mon Sep 02, 2024 10:40 am

x42 midifilter collection, "scale CC value"

That's the one I'm trying to use but can't seem to get it to do what I want. Maybe I just don't understand how it works.

User avatar
RyanH
Established Member
Posts: 248
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 169 times
Been thanked: 45 times

Re: Plugin to limit MIDI CC max value?

Post by RyanH »

LAM wrote: Mon Sep 02, 2024 10:15 am

Indeed, it seems that Parameter (Min) and (Max) are not affecting the output, however a quick and dirty solution could be giving a Value Offset of -3.

Ok, I'm glad it's not just me. I'm thinking that maybe min and max simply sets which range you want to work on and the other options apply to that range. I did mess around with the other options, including the offset, but didn't really know what I was doing. I plan to give it another go in the next few days - I'll report back here if I get it figured out.

User avatar
bluebell
Established Member
Posts: 2053
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 155 times
Been thanked: 174 times

Re: Plugin to limit MIDI CC max value?

Post by bluebell »

RyanH wrote: Sat Sep 07, 2024 6:54 am
bluebell wrote: Mon Sep 02, 2024 10:40 am

x42 midifilter collection, "scale CC value"

That's the one I'm trying to use but can't seem to get it to do what I want. Maybe I just don't understand how it works.

Parameter (Min) and (Max) is NOT the data but the controller number. 0-127 means all controllers, 1 means CC1 = modwheel.

Example:
I managed to scale modwheel data from [0..127] to [0..100] by using a Value Scale of 100/127 = 0.787

Bildschirmfoto_2024-09-07_10-22-01.png
Bildschirmfoto_2024-09-07_10-22-01.png (30.55 KiB) Viewed 717 times
Last edited by bluebell on Sat Sep 07, 2024 11:00 am, edited 1 time in total.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

User avatar
Impostor
Established Member
Posts: 1570
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 157 times
Been thanked: 430 times

Re: Plugin to limit MIDI CC max value?

Post by Impostor »

RyanH wrote: Sat Sep 07, 2024 6:59 am
LAM wrote: Mon Sep 02, 2024 10:15 am

Indeed, it seems that Parameter (Min) and (Max) are not affecting the output, however a quick and dirty solution could be giving a Value Offset of -3.

Ok, I'm glad it's not just me. I'm thinking that maybe min and max simply sets which range you want to work on and the other options apply to that range. I did mess around with the other options, including the offset, but didn't really know what I was doing. I plan to give it another go in the next few days - I'll report back here if I get it figured out.

With "parameter range" you can select which cc you want the scale to apply to.
So if you want to scale "reverb send" (CC91) only, set min and max param values to "91", "mode" to "include", then set the desired scale and offset for the reverb send values. In your case I'd use "0.97" for the scale, with offset "0".

If you just want to map values >124 to 124, you can chain two instances in series:
Set the first to offset by 3, the second by -3, with "value mode" set to "clamp" in both. (and keep both value scales at 1.0)

User avatar
RyanH
Established Member
Posts: 248
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 169 times
Been thanked: 45 times

Re: Plugin to limit MIDI CC max value?

Post by RyanH »

bluebell wrote: Sat Sep 07, 2024 8:22 am

That's the one I'm trying to use but can't seem to get it to do what I want. Maybe I just don't understand how it works.

Parameter (Min) and (Max) is NOT the data but the controller number. 0-127 means all controllers, 1 means CC1 = modwheel.

Example:
I managed to scale modwheel data from [0..127] to [0..100] by using a Value Scale of 100/127 = 0.787

Bildschirmfoto_2024-09-07_10-22-01.png
[/quote]

Hey nice, it works! Thanks!

Edit: It does work, but for the particular setup I'm using (Carla), it's not quite right. I used @Impostor 's second method to get around the problem Thanks for helping me understand the plugin!

Last edited by RyanH on Mon Sep 09, 2024 7:41 am, edited 1 time in total.
User avatar
RyanH
Established Member
Posts: 248
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 169 times
Been thanked: 45 times

Re: Plugin to limit MIDI CC max value?

Post by RyanH »

Impostor wrote: Sat Sep 07, 2024 9:07 am

With "parameter range" you can select which cc you want the scale to apply to.
So if you want to scale "reverb send" (CC91) only, set min and max param values to "91", "mode" to "include", then set the desired scale and offset for the reverb send values. In your case I'd use "0.97" for the scale, with offset "0".

If you just want to map values >124 to 124, you can chain two instances in series:
Set the first to offset by 3, the second by -3, with "value mode" set to "clamp" in both. (and keep both value scales at 1.0)

I used the first method, which I thought did the trick until I realized that, unlike in QTractor, which is what @bluebell was using, in Carla there is limited granularity with what values can be entered for the parameters. I encountered this problem before but it didn't matter much until now. The sliders jump values, sometimes pretty hugely, and manually setting the value only allows one digit after the decimal. For example, I can use the slider to select .9999999, or set the value to .9 or 1, but nothing finer. So basically I'm stuck with my max MIDI at either 114, which is too low, or the original 127.

However, your second option solved my problem - I don't understand it why the two instances with opposite values, but it works! Thanks!

User avatar
Impostor
Established Member
Posts: 1570
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 157 times
Been thanked: 430 times

Re: Plugin to limit MIDI CC max value?

Post by Impostor »

RyanH wrote: Mon Sep 09, 2024 7:06 am

However, your second option solved my problem - I don't understand it why the two instances with opposite values, but it works! Thanks!

With clamping values to [0-127], all offset values which would become >127 will map to 127 instead. So with offset of 3, 124, 125, 126 and 127 will all map to 127 with the first plugin. Then with offset of -3 in the second plugin, these all become 124. All other values n will simply map to their original n=n+3-3.

User avatar
RyanH
Established Member
Posts: 248
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 169 times
Been thanked: 45 times

Re: Plugin to limit MIDI CC max value?

Post by RyanH »

Impostor wrote: Mon Sep 09, 2024 3:26 pm
RyanH wrote: Mon Sep 09, 2024 7:06 am

However, your second option solved my problem - I don't understand it why the two instances with opposite values, but it works! Thanks!

With clamping values to [0-127], all offset values which would become >127 will map to 127 instead. So with offset of 3, 124, 125, 126 and 127 will all map to 127 with the first plugin. Then with offset of -3 in the second plugin, these all become 124. All other values n will simply map to their original n=n+3-3.

Wow, what a strange way to go about it. If you hadn't shown me this, I would definitely never have figured it out. Thanks!

Post Reply