New Tool (2.7 - 3.1): Set Track Width To Active Columns


(Ledger) #1

On Tools Page:

http://www.renoise.c…-active-columns

v1.34 includes Joule`s revision with major speed improvements


This tool checks either the selected track or all tracks in song for notes in hidden columns or excess empty columns. The number of visible columns is then adjusted so all notes are shown and excess columns hidden.

5466 Set track width fx.PNG

After running the tool only the three active columns will be visible here

4709 SetTracklarge.png

Menu Locations:

  • Pattern Menu : Set Track Width To Active Columns
  • Tools Menu : Ledger`s Scripts : Set Track Width To Active Columns

Shortcut:

(2.6/2.7)
“Set Track Width To Active Columns”

(2.8)
“Set Current Track Width To Active Columns”
“Set All Track Widths To Active Columns”

forum mirror:


Renoise 3.1

6363 ledger.scripts.SetTrackToActiveColumns_V1.32.xrnx

renoise 3.0

5465 ledger.scripts.SetTrackToActiveColumns_V1.3.xrnx

changes:

Click to view contents

v1.32

-Compatability update + button reads “busy” while the tool is working

v1.32

-New GUI

-Now optionally hides empty fx columns; with option to leave at least one if you like the visual track bordering/buffering

-Less Shortcuts + menus for tidyness

Menu : Tools: Ledger`s Scripts: Set Track Widths To Active Columns

or

Shortcut: Set Track Widths To Active Columns

v1.27
Compatible with renoise 3.0

v1.24
–Option added for all tracks at once
–Speed optimisations thanks to joule

v 1.10
– Fixed bug: When different length patterns were present
notes may not have be detected in longer patterns


Work in progress: Piano roll
[Solved] Problem to create a function for close empty note_columns
[Solved] Problem to create a function for close empty note_columns
[Solved] Help: check notes with follow the player position in Patt. Ed
Renoise tools - speed optimization initiative
Instrument numbers of previous column are overwritten
Ledgers Scripts List
Hide all columns
(Ledger) #2

A few small tidying adjustments and now on tools page:

http://tools.renoise.com/tools/set-track-active-columns


(Thomas) #3

Very nice
Thanks


(Ledger) #4

No probs, let me know if you find any issues.


(Ledger) #5

2.7 beta version added


(Ledger) #6

2.7 version on tools page:

http://tools.renoise.com/tools/set-track-active-columns


(Ledger) #7

2.8 version :

–Added new menu entry under the “tools” menu, under “Ledger`s scripts”

http://www.renoise.com/tools/set-track-to-active-columns


(joule) #8

Nice tool. Why not support the effect columns as well?

Here is a speed-up btw

Click to view contents
  
renoise.tool():add_keybinding {  
 name = "Global:Tools:Set Track Width To Active Columns",  
 invoke = function()set_track_to_active_columns()  
 end   
}  
  
renoise.tool():add_menu_entry {  
 name = "Pattern Editor:Set Track Width To Active Columns",  
 invoke = function() set_track_to_active_columns()  
 end  
}  
  
renoise.tool():add_menu_entry {  
 name = "Main Menu:Tools:Ledger`s Scripts:Set Track Width To Active Columns",  
 invoke = function() set_track_to_active_columns()  
 end  
}  
  
  
function set_track_to_active_columns()  
  
--renoise.app():show_status("`Set Track To Active Columns` Tool : (Busy...)")  
  
local pattern_index = renoise.song().selected_pattern_index  
local track_index = renoise.song().selected_track_index  
local pattern_length = renoise.song():pattern(pattern_index).number_of_lines  
local all_patterns = #renoise.song().patterns  
  
--currently selected track--  
local current_pattern_track = renoise.song():pattern(pattern_index):track(track_index)  
local found_pattern  
local found_pattern_shown_number  
local column_adjusted_to  
  
  
---line_index `iterate`  
local note_found = false  
  
