Reverse aftertouch signal

Hello

Is there a way to reverse the input from a midi-device to a plugin? Currently I am trying to set my aftertouch to some controls in the SetBfree plugin, but I would like it to reverse the signal, such that the value of the control is increased rather than decreased when I apply the aftertouch.

My assignments:
Midi filter:
MAP KP#0:127 => CC#102
setBfree>upper/silence
drawbars 1: DB16 is set to 8 (maximum) and assigned to CC#102
When I apply aftertouch it decreses towards 0. I want it to be set at 0 and increase towards 8.

Gear:
Zynthian V5 with raspberryPi 4
Seaboard Rise 2

This can be done for normal CC values with the MIDI plugin, “MIDI Scale CC Value” with settings:

  • Filter Channel: Any
  • Parameter (min): 0
  • Parameter (max): 127
  • Parameter Mode: Include Range
  • Value Scale: -1
  • Value Offset: -1
  • Value Mode: Truncate Overflow

This only operates on CC. Aftertouch and channel pressure are different commands.

2 Likes

That was quick! Thank you for the reply!

Edit: The solution above works, but all the controls on the plugin must be reversed - lower values become higher values - even if the particular control is not assigned any CC input. I am as mentioned not a competent user, so I may have overlooked something. If I have, please enlighten me.

The following was my initial response, which contains wrong conclusions:
I know it is a reasonable expectation, that one diving into something like the Zynthian with a Seaboard controller might know enough to follow your instructions. Alas, I am probably not such a one. So if there is something an overeager and incompetent person would overlook, you may assume I would need it pointed out. I have found the settings, and have played around with all of them, but none of them seem to reverse the cc values. By coincidence I also found the “Invert CC value” preset, but having tried multiple to apply it, it seems to do nothing.

1 Like

I probably should have asked right away, but if I were to apply it directly to aftertouch, how would I go about it? Also - and this may be a tall order and perhaps deserve a post in itself - how do I assign aftertouch directly to some control and force it to be “per note”.

Example:
Leslie level: -10db
Leslie rate: 50%
Leslie level -10db:20db > Aftertouch (KP) 60:127
Leslie rate 50%:150% > Aftertouch (KP) 80:127
Playing D chord with the individual signals being D (KP:~30), F# (KP:~30), A (KP:~90), I want the Leslie level and rate to rise only for the A note.

Are there any of the plugins/instruments that ship with that functionality out-of-the-box? What would I need to make it happen myself with some of the other plugins? I am willing to spend a good amount of time writing code/pseudo-code if necessary, provided there is some reasonable documentation/tutorials.

I’m trying to understand it.
On the setBfree side, it is clear to me what needs to be set.
However, it is not clear at the beginning, on the Roli Seaboard Rise 2 side. Since it is an MPE controller, it will spit out a lot of midi data.
In the case of the described chord breakdown, it is not the usual Aftertouch but PolyAftertouch. Basic information about the difference is here Summary of MIDI 1.0 Messages – MIDI.org

KP is KeyPressure?

I used “KP” because KP is the abbreviation for PolyAftertouch in the Midi filter rules under Midi options on the web UI, but it be understood as key pressure.

At the moment the Rise 2 is set to “MPE”, which sends out PolyAftertouch. It has two other profile-options: Multi-channel or Single channel, both of which allows for manually setting whether it sends Channel Pressure or PolyAftertouch as the Key pressure output.

Thank you for that link, it helped clarify the difference between channel pressure and PolyAftertouch. As far as I understand, my request necessitates using PolyAftertouch as output, but is there any way of assigning PolyAftertouch in the way I wish to?

So we already know what is at the beginning and what is at the end. Now just describe the algorithm how to connect it and choose the appropriate tools.

Procedure for Leslie level -10db:20db > Aftertouch (KP) 60:127
Input: PolyTouch on different notes.
Processing on CC#102 linear dependencies:
Is the PolyTouch(KP) for any note below 60? Yes set to 0
Is PolyTouch(KP) for any note above 60? Yes set to value = (127/67)*((KP)-60)
CC#102 mapping to Leslie level

Procedure for Leslie rate 50%:150% > Aftertouch (KP) 80:127
Input: PolyTouch on different notes.
Processing on CC#103 linear dependencies:
Is the PolyTouch(KP) for any note below 80? Yes set to 0
Is PolyTouch(KP) for any note above 80? Yes set to value = (127/47)*((KP)-80)
CC#103 mapping to Leslie rate

We are looking for a plugin that can take PolyTouch and remap it to CC and has the option not to notice the value of the note.

Or two plugins:

  • The first will convert PolyTouch to CC regardless of what note it is.
  • The second plugin remaps the values

Since I’m not an expert on midi lv2 plugins, I can’t just recommend something off the top of my head. I am afraid that most of them are one-sidedly focused and the biggest problem will be with the conversion of PolyTouch to CC. I would use other external equipment that I have on the table, but that would not solve your problem.

Maybe someone else can advise on this.

1 Like

So I looked at the list of pugins available in Zynthian, you can find it in the webconf menu SOFTWARE / LV - Plugins MIDI Tools.
And the winner is Moony ~hp/moony.lv2 - Realtime Lua as programmable glue in LV2 - open-music-kontrollers git
By the way, this one wins over me too.

Here it would like a user guide on how to use this plugin.

And I found a LUA script that converts PolyTouch to Note on. It should probably be modified to send CC.

I think we are either closing in on something wonderful or going in completely opposite directions. I fear the latter is the case, if I understand the following you wrote correctly:

We are looking for a plugin that can take PolyTouch and remap it to CC and has the option not to notice the value of the note.

I would put it exactly opposite. To take my example again:
Playing D chord with the individual signals being D (KP:~30), F# (KP:~30), A (KP:~90) I want the Leslie level and rate to rise only for the A note. That is to say, it should remember the values for the particular notes, and only apply Leslie level/rate for the A note, which is the only note above the cut-off values.
To my understanding, that is how Paftertouch usually works, but with the current workaround of converting the values to CC#102, it losses the relationship to the notes and simply attempts to apply all the different Paftertouch values for all the notes currently pressed or sustained simultanously - which does not sound good.

I just wanted to be sure we were not missing each other before I attempted to fool around with the LUA code…

I totally understand and can imagine that. I just didn’t write it in enough detail.

It should be more correct::
Is the incoming Polytouch value for any note less than or equal to the limit?
YES - discard and do not process further.
NO - Recalculate and forward.

I don’t know if Moony can do it, so don’t send anything to the output. If not, there would have to be a buffer and remember the last value it sent and send it again.

Another problem will be if two notes in the chord are above the liminit. So that it does not oscillate, a value closer to the last sent value should be sent – most likely.

For me, it’s more academic, given that I don’t know LUA and Moony. If I look in the discussion, I don’t know if there is someone who uses it and gives advice.

Or try to solve it via PureData as a user @jtode Midi mapping fcb-1010 note to CC64 - #21 by jtode

I think moony could be the path to follow. I’ve not experience with it, but the atom+control series looks promising.

Regards