Skip to content

Conversation

lazlooose
Copy link

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: fc857f1 -- 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.

update pro control map from patch-1
Dev other devices update from phunky g
not every entry contains a sample from the log but they are sprinkled in here and there.
 Tab sepearated values.  Not all entries contain a MPsend capture but they are here and there for reference.
this was an attempt to merge the additions to control24osc in release that were done after DEV_otherdevices was branched off and are as a result missing from procontrolosc.py. 

The goal was to restore Toggle support for learn commands (this prevents double triggering of the learned commands) and to add direct support for 'Action': 23453 in the procontrolmap.py where 23453 is Reaper's command ID

Disclaimer: I do not know how to code! this was a mere brute force hack attempt involving much copying and pasting to get it working because the double triggering was pissing me off. But, that said it does appear to be working....
@lazlooose lazlooose marked this pull request as ready for review April 25, 2020 07:07
@lazlooose
Copy link
Author

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'

@phunkyg
Copy link
Owner

phunkyg commented Apr 25, 2020

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.

@lazlooose
Copy link
Author

great! that makes sense I thought I had done something weird.

@lazlooose
Copy link
Author

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.

@phunkyg
Copy link
Owner

phunkyg commented Apr 26, 2020

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'.

@lazlooose
Copy link
Author

lazlooose commented Apr 26, 2020

                   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.

@phunkyg phunkyg self-assigned this Jul 4, 2020
phunkyg added a commit that referenced this pull request Jul 4, 2020
@phunkyg
Copy link
Owner

phunkyg commented Jul 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants