Translate cc to note number

In the past I was sending NRPN messages - nothing different than some midi messages in series - to change scenes.
No plugin required.

With scripting that could be done very easy.
In the scriptlet just send out this messages to the midi out block connected to your Allen & Heath

huuh nrpn as well for softknobs?there is no straight midi to control bpm on the delays one has to assign the tapping to a softknob wich then can be adressed with midi

And with the on BeatChanged callback you can set the bpm of your Allen by pressing the global play.
Now when Allen would support LINK :wink:

true!
bome has good presets on their box but i am trying,the older i get, to avoid as much gear as possible…with gp already no daw open, no vocal effect box anymore (xlr to the box out of the box to the mixer…from now on it is inserted within dante ergo wireless mic, keys all dante, mallet cat - through gp-dante…got rid of 10 xlr`s ,specially in small clubs very praktisch

1 Like

So use a GigScript to convert incoming events before passing them on to the system

yes indeed,
still working on it, ill make a little video when i am done.

1 Like

I would try one of these scripts, but I’m afraid I’ll end up operating someone else’s mixer. :smirk: Got Bome to work (with ‘another’ host mind you. Couldn’t get the plugin to see midi in gp4 even though I set the midi input source as bome’s Italicized output as recommended. I’m sure it will work, just haven’t seen my problem yet.) but it sure would be nice to have something within the host as opposed to another external program. I may try and wade through the scripts shown although they may as well be a foreign language. I jus need a note on, any velocity, for 3 values each of 2 cc’s.

The widget thing may work for the allen&heath guy, but not for me I don’t think. To recap, my controller has two sets of three buttons. each button in a set sends a value (127, 64 and 0) of a specific cc (79 in one case, 80 in the other. Don’t remember if the cc#s are fixed or user definable in the keyboard.) each value has to be mapped to B0, Bb0 and A0 on the midi channel of the corresponding manual (in my case 8, upper and 9, lower.) I don’t think the widgets can respond to only one value of cc (eg CC79 127). Or am I wrong?

Again, in my case I have to convert a specific value of a cc message into a note number on a specific midi channel.

hi victord here` s the allen and heath guy :smiley: my name is dave… the script should work for you as it only converts the cc s to note, it is not allen and heath specific, the midi setting in that driver is set to midi through - just passing the data…
i would definetely try it
not shure about the midi chanel number, but you could create/duplicate the midi outputs one just for midi channel 8 and the other one for channel 9.
what kind of midi controller do you have?

Hi A&H Dave! :blush: what I need is something that converts specific values of a cc (specifically, two different cc#s with values 0, 64 and 127). I don’t see how the script recognizes different values of the same cc number. Or am I wrong?

in my case (boss gt1000) i send all midi cc 64 and changed the midi channel
(cc 64 0-127 midich1/cc 64 0-127 midich2/cc 64 0-127 midich3 e.t.c.)
and it works thats why i asked for the type of your pedal, mostly they are customisable.

Alright… it became kind of a personal challenge to solve this problem. :crazy_face:
I hope i understood everythig right…
You have on your keyboard two rows of three buttons each (lower/upper presets).
The lower row sends on CH8 and CC#79 where the buttons 1-3 each send out the CC values 0, 64, 127.
The upper row sends the same CC values but on CH9 and CC#80
Those three CC values shall be coverted to the note values A0, Bb0, B0 which then can be sent to a connected organ plugin.
If there are diffrences to that, you might have to edit the code and change the values to your needs.
But if all is right, you can just use this gig file, but you probably have to exchange the organ plugn since i don’t own the VB3 plugin (i used the Blue3)…
The GPscript behind it has become a bit extensive, but it should work… and i put many comments into it, so you might see what the code is doing.


var
btn_u1, btn_u2, btn_u3, btn_l1, btn_l2, btn_l3 : Widget //used button's names

u_last, l_last : Integer // buffer variables to store the last pressed button

//Declaration of widget arrays for upper and lower preset buttons
u_buttons : Widget Array = [btn_u1, btn_u2, btn_u3]
l_buttons : Widget Array = [btn_l1, btn_l2, btn_l3]

//MIDI IN and OUT ports
CX3_midi_in : MidiInBlock

//##################### Values for UPPER preset keys ###################
u_ch : Integer = 9 //UPPER MIDI channel
//CC# see ControlChange Callback
u_ccval1 : Integer = 0 //cc value 1
u_ccval2 : Integer = 64 //cc value 2
u_ccval3 : Integer = 127 //cc value 3
u_note1 : Integer = A0 //note 1
u_note2 : Integer = Bb0 //note 2
u_note3 : Integer = B0 //note 3
u_ccvals : Integer Array = [u_ccval1, u_ccval2, u_ccval3]
u_notes : Integer Array = [u_note1, u_note2, u_note3]

//##################### Values for LOWER preset keys ###################
l_ch : Integer = 8 //LOWER MIDI channel
//CC# see ControlChange Callback
l_ccval1 : Integer = 0 //cc value 1
l_ccval2 : Integer = 64 //cc value 2
l_ccval3 : Integer = 127 //cc value 3
l_note1 : Integer = A0 //note 1
l_note2 : Integer = Bb0 //note 2
l_note3 : Integer = B0 //note 3
l_ccvals : Integer Array = [l_ccval1, l_ccval2, l_ccval3]
l_notes : Integer Array = [l_note1, l_note2, l_note3]

Initialization //Called on first run
var i : Integer
//Check & store state of buttons - if all off, assume the first as "ON"
    For i = 0; i < Size(u_buttons); i = i + 1 Do
        If GetWidgetValue(u_buttons[i]) == 1.0 Then
            u_last = i
        Else
            u_last = 0
        End
    End

    For i = 0; i < Size(l_buttons); i = i + 1 Do
        If GetWidgetValue(l_buttons[i]) == 1.0 Then
            l_last = i
        Else
            l_last = 0
        End
    End

End

//Called when a CC message is received at some MidiIn block
//The CC numbers must be within the specified range
On ControlChangeEvent(m : ControlChangeMessage) Matching [79..80] from CX3_midi_in

    //Check for CC# and mark button row 0 will be LOWER, 1 will be UPPER
    If GetCCNumber(m) == 79 Then //react to LOWER buttons
        Select
            GetCCValue(m) == l_ccval1 do 
                SetWidgetValue (l_buttons[0],1.0)
            GetCCValue(m) == l_ccval2 do 
                SetWidgetValue (l_buttons[1],1.0)
            GetCCValue(m) == l_ccval3 do 
                SetWidgetValue (l_buttons[2],1.0)
        End
    Elsif GetCCNumber(m) == 80 Then //react to UPPER buttons
        Select
            GetCCValue(m) == u_ccval1 do 
                SetWidgetValue (u_buttons[0],1.0)
            GetCCValue(m) == u_ccval2 do 
                SetWidgetValue (u_buttons[1],1.0)
            GetCCValue(m) == u_ccval3 do 
                SetWidgetValue (u_buttons[2],1.0)
        End
    End
End



// Called when any of several widgets changed -> This is the block for UPPER presets
On WidgetValueChanged(w : Widget, index: integer, newValue : double) from btn_u1, btn_u2, btn_u3
    var i : integer
    if newValue == 1.0 and index <> u_last then
        // Set 
        Print("UPPER Notevalue sent: " + u_notes[index])
        SendNow(CX3_midi_in, MakeNoteMessageEx(u_notes[index], 100, u_ch))
        SendLater(CX3_midi_in, MakeNoteMessageEx(u_notes[index], 0, u_ch),200)
        // Deselect other buttons
        for i = 0; i < Size(u_buttons); i = i + 1 do
            if i <> index then SetWidgetValue(u_buttons[i],0.0) end
        end
    u_last = index
    end

    If newValue == 0.0 and index == u_last Then
        SetWidgetValue(u_buttons[index],1.0)
    End
End

// Called when any of several widgets changed -> This is the block for LOWER presets
On WidgetValueChanged(w : Widget, index: integer, newValue : double) from btn_l1, btn_l2, btn_l3
    var i : integer
    if newValue == 1.0 and index <> l_last then
        // Set 
        Print("LOWER Notevalue sent: " + l_notes[index])
        SendNow(CX3_midi_in, MakeNoteMessageEx(l_notes[index], 100, l_ch))
        SendLater(CX3_midi_in, MakeNoteMessageEx(l_notes[index], 0, l_ch),200)
        // Deselect other buttons
        for i = 0; i < Size(l_buttons); i = i + 1 do
            if i <> index then SetWidgetValue(l_buttons[i],0.0) end
        end
    l_last = index
    end

    If newValue == 0.0 and index == l_last Then
        SetWidgetValue(l_buttons[index],1.0)
    End
End

CX3-Buttons.gig (90.0 KB)

Good luck with that, and if you have questions: Don’t hesitate to ask! :beers:
Cheers!
Erik

2 Likes

Awesome and thank you! Your description reversed the cc numbers upper<>lower but otherwise correct. I’ll give this a go tonight and thanks again! (Vb3 is no longer supported btw as it isn’t 64 bit. VB3 II is. The reason I use it is that it is the only organ sim I’ve found that allows me to map both sets of cx3 drawbars to the upper manual Hey, maybe a script could…Kidding!)

It’s a Korg cx3 organ. I don’t remember if the cc numbers can be changed for this function (I think not) but definitely the values output can not be.

So that works great. Thanks again! Used it in two gig spaces. Odd thing, the second time, I was trying to set my midi in block script handle to match, and it wouldn’t let me capitalize. I would enter the upper case letters but when I saved they would change to lower case. I got around it by going through the script and changing all the instances of the handle. Odd. Also, I see that it has to run as a Rackspace script and not at gig level. Don’t think it matters but also odd.

1 Like

The “gig level” script does not know about widgets since widgets can only show up in individual rackspaces while the gig level script is always there.

Indeed the gig level script knows very little about rackspaces other than you might have changed from one rackspace to another (say).

Ah. Well that explains it then. Thanks!

I’m using the simple CC2note.gpfav linked earlier in this thread. Works great, but need to have 4 conversions within the script i.e. one for each of 4 static CCs coming in from a foot pedal.
The notes vary according to keyswitches I select for the sample set.
In other words, I want to insert a single scriptlet prior to a sampler instance, where the scriplet converts CCs 20, 21, 22, 23 to 4 notes (one per CC) which vary per sampler instance. I can manually set the notes in each scriplet block/instance. I’m just not sure how to repeat the variables/sliders within a single scriptlet.
Can someone show me how?

thanks

sean

OK, what scriptlet are you using?
Or do you need a new?

CC Value = 127 means => Note On ?
CC Value = 0 means => Note Off ?