Jump to content


Photo

observable "track clicked"


  • Please log in to reply
5 replies to this topic

#1 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2871 posts
  • Gender:Not Telling
  • Interests:Renoise sidechaining, macOS fanboying

Posted 16 August 2015 - 20:41

Hi,

 

I would like to get an event if a track was _clicked_, not only on changed selected track index like by using key shortcuts... Is it possible? Thx!  

 

 

 

EDIT:

 

... Or some workaround:  observable "track_index" -> if (mousebutton.down) ...     Possible?


Edited by Jurek, 16 August 2015 - 21:02.

MacOS 10.12.6 Retina, Renoise 3.1 64 bit   -   Tuned Shortcuts | Multi-Jump From/To Send | Quick Template | Insert Native DSP Menu (incl. deprecated)


#2 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3370 posts
  • Gender:Male

Posted 16 August 2015 - 21:44

I guess you could watch the selection start with a timer, as that changes with every left-click.  I`m not quite sure what you mean by "not only on changed selected track index like by using key shortcuts" though?

-- Read/write access to the selection in the pattern editor.
-- The property is a table with the following members:
--
--  {
--    start_line,     -- Start pattern line index
--    start_track,    -- Start track index
--    start_column,   -- Start column index within start_track   
-- 
--    end_line,       -- End pattern line index
--    end_track,      -- End track index
--    end_column      -- End column index within end_track
--  }
--
-- Line indexes are valid from 1 to renoise.song().patterns[].number_of_lines
--
-- Track indexes are valid from 1 to #renoise.song().tracks
--
-- Column indexes are valid from 1 to 
--   (renoise.song().tracks[].visible_note_columns +
--    renoise.song().tracks[].visible_effect_columns)
--
-- When setting the selection, all members are optional. Combining them in 
-- various different ways will affect how specific the selection is. When 
-- 'selection_in_pattern' returns nil or is set to nil, no selection is present.
--
-- Examples: 
-- renoise.song().selection_in_pattern = {} 
--   --> clear
-- renoise.song().selection_in_pattern = { start_line = 1, end_line = 4 } 
--   --> select line 1 to 4, first to last track
-- renoise.song().selection_in_pattern = 
--   { start_line = 1, start_track = 1, end_line = 4, end_track = 1 } 
--   --> select line 1 to 4, in the first track only 
--
renoise.song().selection_in_pattern
  -> [table of start/end values or nil]

--> Lua For Beginners <--
--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#3 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2871 posts
  • Gender:Not Telling
  • Interests:Renoise sidechaining, macOS fanboying

Posted 16 August 2015 - 22:02

Maybe I did not explained too well... 

 

I want this event / observer :

renoise.song().selected_track, _observable

But only triggered if the track was selected my using left mouse click.

 

So you mean I could watch the selection instead?  Or this:

renoise.song().selection_in_pattern

Does this ^also fire if I set the current_track_index by script?

 

Or this?

renoise.song().selected_pattern_track, _observable

Btw. what is the difference here^ to:

renoise.song().selected_track, _observable

Edited by Jurek, 16 August 2015 - 22:05.

MacOS 10.12.6 Retina, Renoise 3.1 64 bit   -   Tuned Shortcuts | Multi-Jump From/To Send | Quick Template | Insert Native DSP Menu (incl. deprecated)


#4 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5586 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 16 August 2015 - 22:25

I want this event / observer (..)
But only triggered if the track was selected my using left mouse click.

It doesn't exist, nor is it likely to.

We do not provide such low level methods to hook into Renoise's main GUI events. It's only possible to do such things with your own custom tool GUI built using the ViewBuilder widgets.

What exactly do you intend to do when the track has been clicked? Perhaps there's an alternate method or workaround.

 

renoise.song().selected_pattern_track, _observable
Btw. what is the difference here^ to:
renoise.song().selected_track, _observable


renoise.song().selected_track returns a renoise.Track object, which refers to the actual track itself as it exists in the entire song, with its DSP chain, mixer properties, number of visible note columns, and so on.

renoise.song().selected_pattern_track returns a renoise.PatternTrack object, which refers to the pattern data from a single track at a given point in time within the sequencer, with each pattern line, note column data, effect column data, etc.

#5 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2871 posts
  • Gender:Not Telling
  • Interests:Renoise sidechaining, macOS fanboying

Posted 16 August 2015 - 22:45

Thanks.

 

no no, I think I am unable to explain what I am looking for... :wacko:  I wonder about _observables. I tried now renoise.song().selected_pattern_track_observable and renoise.song().selected_track_observable, both seem to fire if I 1. change track_index by lua 2. change track_index by user action...   So I think I will workaround like this:

 

If the script itself changes the track_index, set a boolean before.  In the event handler, only do action, if boolean was not set...

 

Is there a common way to differentiate between a event triggered by user action vs. by script?


Edited by Jurek, 16 August 2015 - 22:47.

MacOS 10.12.6 Retina, Renoise 3.1 64 bit   -   Tuned Shortcuts | Multi-Jump From/To Send | Quick Template | Insert Native DSP Menu (incl. deprecated)


#6 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2871 posts
  • Gender:Not Telling
  • Interests:Renoise sidechaining, macOS fanboying

Posted 17 August 2015 - 00:44

Hey dblue,

 

is there a way to get a event fired if a already selected track will be clicked once again?

 

Please have a look here at version 1.3 (code is quite a mess): http://forum.renoise...-send/?p=334321   

 

You can with it from a source track to any target target, simply by multiple pressing the hotkey "jump to send". The same in the other direction.  Now I am added support for jumps from a send to another send...  In this case, to make it work, you need to click the source send one time. But the situation can arise that the script already selected this send (while stepping thru all targets from a track). For this situation I also need a event if a click happens on this already selected send... Is this in any way possible?


Edited by Jurek, 17 August 2015 - 00:45.

MacOS 10.12.6 Retina, Renoise 3.1 64 bit   -   Tuned Shortcuts | Multi-Jump From/To Send | Quick Template | Insert Native DSP Menu (incl. deprecated)