Can a double-click execute a script?


(Dunks) #1

Can a double-click on a block in pattern matrix execute a script?
If so how?


(KMaki) #2

I’m fairly sure this is a “No”. :(

The closest equivalent would probably be to insert the script in the pattern matrix context menu. Doing so, you could execute it by right click and choose the script from context menu.


(Dunks) #3

What about a workaround could this work:

I noticed on the monitor tool that when you click on a track it executes the script or part of it. So I can get something to happen when selecting a track.

So…

Can a variable be set to true for 1 second?
if selected track is selected track, if variable is true, if focus is pattern matrix execute a function.

Could this work?


(KMaki) #4

I think the monitor tool is set up so that whenever the selected track changes, a part of script is executed. So it’s not tied to actual clicking, just the selecting, or even further - selecting something other than the currently selected track.

I think I know where you are going, but as the API does not allow for actual “mouse-sensing” or “click registering” or something(?), it gets very hard to accomplish what you need.

So, to explain further - suppose the currently selected track is track 1. You click on track 2. You have set up a notifier to run a function when the “selected_track_observable” changes. This function will set a variable true (and start a timer which is also possible to do!). So upon clicking, the timer starts - now you need to register the second click - but now there is no way to sense the second click, because the selected track does not change.

Another road bump for your idea is that you cannot directly fish out the currently focused GUI area through API. The obviously reliable but as obviously limited way to do this is to tie functions into keyboard shortcuts, which in turn can be appointed to GUI areas.

Expanding on your idea (and on the topic of the thread), you could probably quite easily sense double clicking of a button in a tool GUI. I think this could be made to work with the timer method.


#5

Not sure what exactly you are trying to do but multi-volumes does stuff based on what block (or range of blocks) is selected in the pattern matrix. It uses an app-idle notifier to constantly monitor which blocks are selected and if the selection changes it updates what track volumes should be controlled.

You could perhaps have something like do something on a track when it is selected in pattern matrix AND something else… like drawing a range in the pattern editor on the same track.


(Dunks) #6

Drats, oh well. Thanks for the info.


(vV) #7

Yes this can indeed be done with a timer. You can also simulate combinations like ctrl-click, shift-click and alt-click (or whatever key-mouseclick combination for all i care!) to make a script GUI respond differently on the same button.I already using this technique in Epic Arpeggiator. (it still is nowhere near Renoise 3.0 ready, sorry)