Inverting the direction of a continuous controller

Discussion on the SFZ implementation and opcodes available in the ARIA engine.

Moderators: eric_telemaque, davidv

pljones
Posts: 100
Joined: Wed Oct 15, 2014 2:05 pm

Inverting the direction of a continuous controller

Postby pljones » Sun Nov 20, 2016 7:32 am

The subject says it all, really.

MIDI Continuous Controller #4 is foot controller. It can either be used as "Fully closed = 0" or "Fully closed = 127" - i.e. opposite senses for the pedal at the MIDI device sending the message.

I'd like to be able to have a "curve" (presumably) to map the incoming CC value through to get the value to use when triggering the regions in the mapping. So, if the CC4 value is zero and my switch says "that means closed", I trigger a closed sound but if my switch says "that means open", I trigger an open sound.

Now... I could do this by triggering both regions and muting one with my switch, that's easy enough. But it's a continuous value and I have up to sixteen regions playing and muting each other already, so having that lot playing and trying to get it all working would be ... tricky.

You can do things like "amplitude_curvecc=200" and then define an amplitude tracking curve. I guess what I'm after is "cc{num}_curvecc={num}" so that I can define a tracking curve -- but it's got to act before region selection, like I say... so I don't know if it's at all feasible.

(Alternatively, I use CC4 to drive some "fake" controller in either of two directions and select region based on the "fake" value -- but it still needs to be something I can use with lo_XX/hi_XX opcodes and I don't think any let me do that, either.)

kinwie
Posts: 48
Joined: Fri Jun 12, 2015 4:53 pm

Re: Inverting the direction of a continuous controller

Postby kinwie » Mon Nov 21, 2016 3:36 pm

I remember the AD's Plastique and Kingpin e-kit hihat are inverted, 0=fully open, 127=fully closed.
I was using macros to define the cc number and the cc value, like this :

#define $PD_6_LO 0 #define $PD_6_HI 21
#define $PD_5_LO 22 #define $PD_5_HI 43
#define $PD_4_LO 44 #define $PD_4_HI 65
#define $PD_3_LO 66 #define $PD_3_HI 87
#define $PD_2_LO 88 #define $PD_2_HI 109
#define $PD_1_LO 110 #define $PD_1_HI 127

So if one want to inverted it to usual 0=closed, 127=open, then just change the $PD_# order to :

#define $PD_1_LO 0 #define $PD_1_HI 21
#define $PD_2_LO 22 #define $PD_2_HI 43
#define $PD_3_LO 44 #define $PD_3_HI 65
#define $PD_4_LO 66 #define $PD_4_HI 87
#define $PD_5_LO 88 #define $PD_5_HI 109
#define $PD_6_LO 110 #define $PD_6_HI 127

Dunno if that's a good idea but it works for me though...

pljones
Posts: 100
Joined: Wed Oct 15, 2014 2:05 pm

Re: Inverting the direction of a continuous controller

Postby pljones » Mon Nov 21, 2016 5:26 pm

Yeah, I did the same in my Tape Series 2 mappings. It works if you've a single set of opennesses to work with -- unfortunately, I've something like nine, and they differ on whether it's a left or right hand hit on the same articulation and on which articulation it is. So I really need something more fundamental. I'm also looking into getting the CC4 value inverted before it even gets to Sforzando, of course (but that would make the mapping depend on external solutions, so not ideal).


Return to “SFZ Programming”

Who is online

Users browsing this forum: No registered users and 1 guest