This is something possible using Scripter, somewhat easily.
Likely also possible within the Environement, but that could be more complicated to implement in such a way to avoid stuck note issues...
Perhaps there could be other method to achieve your intended end result.
LogicX 10.5.1 ( & 9.1.8),MainStage3.4.4
MBPro 17", Core2Duo, 8G, OSX 10.12.6
MacPro, Xeon 6Cores, 64GB, OSX 10.15.5
ULN8, MOTU MIDI TP-AV, C4, MCU Pro, KorgNano, Novation SLMkII
AAS, NI, Celemony, Spectrasonics, Korg, etc...
PC, iPad3(V-Control & LogicRemote), AtariST(Notator SL), Several vintage gear