for note_col = 12,1,-1 do --each column starting from 12  
  
 renoise.app():show_status("`Set Track To Active Columns` Tool: (Checking Column in Song: ".. note_col..")")  
  
 if note_found == true then  
 break  
 end  
  
 for pattern = 1, all_patterns do --each pattern  
  
  
 if note_found == true then  
 break  
 end  
  
  
  
 current_pattern_track = renoise.song():pattern(pattern):track(track_index)  
  
 if not renoise.song():pattern(pattern):track(track_index).is_empty then  
  
 local lines = current_pattern_track:lines_in_range(1, pattern_length)  
  
 for i, line in ipairs(lines) do --each cell  
  
 if line:note_column(note_col).note_value < 120 then --(120 = note-off, 121 = empty)  
 note_found = true  
 found_pattern = (pattern)  
 --set visible columns  
 renoise.song():track(track_index).visible_note_columns = note_col  
 column_adjusted_to = note_col  
 break  
 end  
  
 end  
  
 end --for line_index  
 end --for pattern  
  
  
  
  
  
end --for note_col  
  
  
--status  
  
if found_pattern then  
 renoise.app():show_status("`Set Track To Active Columns` Tool : (Completed. Right-Most Note found in: Column: "..column_adjusted_to.." / Pattern: "..(found_pattern - 1)..")")  
else  
 renoise.song().tracks[track_index].visible_note_columns = 1 --set columns  
 renoise.app():show_status("`Set Track To Active Columns` Tool : (Completed. Set To 1 Column , No Notes Were Found)")  
end  
  
end --main  
  

(Ledger) #9

Haven`t done much with this one for a while other than version updates. Have it in mind to expand to fx and all tracks at once. Question of time/ priority though.

Thanks for the speed tip, will take a look.


(Drop Shadow) #10

I was looking for a tool like this one but couldn’t find one. Then, I accidentally stumpled over this one. Nice tool. Wouldn’t a name like “Remove/hide Unused Columns” be more approbiate?

Would also like to use the tool on all tracks (if it is possible to prevent the “Script not responding” dialogs from appearing).

Another idea: it would be great if the tool could remove not just the last unused columns in a track, but also unused columns in between used columns.

Other than that, it works great.
Thanks for sharing!


(Ledger) #11

@Drop Shadow

thanks again for suggestions, at the moment I am not getting much chance for scripting though I will have another burst no doubt soon. I don`t think I will change the name on this as it is already up on the tools site under the current name. The name was chosen as the tool will uncover columns that are hidden aswell as hiding the unused. Maybe a little less obvious title but hopefully not a prob now you have found the tool :)


(Drop Shadow) #12

Hi again,
There seems to a problem with the tool. Try using it on the attached song. Run the tool in pattern 0.

The tool will report that there’s no notes and shrink the track to one column although there’s a note in pattern 1.

The funny thing is, if you run the tool from pattern 1, it will work.


(Ledger) #13

Thanks for the report,

will take a look


(Ledger) #14

Please take a look at version 1.10 for rns 2.8, this should be fixed:

http://www.renoise.c…-active-columns


(Drop Shadow) #15

Works just fine. Thanks!


(Ledger) #16

Have just added this here using the process slicer class.

There is now a new menu entry/ shortcut for "Set All track Widths to Active Columns". Released here as a beta for now, bug reports welcome:

[s]Attachment 3395 not found.

[/s]new beta 1.22 below


(Drop Shadow) #17

[quote=“Ledger, post:16, topic:31078”]
Have just added this here using the process slicer class.

There is now a new menu entry/ shortcut for "Set All track Widths to Active Columns". Released here as a beta for now, bug reports welcome:

Attachment 3395 not found.
Very nice addition.
I would like to test this on some of my big and rather complex songs, but practically I can’t due to the “Script not responding” issue.


(Ledger) #18

Could you give me a ballpark figure of how large these songs are? (no. of patterns and average pattern length) The process_slicer is now implemented so should in theory deal with this issue. However if you songs are huge this may need some minor tweaking.


(Drop Shadow) #19

If this should mean that the tool should process the data faster now, it doesn’t seem to be the case here. At least, nothing I can notice.

The one I’m working on at the moment:
66 tracks
144 patterns
Average pattern length: 180.

Of course, all things being equal the tool’s usability increases with the song size. So, I would very humbly argue that the tool ideally should be able to deal with “huge”.

What do I mean, when I say it’s practically impossible to test the “Set all tracks…” function?
I had to click “No” in the “Script not responding” dialog about 20 times before the first track was processed (and 65 still to go!).


(Ledger) #20

No it is more to do with bypassing the pop-ups.

Thanks for figures I have tweaked aiming to cover most extreme 512 length patterns now.
Let me know if this works for you now. Hopefully we can get this optimised to eliminate the popups in all situations.

edit: see 1.23 in next post