jtackaberry / reaticulate

An articulation management system for REAPER
Other
100 stars 45 forks source link

Corrupted serialized configuration after setting custom background color #143

Closed seventh-sam closed 2 years ago

seventh-sam commented 2 years ago

I entered #383838 in the custom background color field, then restarted REAPER (as instructed). For some reason - though I've changed this field in the past - Reaticulate.main wouldn't start. Instead, I recieved this error message:

reaticulate error

I managed to isolate the problem to something strange going on with the reaper-exstate.ini file. After I had entered the hex code, the reaticulate section of the reaper-exstate.ini file looked like this:

[reaticulate]
main_command_id=55820
config={cc_feedback_articulations_cc=0,h=982.0,bg="#383838",autostart=0,cc_feedback_active=true,track_selection_follows_midi_editor=true,art_insert_at_selected_notes=true,pinned=false,y=165.0,x=24.0,w=311.0,track_selection_follows_fx_focus=false,debug_level=40,cc_feedback_bus=1,dockstate=769.0,cc_feedback_articulations=1.0,last_dockstate=769.0,cc_feedback_device=-1,borderless=false,scale=1.0}  
\nColors
\n#383838",autostart=0,cc_feedback_active=true,track_selection_follows_midi_editor=true,art_insert_at_selected_notes=true,pinned=false,y=165.0,x=24.0,w=311.0,track_selection_follows_fx_focus=false,debug_level=40,cc_feedback_bus=1,dockstate=769.0,cc_feedback_articulations=1.0,last_dockstate=769.0,cc_feedback_device=-1,borderless=false,scale=1.0}
\n#383838",autostart=0,cc_feedback_active=true,track_selection_follows_midi_editor=true,art_insert_at_selected_notes=true,pinned=false,y=165.0,x=24.0,w=311.0,track_selection_follows_fx_focus=false,debug_level=40,cc_feedback_bus=1,dockstate=769.0,cc_feedback_articulations=1.0,last_dockstate=769.0,cc_feedback_device=-1,borderless=false,scale=1.0}
\n#383838",autostart=0,cc_feedback_active=true,track_selection_follows_midi_editor=true,art_insert_at_selected_notes=true,pinned=false,y=165.0,x=24.0,w=311.0,track_selection_follows_fx_focus=false,debug_level=40,cc_feedback_bus=1,dockstate=769.0,cc_feedback_articulations=1.0,last_dockstate=769.0,cc_feedback_device=-1,borderless=false,scale=1.0}  
\nCol  
\nColors
\n#383838ors
\n#383838",autostart=0,cc_feedback_active=true,track_selection_follows_midi_editor=true,art_insert_at_selected_notes=true,pinned=false,y=165.0,x=24.0,w=311.0,track_selection_follows_fx_focus=false,debug_level=40,cc_feedback_bus=1,dockstate=769.0,cc_feedback_articulations=1.0,last_dockstate=769.0,cc_feedback_device=-1,borderless=false,scale=1.0}  
\nColors
\n#383838",autostart=0,cc_feedback_active=true,track_selection_follows_midi_editor=true,art_insert_at_selected_notes=true,pinned=false,y=165.0,x=24.0,w=311.0,track_selection_follows_fx_focus=false,debug_level=40,cc_feedback_bus=1,dockstate=769.0,cc_feedback_articulations=1.0,last_dockstate=769.0,cc_feedback_device=-1,borderless=false,scale=1.0}
factory_bank_size=127796

I backed everything up, reset to factory defaults, copy-pasted my back-ups, but deleted that chunk of the .ini file. Reaticulate worked, and - for comparison - I checked the new reaper-extstate.ini file. It contained the following:

[reaticulate]
main_command_id=55905
config={w=640,cc_feedback_bus=1,art_insert_at_selected_notes=true,x=12.0,scale=1.0,borderless=false,cc_feedback_articulations_cc=0,cc_feedback_active=true,cc_feedback_articulations=1,dockstate=769.0,autostart=0,h=480,bg="#383838",y=179.0,debug_level=40,pinned=false,last_dockstate=769.0,track_selection_follows_midi_editor=true,track_selection_follows_fx_focus=false,cc_feedback_device=-1}
factory_bank_size=127796

I'm not versed enough in all this to know why this happened, but hopefully reporting it will help catch a bug! Cheers.

EDIT: Running on Win10, Reaper 6.37

jtackaberry commented 2 years ago

Wow, that's a weird one.

Did a bit of experimentation, and it looks like REAPER itself gets extremely confused when you pass data that contains a newline to reaper.SetExtState().

That said, it's not clear how a newline even got in the config data, so this is probably a legit Reaticulate bug.

However in my local tree (that will become 0.5) I've changed how configuration is serialized, moving to JSON as the approach in 0.4.x is unsafe (in the sense that it evaluates the config blob as code). So to the extent that there's a bug in there, I suspect it will no longer be applicable in the next release.

I'll leave this issue open to track though and will close it once 0.5 is out the door.

Thanks!

jtackaberry commented 2 years ago

Fixed in 0.5.0-pre1. Syntactically invalid colors are interpreted as black.