Open lazlooose opened 4 years ago
this update actually broke the transport buttons somehow and the jog wheel now causes a traceback, so I messed something up:
20-04-25 08:45:58,402 procontrolosc DEBUG thread_c24_client _desk_to_daw 1288 {'CmdClass': 'C24vpot', 'TrackNumber': 28, 'addresses': ['/', 'track', '/', 'c24vpot', '/', '29'], 'ChildB$
2020-04-25 08:45:58,403 procontrolosc WARNING thread_c24_client get_track 327 No track exists with index 28
2020-04-25 08:45:58,403 procontrolosc ERROR thread_c24_client _manage_c24_client 1420 C24 client Uncaught exception
Traceback (most recent call last):
File "/home/pi/ReaControl24/procontrolosc.py", line 1413, in _manage_c24_client
self._desk_to_daw(datarecv)
File "/home/pi/ReaControl24/procontrolosc.py", line 1307, in _desk_to_daw
inst = getattr(track or self.desk, cmd_class.lower())
AttributeError: 'ProCdesk' object has no attribute 'c24vpot'
Yeah basically we both changed the same thing so now someone has to do a line by line merge to see what goes forward.
It's fine and quite normal really, during the process I'll be able to pick out the problem you may have created.
great! that makes sense I thought I had done something weird.
hmmm, looking into this problem it would seem that the way I implemented this if any buttons that are not tracks have an action tag only those buttons work, no osc msg gets sent for the others. if you remove all action tags and have toggle tags then only buttons with toggle tags get sent.
so somehow it is filtering for only those tags as soon as it finds one.
So, if you look at the deafault reaper.osc file you should see this comment re actions:
# Example: ACTION i/action t/action/@
# The device sends /action 40757 or /action/40757 to trigger the REAPER action
# "split items at edit cursor". See the REAPER actions window for a complete list
# of action command ID numbers.
So in theory we should not need to do anything other than put action/nnnn as the address against the button you want to map the action to.
Perhaps all we need is a tweak to remove the start of the address if 'action' appears anywhere. yes, the way you implemented it there probably won't work as the command parser doesn't know about the token 'action'. We could add it though, like I did for 'set mode'.
act = parsed_cmd.get('Action')
if (act and val == 1):
osc_msg = OSC.OSCMessage()
osc_msg.setAddress("/action")
osc_msg.append(act)
self.osc_client_send(osc_msg)
this is what I did that works. however the way it was working was, like I said, only sending buttons with action tags and ignoring the rest. but reaper is happy to respond to an osc message like this by executing the action id number, and you can enter the action ids in the map. I believe the output of this is /action 'cmdid'
where 'cmdid', 'act' in the code above, is an integer (The first of the two options in the default file)
it was inserted in class ProCOSC Session , def _desk_to_daw(self, c_databytes): lines 1316 - 1322 on my commit.
Hey. I have now added some code to trial action support (DEV_OtherDevices) All it does is allow any OSC address containing token 'action' and it will reduce the OSC address to '/action' This will probably need the OSC file to have something like:
i/action
Also toggle button code is all in place now so this is probably the best route, using the LEARN facility in reaper.
Something is weird that I can't figure out with this why it says can<t automatically merge, somehow our forks have some kind of conflict, any way I wanted to share the changes I made in the commit labeled: https://github.com/phunkyg/ReaControl24/commit/fc857f1581860c9211fd519073e2fbe0874ec140 -- add toggle and action support since it did get those features working for me.
this was a completly brute force attempt and I may have changed stuff I shouldn't have but I did the changes based on the release version of control24osc.py and the commits from DEV_Mapping that I mentioned on the issue for toggle support, have a look, cheers.