Hi all,
here is my tweaked version of
@Mihkel Zilmer 's Open Stage Control template for implementation with Reaticulate. I am not by a long shot a programmer, but I put some time and effort to understand the ins and outs of what is happening under the hood and arrived to this by brute force approach. So, this is by no means the most elegant coding on my side (I think), but rather a minor adjustment of others's work in order for OSC and Reaticulate to talk the same language. Standing on the shoulders of giants, so to say. Also I haven't tested it extensively, but so far it works great.
So, Reaticulate sends MSB (CC0) and LSB(CC32) messages on the default channel each time you select a track, or trigger an articulation on a track. The values of these messages are the "address" of the reabanks, and each reabank has its unique address. OSC then takes these values and it makes a simple arythmetic operation: (MSB value * 128) + LSB value = patch number. For example: CC0 value: 64, CC32 value: 10 (the address of the Reaticulate factory bank: SCC - V2 Legato Decorative) would be (64 * 128) + 10 = patch 8202 in the OSC template. In other words, CC0 values work as banks, and CC32 as patches. So, CC0 bank holds patches 0 - 127, CC1 patches 128 - 255, CC3 patches 256 - 383.....CC127 patches 16 256 - 16 383... that's a lot of patches!
As soon as a patch number is calculated, OSC calls out that patch and it updates the labels of the buttons in the OSC UI, provided that the patch with the appropriate number exists in the custom module.
You can customize/make your own patches by editing the custom module (Reaticulate+OSC.js) in an appropriate editor. I used Free JavaScript Editor. You could tweak and save the file while using OSC at the same time - it will auto update and reload the custom module automatically.
If you open the .js file and scroll a bit it's pretty self explanatory, and you would pretty much understand what you should do by the example patches that are already filled in. However, here is a detailed explanation:
There is a list with many rows of this:
// 2-5 Instrument name
261:{ 'trackname':'XXX', 'trackarticulations':[]},
So, the text after // doesn't matter, as far as OSC is conserned. It is only info for the user. Even the numbers 2-5 in the example are irrelevant for OSC. They should however inform that this patch has an address od CC0 value:2, CC32 value:5. "Instrument name" should be replaced with the... well, name of the instrument on the selected track.
The number 261 in the example however is the most important here - that's the patch number. It should appear red in the script editor. You should enter every patch number according to the reabank file you use. Here comes the math part: (2*128)+5=261 - as per the example.
(IMPORTANT: When OSC recieves the two CC values and looks for the appropriate patch in the .js file, there must be at least the patch number in order for OSC to acknowledge that this patch exists. Otherwise you would get and error message in the OSC console. So, be aware of this when troubleshooting.)
Track name should be filled in place of the XXX. However, the apostrophe (') sign before and after the text is needed. Example: 'SCC Violins 1'.
Track names appear in the OSC UI and update themselves accordingly (courtesy of
@zig ).
Track articulation names are filled between the [] brackets and should be formatted in this fashion:
['first articulation name', 'second articulation name', ...'last articulation name']
So, every articulation name should sit between two apostrophes (') and (except the last one) precede a comma (,) and a space.
These will auto populate the buttons in the UI in accordance to the selected patch. Also, the number of buttons showed in the UI will change in relation to how many articulation names for the currently sellected patch are filled in the .js file.
The UI (Reaticulate+OSC.json file):
The 54 buttons are assigned to CC127, however this is by personal preference. You can choose to assign them to another CC. However you must assign this same CC to the "Activate articulation by slot number" action. You can do that easily, by adding shortcut in the Reaper action list. You don't have to assign every single button, just one, as they send on the same CC.
First button sends value of 1, second value of 2 ..... last (54th) sends value of 54. They are in tap mode, so there is no off value being sent.
The Enable and Disable buttons are assigned to CC126 and 125 respectvely (again, personal preference) and send values of 127-null. These too need to be assigned to the appropriate actions. (I use OTR, where there is Custom actions "Track enable" and "Track disable", I suppose Reaper has those natively too?) I imagine more elegant way to do this is possible, by using only one CC, but I didn't get to delve into that.
Lastly, you should change the target of the buttons to correspond to your midi port. Mine is midi:send, so in stead of send, fill in the name of your midi port.
For testing purposes there are two patches: 8195 'SCC - V1 Core' and 8202 - 'SCC - V2 Legato Decorative'. These are Reaticulate factory banks, so when you first test the template, you can put them on two tracks and switch between them, in order to see if OSC reacts accordingly. VSTi is not neaded for the test, just see if Reaticulate changes state as expected when you control it from OSC.
I think that's about it. I appologize for my wordiness, I am not a native english speaker. I hope it is intelligibly written. Also, to the more versed in programming stuff: sorry for the unnecessary details, but I wanted to make easier to the others like me, that are not so. I spent many many hours searching, collecting info, tweaking, reading, watching JavaScript tutorials, trying and failing, just to be able to tweak some few lines of code. Nonetheless, it was worth it!
I would like to extend my gratitude to
@tack ,
@Mihkel Zilmer ,
@Manaberry and all the others for their hard work and selfless contribution to the community. Hats off!
Stay safe all and write some marvelous music,
Cheers