helgoboss / helgobox

Helgobox: ReaLearn & Playtime
https://www.helgoboss.org/projects/helgobox
GNU General Public License v3.0
204 stars 20 forks source link

X-Touch / X-Touch Extender color LCDs - "target.track.color" mismatch #681

Closed RattlesnakeLodge closed 2 years ago

RattlesnakeLodge commented 2 years ago

Greetings, sir!

The X-Touch Mackie LCD / X-Touch Mackie XT LCD display types work perfectly! One issue I noticed, however, is with the feedback style variable "target.track.color". It seems to interpret Reaper's track colors, then display something different on the X-Touch / X-Touch Extender's LCD scribble strips. For example...

Reaper's Track Color / X-Touch LCD color...

Black / Blue Red / Magenta Green / Cyan Yellow / White Blue / Blue Magenta / Magenta Cyan / Cyan White / White

It seems only an issue with "target.track.color" (Note: I did not test "target.bookmark.color"). When I choose "pick a color", all of the available color for the X-Touch are correctly displayed. For example, I pick green, and green is correctly displayed on the LCD.

I cannot confirm if this is limited to only X-Touch, or any other devices with color LCD displays. I can only test functionality on X-Touch, X-Touch Extender, and MIDI Fighter Twister.

Please treat this as low priority. It obviously does not affect functionality, just aesthetics. :-)

helgoboss commented 2 years ago

This is a bit tricky because the X-Touch cannot accurately show each color, so a translation function is needed to translate the real color to one of the 8 fixed X-Touch colors. And obviously, this translation process is a bit subjective.

One thing I could try to improve is to define the X-Touch colors more accurately. I can't do this myself because I don't have the device and don't know how they look. You could help with this in theory by having a look at the colors and sending me the RGB color definitions, e.g. 255, 0, 0 for red.

I think the same thing should also happen when using the color picker because the same color translation function is used. Maybe the track colors are shown a bit differently (with some opacity for example), so you get the impression that there's a difference?

RattlesnakeLodge commented 2 years ago

Thanks for the response. For the X-Touch colors, there are only 8 fixed colors available. They are not RGB displays. The colors available are...

Black White Red Green Blue Cyan Magenta Yellow

I did test by coloring the Reaper tracks using the exact RGB color definitions. For example, Red is 255,0,0, Blue is 0,0,255, etc.

Again, using the color picker works correctly, if say, I manually changed the colors on the X-Touch displays. It's only when using "target.track.color" that the colors do not correctly reflect Reaper track colors.

Photo 1 Screenshot 1

In this picture and screenshot, Reaper track labelled "Mic 1" is currently mapped to Ch 4 on the X-Touch. "Mic 1" is colored pure Red (255,0,0). The X-Touch is displaying the color Magenta. In this scenario, Ch 4's LCD row 1 mapping in Realearn is set to use "target.track.color"

Photo 2 Screenshot 2a Screenshot 2b

In this scenario, the same Reaper track ("Mic 1") and X-Touch channel 4 are used. This instance, I used the color picker, and chose the same RGB color that I used on the Reaper track (Red 255,0,0).

The CSI implementation appears to correctly display the colors, approximating the actual Reaper track color palette. Although it's not coded in the same language, there might be something to glean from its code.

https://github.com/GeoffAWaddington/CSICode/blob/main/reaper_csurf_integrator/control_surface_midi_widgets.h (starts on line 942)

Unrelated: I detected something else with the color displays, but will open a new issue to address that.

Vielen Dank!

helgoboss commented 2 years ago

Can you check and post the "Virtual feedback" log please for this "Mic 1" mapping, once with the color picker and once with using the track color? This log should display the RGB color values BEFORE it's translated to sys-ex. You can enable that log by right-clicking the header panel.

helgoboss commented 2 years ago

Ah, wait. This doesn't log enough info. I'll try it myself. According to your info, the only possibility is that somehow the track color is read incorrectly. I'll check.

helgoboss commented 2 years ago

There's indeed something fishy. When I set the track color to pure red (255, 0, 0), it's reported as (239, 0, 0) by ReaLearn. Looking into it.

helgoboss commented 2 years ago

I found the error. It's actually an error in reaper-rs how the result of functions like GetTrackColor() is interpreted.

Good catch!

helgoboss commented 2 years ago

Hah, turns out it was an API doc bug: https://forums.cockos.com/showthread.php?p=2513048

helgoboss commented 2 years ago

So, this was literally just adding a zero ;)

https://github.com/helgoboss/reaper-rs/commit/def858d25b06937a8fa49c0671d1d55a5d491449