Understanding switching octaves in songs

I got a Launchkey 37 for Christmas. I’ve been looking to see whether I can reasonably use (just) it for gigs, since I’ve been playing keys on fewer songs lately. After going through a few songs, it seems clear that I’ll need to do quite a bit of octave shifting in songs. I’ve tried connecting a switch widget to the MIDI In Transpose, but have been having a hard time understanding how to use scaling to change an octave and wanted to verify what I think I know. Through trial and error, it seems that min scale of 50 and max scale of 54.8 gives me the initial key and one octave up when I switch. As best as I can come up with, transpose goes from -127 to 127 (I see that when I press the widget when I don’t change the scaling), so the 50 makes sense that it would be in the middle - 0. And that would mean the 54.8 is 54.8% up the range of -127 to 127, which would be about 12.19 and I guess gets rounded or truncated to 12?

And after all this, I guess I should ask if this is the best way to be shifting octaves in songs/variations.

Perhaps this is a solution for you:

Confirming you want the octave shift bound to a variation? So not something you want to control live from the keyboard?

Yeah, I think that’s what I’m looking for. But I don’t understand all of the script.

The sendnow parts make sense to me, I think. When you press a note, the sendnow does a noteon adjusted by the octave based on the widget value. That would have no effect on anything already playing. That seems straightforward. When a note is released, it loops to do a sendnow of a noteoff for that note in all octaves, presumably because you don’t know what octave the corresponding noteon was for because the widget value might have changed between the noteon and noteoff? Is that right?

But I don’t understand the MultiChannelNoteTracker part at all. I don’t see much info in the documentation on it. Since there’s a MCNT_GetSpecificNoteOnCount, it appears that there can be multiple noteons for the same note and channel. Otherwise you wouldn’t need the x loop. And I’m not sure what a channel really refers so. Here it is index, which is octave shifted up by 5. So it is looping through not only all the octaves, but also through the number of noteons for that particular note and octave? Since there’s a MCNT call for each sendnow, it appears that it may be a way of making sure you keep something consistent, but I don’t really get what the something is.

Right, I think. I 'm under the impression that I would need it bound to a variation if I wanted to shift octaves between song parts.

No. Only the NoteOffs that are necessary are sent.
In the “MultiChannelNoteTracker_GotNoteOn” the held notes are stored for all 9 possible positions of the octave parameter. In the x loop, only as many NoteOffs of the corresponding note (transposed) are sent that are also held.