You should never reference renoise.song() in the “outer scope” of your tool. This is because all tools are run when renoise starts = before renoise.song() exists.
Whatever you do with vb there, put it inside a function instead, e g create_vb_content(). Then call that from your renoise.app():show_custom_dialog call. It’s also common practice to have a main() or init() function triggered by app_new_document_observable.
A related example, just to show the principle
song = nil
function main()
song = renoise.song() -- now available from all functions, since it was initially declared in the outermost scope.
create_vb_content() -- Or rather, I'd really call this from/via the renoise.app():show_custom_dialog() call. Don't bloat the memory by creating a GUI that might not be shown.
-- Better: local dialog = renoise.app():show_custom_dialog("Title", create_vb_content())
end
function create_vb_content()
local vb = renoise.Viewbuilder()
local my_content = vb:text { text = "hello" }
return my_content
end
renoise.tool().app_new_document_observable:add_notifier(main)
Thanks!
I followed your instructions, but now I have problems with the “id” of multiple tabs. Errors as this:
*** std::logic_error: 'ViewBuilder: a view with the id 'attab_t' was already registered to this viewbuilder instance.'
*** stack traceback:
*** [C]: in function 'column'
*** main.lua:905: in function 'gt16_content'
*** main.lua:1712: in function <main.lua:1707>
Should all functions be within the main(), with a “local”?
Now the tool appears to load before Renoise, and his GUI is displayed, below Renoise.I think something is still wrong with the load.
Would you mind examining my main.lua and fixing the bug?I would like you to try the tool. All other files you can ignore. The problem is inside “main.lua” file. This is something that is driving me crazy.
The tool:7130 ulneiz.GT16-Colors_v1.1.xrnx (notice to readers: this does not workcorrectly)
The all code of main.lua:
--[[----------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
--
-- TOOL NAME: GT16-Colors
-- VERSIÓN: 1.2 (for R3.1)
-- COMPATIBILITY: Windows, Mac, Linux (32/64bit)
-- AUTHOR: ulneiz (Spain)
-- DATE: Summer 2016
--
--------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------]]--
--------------------------------------------------------------------------------
-- INITIALS
--------------------------------------------------------------------------------
song = nil
dialog = nil -- Placeholder for the dialog
vb = renoise.ViewBuilder() -- ViewBuilder for show_dialog() function & others
class 'RenoiseScriptingTool' ( renoise.Document.DocumentNode )
function RenoiseScriptingTool:__init()
renoise.Document.DocumentNode.__init(self)
self:add_property( 'Name' , 'Untitled Tool' )
self:add_property( 'Version', '1.2')
self:add_property( 'Id' , 'Unknown Id' )
end
manifest = RenoiseScriptingTool()
ok,err = manifest:load_from( 'manifest.xml' )
tool_name = manifest:property( 'Name' ).value
tool_id = manifest:property( 'Id' ).value
tool_version = manifest:property('Version').value
--------------------------------------------------------------------------------
-- CONSTANTS
--------------------------------------------------------------------------------
--TAB_COM = 1
ATTAB_F = 1
ATTAB_T = 2
TAB_MGR = 1
TAB_GRP = 2
TAB_SGR = 3
TAB_TRK = 4
TAB_CMB = 5
SGRTAB_SGR = 1
SGRTAB_OCT = 2
SUBTAB_MGR = 1
SUBTAB_GRP = 2
SUBTAB_SGR = 3
SUBTAB_TRK = 4
HLPTAB_CLS = 1
HLPTAB_HLP = 2
HLPTAB_ABO = 3
HLPTAB_TLS = 4
TLSTAB_01 = 1
TLSTAB_02 = 2
TLSTAB_03 = 3
TLSTAB_04 = 4
TLSTAB_05 = 5
TLSTAB_06 = 6
TLSTAB_07 = 7
TLSTAB_08 = 8
TLSTAB_09 = 9
TLSTAB_10 = 10
F , T = false , true
--------------------------------------------------------------------------------
-- INCLUDES
--------------------------------------------------------------------------------
require ("tools/tool_01")
require ("tools/tool_02")
require ("tools/tool_03")
require ("tools/tool_04")
require ("tools/tool_05")
require ("tools/tool_06")
require ("tools/tool_07")
require ("tools/tool_08")
require ("tools/tool_09")
require ("tools/tool_10")
--------------------------------------------------------------------------------
-- UTILITY FUNCTIONS
--------------------------------------------------------------------------------
function LOG(...) print (...) end -- log print
--------------------------------------------------------------------------------
-- TABS NAVIGATION
--------------------------------------------------------------------------------
-- ATTAB Control------------------
-- show/update the indicated tab
function show_attab( idx )
LOG( 'show_attab()' , idx )
vb.views.attab_t.visible = ( idx == ATTAB_T ) and true or false
vb.views.attab_f.visible = ( idx == ATTAB_F ) and true or false
end
-- next/previous attab
function show_next_attab()
local new_attab = visible_attab
if ( visible_attab == ATTAB_F ) then
new_attab = ATTAB_T
else
new_attab = new_attab + 1
end
vb.views.at_switch.value = new_attab
end
function show_previous_attab()
local new_attab = visible_attab
if ( visible_attab == ATTAB_T ) then
new_attab = ATTAB_F
else
new_attab = new_attab - 1
end
vb.views.at_switch.value = new_attab
end
-- force update of current attab
function update_attab()
local attab_idx = visible_attab
visible_attab = 0
show_attab( attab_idx )
end
-- TAB Control------------------
-- show/update the indicated tab
function show_tab( idx )
LOG( 'show_tab()' , idx )
--vb.views.tab_com.visible = ( idx == TAB_COM ) and true or false
vb.views.tab_mgr.visible = ( idx == TAB_MGR ) and true or false
vb.views.tab_grp.visible = ( idx == TAB_GRP ) and true or false
vb.views.tab_sgr.visible = ( idx == TAB_SGR ) and true or false
vb.views.tab_trk.visible = ( idx == TAB_TRK ) and true or false
vb.views.tab_cmb.visible = ( idx == TAB_CMB ) and true or false
end
-- next/previous tab
function show_next_tab()
local new_tab = visible_tab
if ( visible_tab == TAB_CMB ) then
new_tab = TAB_MGR
else
new_tab = new_tab + 1
end
vb.views.main_switch.value = new_tab
end
function show_previous_tab()
local new_tab = visible_tab
if ( visible_tab == TAB_MGR ) then
new_tab = TAB_CMB
else
new_tab = new_tab - 1
end
vb.views.main_switch.value = new_tab
end
-- force update of current tab
function update_tab()
local tab_idx = visible_tab
visible_tab = 0
show_tab( tab_idx )
end
-- SGRTAB Control------------------
-- show/update the indicated tab
function show_sgrtab( idx )
LOG( 'show_sgrtab()' , idx )
vb.views.sgrtab_sgr.visible = ( idx == SGRTAB_SGR ) and true or false
vb.views.sgrtab_oct.visible = ( idx == SGRTAB_OCT ) and true or false
end
-- next/previous sgrtab
function show_next_sgrtab()
local new_sgrtab = visible_sgrtab
if ( visible_sgrtab == SGRTAB_OCT ) then
new_sgrtab = SGRTAB_SGR
else
new_sgrtab = new_sgrtab + 1
end
vb.views.main_switch.value = new_sgrtab
end
function show_previous_sgrtab()
local new_sgrtab = visible_sgrtab
if ( visible_sgrtab == SGRTAB_SGR ) then
new_sgrtab = SGRTAB_OCT
else
new_sgrtab = new_sgrtab - 1
end
vb.views.main_switch.value = new_sgrtab
end
-- force update of current sgrtab
function update_sgrtab()
local sgrtab_idx = visible_sgrtab
visible_sgrtab = 0
show_sgrtab( sgrtab_idx )
end
-- SUBTAB Control------------------
-- show/update the indicated subtab
function show_subtab( idx )
LOG( 'show_subtab()' , idx )
vb.views.subtab_mgr.visible = ( idx == SUBTAB_MGR ) and true or false
vb.views.subtab_grp.visible = ( idx == SUBTAB_GRP ) and true or false
vb.views.subtab_sgr.visible = ( idx == SUBTAB_SGR ) and true or false
vb.views.subtab_trk.visible = ( idx == SUBTAB_TRK ) and true or false
end
-- next/previous subtab
function show_next_subtab()
local new_subtab = visible_subtab
if ( visible_subtab == SUBTAB_TRK ) then
new_subtab = SUBTAB_MGR
else
new_subtab = new_subtab + 1
end
vb.views.submain_switch.value = new_subtab
end
function show_previous_subtab()
local new_subtab = visible_subtab
if ( visible_subtab == SUBTAB_MGR ) then
new_subtab = SUBTAB_TRK
else
new_subtab = new_subtab - 1
end
vb.views.submain_switch.value = new_subtab
end
-- force update of current subtab
function update_subtab()
local subtab_idx = visible_subtab
visible_subtab = 0
show_subtab( subtab_idx )
end
-- HLPTAP Control------------------
-- show/update the indicated subtab
function show_hlptab( idx )
LOG( 'show_hlptab()' , idx )
vb.views.hlptab_cls.visible = ( idx == HLPTAB_CLS ) and true or false
vb.views.hlptab_hlp.visible = ( idx == HLPTAB_HLP ) and true or false
vb.views.hlptab_abo.visible = ( idx == HLPTAB_ABO ) and true or false
vb.views.hlptab_tls.visible = ( idx == HLPTAB_TLS ) and true or false
end
-- next/previous hlptab
function show_next_hlptab()
local new_hlptab = visible_hlptab
if ( visible_hlptab == HLPTAB_TLS ) then
new_hlptab = HLPTAB_CLS
else
new_hlptab = new_hlptab + 1
end
vb.views.help_switch.value = new_hlptab
end
function show_previous_hlptab()
local new_hlptab = visible_hlptab
if ( visible_hlptab == HLPTAB_CLS ) then
new_hlptab = HLPTAB_TLS
else
new_hlptab = new_hlptab - 1
end
vb.views.help_switch.value = new_hlptab
end
-- force update of current hlptab
function update_hlptab()
local hlptab_idx = visible_hlptab
visible_hlptab = 0
show_hlptab( hlptab_idx )
end
-- TLSTAB Control------------------
-- show/update the indicated tlstab
function show_tlstab( idx )
LOG( 'show_tlstab()' , idx )
vb.views.tlstab_01.visible = ( idx == TLSTAB_01 ) and true or false
vb.views.tlstab_02.visible = ( idx == TLSTAB_02 ) and true or false
vb.views.tlstab_03.visible = ( idx == TLSTAB_03 ) and true or false
vb.views.tlstab_04.visible = ( idx == TLSTAB_04 ) and true or false
vb.views.tlstab_05.visible = ( idx == TLSTAB_05 ) and true or false
vb.views.tlstab_06.visible = ( idx == TLSTAB_06 ) and true or false
vb.views.tlstab_07.visible = ( idx == TLSTAB_07 ) and true or false
vb.views.tlstab_08.visible = ( idx == TLSTAB_08 ) and true or false
vb.views.tlstab_09.visible = ( idx == TLSTAB_09 ) and true or false
vb.views.tlstab_10.visible = ( idx == TLSTAB_10 ) and true or false
end
-- next/previous tlstab
function show_next_tlstab()
local new_tlstab = visible_tlstab
if ( visible_tlstab == TLSTAB_10 ) then
new_tlstab = TLSTAB_01
else
new_tlstab = new_tlstab + 1
end
vb.views.tools_switch.value = new_tlstab
end
function show_previous_tlstab()
local new_tlstab = visible_tlstab
if ( visible_tlstab == TLSTAB_01 ) then
new_tlstab = TLSTAB_10
else
new_tlstab = new_tlstab - 1
end
vb.views.tools_switch.value = new_tlstab
end
-- force update of current tlstab
function update_tlstab()
local tlstab_idx = visible_tlstab
visible_tlstab = 0
show_tlstab( tlstab_idx )
end
--------------------------------------------------------------------------------
-- NAVIGATION BARS
--------------------------------------------------------------------------------
function show_cbox_bars( idx )
LOG( 'show_cbox_bars()' , idx )
vb.views.cbox_bars_t.visible = ( idx == true )
vb.views.cbox_bars_f.visible = ( idx == false )
end
checkbox_bars = vb:checkbox { id = 'cbox_bars', value = true, tooltip = 'Show/Hide the Bars bellow', notifier = function(new_idx) show_cbox_bars(new_idx) end }
--------------------------------------------------------------------------------
-- BUTTONS, SWITHES & POPUPS
--------------------------------------------------------------------------------
swi_cl_atmenu = vb:switch { items = {'☱', '⇲' }, id = 'at_switch', tooltip = '⇲ Close Up [MOUSE CLICK]\n☱ Controls [MOUSE CLICK]',
notifier = function(new_index) show_attab(new_index) end, width = 59, height = 20, value = 1 } -- show_attab(2)
swi_cl_hmenu = vb:switch { items = { '⇱', '☲K', '?', '⚒' }, id = 'help_switch', tooltip = '⇱ Close Down [CTRL + END]\n☲K Key Commands [CTRL + PRIOR]\n? About [CTRL + NEXT]\n⚒ Advanced Tools [CTRL + INS]',
notifier = function(new_index) show_hlptab(new_index) end, width = 102, height = 24, value = 4 } -- show_hlptab(1)
swi_cl_tmenu = vb:switch { items = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}, id = 'tools_switch', tooltip = 'Advanced Tools Area \n[CTRL + 1,2...9,0]\n&\nSPNO with SGr Octaves\n[CTRL+SHIFT + 2]',
notifier = function(new_index) show_tlstab(new_index) end, width = 300, height = 20, value = 4 } -- show_tlstab(1)
-- Insert Buttons ( 5 + 4 ) --------------------
------------------------------------------------
--Insert MGr
function insert_01()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
mgr_select ( swi_cl_mgr.value , mgroup.value )
renoise.app():show_status( "GT16-Colors: your selected Main Group has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
--Insert Gr
function insert_02()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
gr_select ( swi_cl_gr.value , group.value )
renoise.app():show_status( "GT16-Colors: your selected Group/s has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
--Insert SGr
function insert_03()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
sgr_select ( swi_cl_sgr.value , sgroup.value )
renoise.app():show_status( "GT16-Colors: your selected SubGroups has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
--Insert Oct
function insert_oct()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
oct_select ( swi_cl_oct.value , octave.value )
renoise.app():show_status( "GT16-Colors: your selected Octaves SubGroup has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
--Insert Tr
function insert_04()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tr_select ( swi_cl_tr.value , track.value )
renoise.app():show_status( "GT16-Colors: your selected Track/s has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
--Combined...
--Insert Cmb MGr
function insert_05()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
mgr_com ( mgrcom.value )
renoise.app():show_status( "GT16-Colors: your selected Combined Main Groups has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
--Insert Cmb Gr
function insert_06()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
gr_com ( grcom.value )
renoise.app():show_status( "GT16-Colors: your selected Combined Groups has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
--Insert Cmb SGr
function insert_07()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
sgr_com ( sgrcom.value )
renoise.app():show_status( "GT16-Colors: your selected Combined SubGroups has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
--Insert Cmb Tr
function insert_08()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tr_com( trcom.value )
renoise.app():show_status( "GT16-Colors: your selected Combined Tracks has been inserted in Pattern Editor." )
else renoise.app():show_status( "⚠ GT16-Colors: please, select before a Track or Group in Pattern Editor or Mixer!!!" )
end
end
-- Lower Buttons ( x14 ) ------------------------
-------------------------------------------------
--Swap, Undo/Redo, NavTracks, Del & First/Last
function navt_swap_left()
local song = renoise.song()
--print (song.selected_track_index , song.sequencer_track_count - song.sequencer_track_count + 1)
if ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER and song.selected_track_index > 1 ) then
song.selected_track_index = song.selected_track_index - 1
if ( song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP ) then
local ssid = song.tracks[song.selected_track_index]
local m = #ssid.members + 2
song.selected_track_index = song.selected_track_index + 1
song:swap_tracks_at( song.selected_track_index, song.selected_track_index - m )
song.selected_track_index = song.selected_track_index - m
elseif ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
song.selected_track_index = song.selected_track_index + 1
song:swap_tracks_at( song.selected_track_index, song.selected_track_index - 1 )
song:select_previous_track()
end
renoise.app():show_status( "GT16-Colors: your selected Track has been swaped to left." )
else renoise.app():show_status( "⚠ GT16-Colors: please, for Swap select before a Track in Pattern Editor or Mixer!!!" )
end
end
---
function navt_swap_right()
local song = renoise.song()
--print (song.selected_track_index , song.sequencer_track_count)
if ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER and song.selected_track_index < song.sequencer_track_count ) then
song.selected_track_index = song.selected_track_index + 1
if ( song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP and song.selected_track_index < song.sequencer_track_count ) then
song.selected_track_index = song.selected_track_index - 1
song:swap_tracks_at(song.selected_track_index, song.selected_track_index + 2 )
song.selected_track_index = song.selected_track_index + 2
elseif ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
song.selected_track_index = song.selected_track_index - 1
song:swap_tracks_at(song.selected_track_index, song.selected_track_index + 1 )
song:select_next_track()
end
renoise.app():show_status( "GT16-Colors: your selected Track has been swaped to right." )
else renoise.app():show_status( "⚠ GT16-Colors: please, for Swap select before a Track in Pattern Editor or Mixer!!!" )
end
end
---
function navt_coll_gr( A )
local song = renoise.song()
local selected_track = song.tracks[song.selected_track_index]
if ( selected_track.type == renoise.Track.TRACK_TYPE_GROUP ) then
for i = 1, #selected_track.members do
A = selected_track.members[i]
if ( A.collapsed == T ) then A.collapsed = F -- False is expanded
renoise.app():show_status( "GT16-Colors: selected Group expanded." )
elseif ( A.collapsed == F ) then A.collapsed = T -- True is collapsed
renoise.app():show_status( "GT16-Colors: selected Group collapsed." )
end
end
end
if ( selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) or
( selected_track.type == renoise.Track.TRACK_TYPE_MASTER ) or
( selected_track.type == renoise.Track.TRACK_TYPE_SEND ) then
if selected_track.collapsed == T then song.tracks[song.selected_track_index].collapsed = F
if ( selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
renoise.app():show_status( "GT16-Colors: selected Track expanded." )
end
if ( selected_track.type == renoise.Track.TRACK_TYPE_MASTER ) then
renoise.app():show_status( "GT16-Colors: selected Master expanded." )
end
if ( selected_track.type == renoise.Track.TRACK_TYPE_SEND ) then
renoise.app():show_status( "GT16-Colors: selected Send expanded." )
end
elseif selected_track.collapsed == F then song.tracks[song.selected_track_index].collapsed = T
if ( selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
renoise.app():show_status( "GT16-Colors: selected Track colapsed." )
end
if ( selected_track.type == renoise.Track.TRACK_TYPE_MASTER ) then
renoise.app():show_status( "GT16-Colors: selected Master colapsed." )
end
if ( selected_track.type == renoise.Track.TRACK_TYPE_SEND ) then
renoise.app():show_status( "GT16-Colors: selected Send colapsed." )
end
end
end
end
---
function navt_on_off( A )
local song = renoise.song()
if ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) or
( song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP ) or
( song.selected_track.type == renoise.Track.TRACK_TYPE_SEND ) then
A = song.tracks[song.selected_track_index].mute_state
end
if A == 1 then song.tracks[song.selected_track_index]:mute()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) then
renoise.app():show_status( "GT16-Colors: selected Track Off." )
end
if (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
renoise.app():show_status( "GT16-Colors: selected Group Off." )
end
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEND) then
renoise.app():show_status( "GT16-Colors: selected Send Off." )
end
elseif A == 2 then song.tracks[song.selected_track_index]:unmute()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) then
renoise.app():show_status( "GT16-Colors: selected Track Play." )
end
if (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
renoise.app():show_status( "GT16-Colors: selected Group Play." )
end
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEND) then
renoise.app():show_status( "GT16-Colors: selected Send Play." )
end
else
renoise.app():show_status( "GT16-Colors: please, for Play/Off select before a Track/Group/Send in Pattern Editor or Mixer!!!" )
end
end
---
function navt_undo()
local song = renoise.song()
song:undo()
end
function navt_redo()
local song = renoise.song()
song:redo()
end
---
function navt_01()
local song = renoise.song()
if song.selected_track_index > 2 then
song:select_previous_track() song:select_previous_track()
renoise.app():show_status( "GT16-Colors: x2 previous Track/Group selected." )
end
end
function navt_02()
local song = renoise.song()
if song.selected_track_index > 1 then
song:select_previous_track()
renoise.app():show_status( "GT16-Colors: previous Track/Group selected." )
end
end
function navt_03()
local song = renoise.song()
if song.selected_track_index < song.sequencer_track_count - 1 then
song:select_next_track() song:select_next_track()
renoise.app():show_status( "GT16-Colors: x2 next Track/Group selected." )
end
end
function navt_04()
local song = renoise.song()
if song.selected_track_index < song.sequencer_track_count then
song:select_next_track()
renoise.app():show_status( "GT16-Colors: next Track/Group selected." )
end
end
---
function navt_del()
local song = renoise.song()
if ( song.sequencer_track_count == 1 ) then
elseif ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) or
( song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP ) then
song:delete_track_at( song.selected_track_index )
renoise.app():show_status( "GT16-Colors: selected Track/Group deleted." )
end
if ( song.sequencer_track_count + song.send_track_count == 1 ) then
elseif ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEND ) then
song:delete_track_at( song.selected_track_index )
renoise.app():show_status( "GT16-Colors: selected send deleted." )
end
if ( song.selected_track.type == renoise.Track.TRACK_TYPE_MASTER ) then
renoise.app():show_status( "GT16-Colors: Master is not deletable! Please, for delete select before a Track/Group/Send in Pattern Editor or Mixer!!!" )
end
if ( song.selected_track_index == 1 ) and ( song.sequencer_track_count == 1 ) then
renoise.app():show_status( "GT16-Colors: only a Track or Group in Pattern Editor. Include more Tracks and delete after!" )
end
end
---
function navt_rem( A , B )
local song = renoise.song()
A = song.sequencer_track_count
B = song.send_track_count
for A = 2 , song.sequencer_track_count do
if ( ( song.sequencer_track_count <= 99 ) and ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) or ( song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP ) ) then
song:delete_track_at( song.selected_track_index ) ---- LIMIT = 99 ---------|***
renoise.app():show_status( "GT16-Colors: all Groups & Tracks removed inside Pattern Editor, least the first. Start again!" )
end
end
for B = 1, song.sequencer_track_count + song.send_track_count do
if ( ( song.send_track_count <= 99 ) and ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEND ) ) then
song:delete_track_at( song.selected_track_index ) ---- LIMIT = 99 ---------|***
end
end
if A == 1 and ( song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) or ( song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP ) then
renoise.app():show_status( "GT16-Colors: only a Track or Group in Pattern Editor. Include more Tracks and remove after!" )
end
if (song.selected_track.type == renoise.Track.TRACK_TYPE_MASTER) then
renoise.app():show_status( "GT16-Colors: master is not deletable! Please, for delete select before a Track/Group/Send in Pattern Editor or Mixer!!!" )
end
end
---
function navt_first()
local song = renoise.song()
song.selected_track_index = song.sequencer_track_count - song.sequencer_track_count + 1
renoise.app():show_status( "GT16-Colors: jumped to first Track/Group." )
end
function navt_last()
local song = renoise.song()
song.selected_track_index = song.sequencer_track_count
renoise.app():show_status( "GT16-Colors: jumped to last Track/Group." )
end
---
function navs_up()
local song = renoise.song()
local sid = song.selected_sequence_index
if song.selected_sequence_index > 1 then
song.selected_sequence_index = sid - 1 --select next pattern
renoise.app():show_status( "GT16-Colors: previous Pattern." )
end
end
function navs_down()
local song = renoise.song()
local sid = song.selected_sequence_index
if #song.sequencer.pattern_sequence > ( sid ) then
song.selected_sequence_index = sid + 1 --select next pattern
renoise.app():show_status( "GT16-Colors: next Pattern." )
end
end
---
function play()
local song = renoise.song()
local play_mode = renoise.Transport.PLAYMODE_RESTART_PATTERN
song.transport:start(play_mode)
renoise.app():show_status( "GT16-Colors: Song play." )
end
function stop()
local song = renoise.song()
song.transport:stop()
renoise.app():show_status( "GT16-Colors: Song stop." )
end
-- Show Counters in real time --
-------------------------------------------------
function ini_counters()
local song = renoise.song()
vb.views["pt_index"].text = ( "Idx [%s" ):format( song.selected_sequence_index ) --selected pattern
vb.views["tr_index"].text = ( "x %s]" ):format( song.selected_track_index ) --selected track
--- ---
vb.views["pt_count"].text = ( " Tt [%s" ):format( #song.sequencer.pattern_sequence ) --total patterns
vb.views["tr_count"].text = ( "x %s]" ):format( song.sequencer_track_count ) --total tracks
--- ---
vb.views["tr_name"].text = ( "%s" ):format( song.tracks[song.selected_track_index].name ) --Name selected track
vb.views["tr_color"].color = ( song.tracks[song.selected_track_index].color ) --Name selected track
--color
--- ---
if song.sequencer_track_count <= 48 then
vb.views["bar_count"].color = { 0x00,0xFF,0x2A } --green
elseif song.sequencer_track_count >= 49 and song.sequencer_track_count <= 96 then
vb.views["bar_count"].color = { 0xFF,0x80,0x00 } --orange
elseif song.sequencer_track_count >= 97 then
vb.views["bar_count"].color = { 0xFF,0x00,0x00 } --red
end
--- ---
vb.views["tr_send"].text = ( "Snd %s" ):format( song.send_track_count )--Total Sends
--- ---
vb.views.nav_track.max = #song.tracks
vb.views["nav_track"].value = song.selected_track_index --bar selected track
end
function counters()
local song = renoise.song()
song.selected_sequence_index_observable:add_notifier(ini_counters)
song.selected_track_index_observable:add_notifier(ini_counters)
song.sequencer.pattern_sequence_observable:add_notifier(ini_counters)
song.tracks[song.selected_track_index].name_observable:add_notifier(ini_counters)
song.tracks[song.selected_track_index].color_observable:add_notifier(ini_counters)
end
renoise.tool().app_new_document_observable:add_notifier(counters) -- To initialice New Start Renoise
-- Process Buttons for Advanced Tools (x10) -----
-------------------------------------------------
function process_03()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tool_03 ()
end
end
function process_04()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tool_04 ()
end
end
function process_05()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tool_05 ()
end
end
function process_06()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tool_06 ()
end
end
function process_07()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tool_07 ()
end
end
function process_08()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tool_08 ()
end
end
function process_09()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tool_09 ()
end
end
function process_10()
local song = renoise.song()
if (song.selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER) or (song.selected_track.type == renoise.Track.TRACK_TYPE_GROUP) then
tool_10 ()
end
end
-- Text (Key Commands & About) -----------------
------------------------------------------------
txt_K00 = vb:text {
text =
"* ALT+CTRL + G = Invoke GT16-Colors. Assign manually this Key Command in 'Preferences/Keys... Global/Tools/GT16-Colors'"
}
txt_K01 = vb:text {
text =
"F1 = 'Main Groups' Switch\n"..
"F2 = 'Groups' Switch\n"..
"F3 = 'SubGroups' Switch\n"..
"F4 = 'Tracks' Switch\n"..
"SHIFT + F3 = 'Octaves' Switch\n"..
"\n"..
"← → = Left / Right Select Color\n"..
"↑ ↓ = Up / Down Select Distribution\n"..
"\n"..
"CTRL + PRIOR = ☲K Keys info\n"..
"CTRL + NEXT = ? About GT16-Colors\n"..
"\n"..
"CTRL + INS = ⚒ Advanced Tools\n"..
"CTRL + 1,2...9,0 = Tools Switch\n"..
"CTRL+SHIFT + 2 = SPNO Expand"
}
txt_K02 = vb:text {
text =
"F5 = 'Cmb ...Main Groups' Switch\n"..
"F6 = 'Cmb ...Groups' Switch\n"..
"F7 = 'Cmb ...SubGroups' Switch\n"..
"F8 = 'Cmb ...Tracks' Switch\n"..
"\n"..
"CTRL + Z = ↩ Undo\n"..
"CTRL + Y = ↪ Redo\n"..
"\n"..
"CTRL+SHIFT + K = |≡◄ Coll./Exp. Tr/Gr\n"..
"CTRL+SHIFT + J = |≡◄ Coll./Exp. Tr in Gr\n"..
"Ç = ☊ Mute/Unmute Selected Tr/Gr\n"..
"\n"..
"CTRL + HOME = ⇱ Compact Mode\n"..
"CTRL + END = ⇱ ... ☲K ? ⚒ Closed\n"..
"ESC = ✖ Exit Window"
}
txt_K03 = vb:text {
text =
"F9 = |◄ First Tr/Gr Switch\n"..
"F10 = ◄ Previous Tr/Gr Switch\n"..
"F11 = ► Next Tr/Gr Switch\n"..
"F12 = ►| Last Tr/Gr Switch\n"..
"\n"..
"CTRL + F9 = ↶| Swap Selected Tr to Left\n"..
"CTRL + F10 = ◄◄ Previous Tr/Gr x2 Switch\n"..
"CTRL + F11 = ►► Next Tr/Gr x2 Switch\n"..
"CTRL + F12 = |↷ Swap Selected Tr/Gr to Right\n"..
"\n"..
"CTRL+SHIFT + DEL = Remove all Tr/Gr\n"..
"CTRL + DEL = Delete Tr/Gr\n"..
"\n"..
"ALT + SPACE = Insert Selection\n"..
"ALT + RETURN = Process SPNO"
}
txt_A01 = vb:multiline_text {
width = 684, height = 130, text =
"'GT16-Colors' is a free MultiTool created by ulneiz for Renoise, to build & customice various distributions/combinations of 'Groups & Tracks per Colors' for Pattern Editor & Mixer.\n"..
"There are '16 Colors' with until 1200 Options to choose and multiple Tool Modules for control. Select a 'Color', select a 'Distribution' or 'Combination' and build according your needs. With GT16-Colors, the groups are the protagonists!\n"..
"\n"..
"Use only a floating window to control your building. Use the tabs to enlarge or reduce the window. Use the integrated key commands, your mouse or both for maximum control. Use the aditional controls below of each Advanced Tool to discover a new ocean... \n"..
"\n"..
"⚠ Some 'Combined Options' includes many Groups & Tracks (>100), to insert only with a click of mouse or key command.\n"..
"Please, use with moderation!!! Think before using...\n"..
"\n"..
"⚒ Moreover, GT16-Colors include until ten bottom slots to control & edit (Advanced Tools section). This version 1.2 include two powerful tools, 'GTC' (magnificent for control) & 'SPNO' (effective for sort pitches of notes per octaves) integrated in the slots one & two. Apart, if you know the LUA code language, you can add your personal tools here (eight free slots).\n"..
"\n"..
"This version 1.2 of GT16-Colors is tested with Renoise 3.1.0 and work fine.\n"..
"\n"..
"Enjoy your Renoise! Enjoy your GT16-Colors!\n"..
"\n"..
" ✉ To contact ulneiz: visit the Renoise Forums, www.renoise.com"
}
txt_A02 = vb:text { text = "℗ 2016. ulneiz (Spain)" }
--------------------------------------------------------------------------------
-- GT16_CONTENT (GUI)
--------------------------------------------------------------------------------
function gt16_content()
local content =
vb:column {
margin = 4,
--tabs Controls------------
vb:column {
id = 'attab_t',
visible = false,
},
------------------------------------------------------------------------------ GT16-Colors
vb:column {
id = 'attab_f',
visible = false,
--menu-------------------------------------
vb:column {
style = 'group', --body
margin = 4,
--values------------------------------------
vb:horizontal_aligner {
mode = 'left',
vb:horizontal_aligner {
--width= 600,
vb:horizontal_aligner { --Pattern Sequence
width = 110,
margin = 2,
vb:column {
tooltip = 'Number of Index Group/Track Selected.\nSelect any Track to reactivate!',
width = 110,
style = 'body',
vb:horizontal_aligner {
height = 21,
mode = 'center',
vb: text {
id = 'pt_index',
align = 'right',
font = 'bold',
text = 'Index'
},
vb: text {
id = 'tr_index',
align = 'left',
font = 'bold',
text = '[Y x X]'
}
}
}
},
vb:horizontal_aligner { width = 6 },
vb:horizontal_aligner { --Name Track
width = 220,
margin = 2,
vb:column {
tooltip = 'Number of Index Group/Track Selected.\nSelect any Track to reactivate!',
width = 220,
style = 'body',
vb:horizontal_aligner {
height = 21,
mode = 'center',
vb: text {
id = 'tr_name',
align = 'center',
font = 'bold',
text = 'Name of Track'
}
}
}
},
vb:button { --Counter Tracks Marker
active = F,
id = 'tr_color', -- ID
color = { 0x20,0x00,0x00 }, -- black
tooltip = 'Color Track',
height = 25,
width = 24,
},
vb:horizontal_aligner { width = 4 },
vb:horizontal_aligner { --Counter Tracks/Groups
width = 110,
margin = 2,
vb:column {
tooltip = 'Total Count of Groups & Tracks.\nSelect any Track to reactivate!',
width = 110,
style = 'body',
vb:horizontal_aligner {
height = 21,
mode = 'center',
vb: text {
id = 'pt_count',
align = 'right',
font = 'bold',
text = 'Total'
},
vb: text {
id = 'tr_count',
align = 'left',
font = 'bold',
text = '[Y x X]'
}
}
}
},
vb:button { --Counter Tracks Marker
active = F,
id = 'bar_count', -- ID
color = { 0x00,0x30,0x00 }, -- black
tooltip = 'Green: Low Level of Members (until 48).\nOrange: Middle Level of Members (49 until 96).\nRed: High Level of Members (more of 96).',
height = 25,
width = 7
},
vb:horizontal_aligner { width = 4 },
vb:horizontal_aligner { --Counter Send
tooltip = 'Total Number of Send Tracks.\nSelect any Track to reactivate!',
width = 60,
margin = 2,
vb:column {
width = 60,
style = 'body',
vb:horizontal_aligner {
height = 21,
mode = 'center',
vb: text {
id = 'tr_send',
align = 'center',
font = 'bold',
text = 'Sends'
}
}
}
},
vb:horizontal_aligner { width = 104 },
vb:column {
vb:horizontal_aligner {
vb:text { text = 'Bars ' },
checkbox_bars --bars
}
}
}
},
--NavTracks-------------------------------
vb:horizontal_aligner {
swi_cl_hmenu, --hmenu
vb:horizontal_aligner { width = 4 },
vb:button {
color = { 0xAA,0x6A,0x00 },
text = '↩',
id = 'navt_undo',
tooltip = 'Undo \n[CTRL + Z]',
height = 24,
width = 40,
notifier = function()navt_undo() end
},
vb:button {
color = { 0xAA,0x6A,0x00 },
text = '↪',
id = 'navt_redo',
tooltip = 'Redo \n[CTRL + Y]',
height = 24,
width = 40,
notifier = function()navt_redo() end
},
vb:horizontal_aligner { width = 4 },
vb:button {
color = { 0x66,0x00,0x00 },
text = 'REM',
id = 'navt_cln',
tooltip = 'Remove all Tracks/Groups inside Pattern Editor (least the first) & Start Again!\n[CTRL+SHIFT + DEL]\n⚠ Limited until 99 members. All expanded!',
height = 24,
width = 40,
notifier = function()navt_rem() end
},
vb:button {
color = { 0x66,0x00,0x00 },
text = 'DEL',
id = 'navt_del',
tooltip = 'Delete Selected Track/Group/Send\n[CTRL + DEL]',
height = 24,
width = 40,
notifier = function()navt_del() end
},
vb:horizontal_aligner { width = 4 },
vb:button {
color = { 0x06,0x3B,0x70 },
text = '☊',
id = 'note_on_off',
tooltip = "'Play/Off' Selected Track/Group/Send (Master not included)\n[Ç]",
height = 24,
width = 30,
notifier = function() navt_on_off() end
},
vb:button {
color = { 0x7F,0x05,0x54 },
text = '|≡◄ ',
id = 'collapse_expand_gr',
tooltip = "'Collapse/Expand' all Tracks inside the Group Parent\n[CTRL+SHIFT + J]\nor\n'Collapse/Expand' Selected Track/Master/Send\n[CTRL+SHIFT + K]",
height = 24,
width = 40,
notifier = function() navt_coll_gr() end
},
vb:horizontal_aligner { width = 4 },
vb:button {
color = { 0x00,0x20,0x50 },
text = '↶|',
id = 'navt_swap_left',
tooltip = 'Swap Selected Track to Left\n[CTRL + F9]',
height = 24,
width = 30,
notifier = function()navt_swap_left() end
},
vb:button {
color = { 0x00,0x20,0x50 },
text = '|↷',
id = 'navt_swap_right',
tooltip = 'Swap Selected Track to Right\n[CTRL + F12]',
height = 24,
width = 30,
notifier = function()navt_swap_right() end
},
vb:horizontal_aligner { width = 4 },
vb:button {
color = { 0x4F,0x0C,0x89 },
text = '|◄',
id = 'navt_first',
tooltip = 'First Track/Group \n[F9]',
height = 24,
width = 30,
notifier = function()navt_first() end
},
vb:button {
color = { 0x4F,0x0C,0x89 },
text = '◄◄ ◄',
id = 'navt_02',
tooltip = 'Previous Track/Group\n[F10]\nor\nPrevious Track/Group x2\n[CTRL + F10]',
height = 24,
width = 50,
notifier = function()navt_02() end
},
vb:button {
color = { 0x4F,0x0C,0x89 },
text = '► ►►',
id = 'navt_03',
tooltip = 'Next Track/Group\n[F11]\nor\nNext Track/Group x2\n[CTRL + F11]',
height = 24,
width = 50,
notifier = function()navt_04() end
},
vb:button {
color = { 0x4F,0x0C,0x89 },
text = '►|',
id = 'navt_last',
tooltip = 'Last Track/Group\n[F12]',
height = 24,
width = 30,
notifier = function()navt_last() end
},
vb:button {
color = { 0x40,0x00,0x80 },
text = '▲',
id = 'navs_up',
tooltip = 'Up sequence \n[]',
height = 24,
width = 30,
notifier = function()navs_up() end
},
vb:button {
color = { 0x40,0x00,0x80 },
text = '▼',
id = 'navs_down',
tooltip = 'Down sequence\n[]',
height = 24,
width = 30,
notifier = function()navs_down() end
},
vb:horizontal_aligner { width = 4 },
vb:button {
color = { 0x00,0x60,0x00 },
text = '▶',
id = 'play',
tooltip = 'Play the song\n[]',
height = 24,
width = 30,
notifier = function()play() end
},
vb:button {
color = { 0x00,0x40,0x00 },
text = '■',
id = 'stop',
tooltip = 'Stop the song\n[]',
height = 24,
width = 30,
notifier = function()stop() end
},
},
--NavColumns - NavTracks-------------------------------
vb:column {
id ='cbox_bars_f',
visible = false,
},
vb:column {
id = 'cbox_bars_t',
visible = false,
vb:horizontal_aligner { height = 5 },
vb:horizontal_aligner {
mode = 'justify',
vb:horizontal_aligner {
width = 120,
vb:slider {
id = 'nav_col',
min = 0, --1,
max = 1, --12, --renoise.song().tracks[renoise.song().selected_track_index].visible_note_columns
value = 0, --1,
width = 120,
-- notifier = function(value) renoise.song().selected_note_column_index = value end,
notifier = function(val)
if ( renoise.song().selected_track.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
local num_column = renoise.song().tracks[renoise.song().selected_track_index].visible_note_columns - 1
local col_idx = math.floor( val * num_column ) + 1
renoise.song().selected_note_column_index = col_idx
print( 'col_idx: ' ..col_idx )
end
end
}
},
---
vb:horizontal_aligner {
width = 570,
vb:slider {
id = 'nav_track',
min = 1,
max = #song.tracks, --(renoise.song().sequencer_track_count + 1 + renoise.song().send_track_count), -- number all tracks
value = song.selected_track_index, -- selected track
width = 530,
notifier = function(val)
song.selected_track_index = math.floor(val)
end
},
vb:text {
id = 'index_value',
text = '---'
},
vb:text {
id = 'col_value',
text = '---'
}
},
--[[------------------------------------
vb:horizontal_aligner {
width = 570,
vb:slider {
id = 'nav_track',
min = 0, --1,
max = 1, --2, --renoise.song().sequencer_track_count + 1 + renoise.song().send_track_count,
value = 0, --1,
width = 530,
--notifier = function(value) renoise.song().selected_track_index = value end,
notifier = function(val)
local num_tracks = renoise.song().sequencer_track_count + renoise.song().send_track_count
local track_idx = math.floor( val * num_tracks ) + 1
renoise.song().selected_track_index = track_idx
print( 'track_idx: ' ..track_idx )
end
},
vb:text {
id = 'index_value',
text = '---'
},
vb:text {
id = 'col_value',
text = '---'
}
}
----------------------------------]]
}
}
---
},
--hlpmenu----------------------------------
vb:column {
visible = false,
id = 'hlptab_cls'
},
----------------------------- Keys
vb:column {
vb:horizontal_aligner { height = 5 },
visible = false,
id = 'hlptab_hlp',
vb:column {
style = 'group',
margin = 5,
vb:horizontal_aligner {
vb:text {
font = 'bold',
text = '☲K Key Commands'
}
},
vb:horizontal_aligner { height = 5 },
vb:column {
style = 'body',
width = 694,
height = 24,
margin = 8,
txt_K00
},
vb:horizontal_aligner { height = 5 },
vb:horizontal_aligner {
mode = "justify",
vb:column {
style = 'body',
width = 206,
height = '100%',
margin = 8,
txt_K01
},
vb:column {
style = 'body',
width = 226,
height = '100%',
margin = 8,
txt_K02
},
vb:column {
style = 'body',
width = 252,
height = '100%',
margin = 8,
txt_K03
}
}
}
},
------------------------------- About
vb:column {
vb:horizontal_aligner { height = 5 },
visible = false,
id = 'hlptab_abo',
vb:column {
style = 'group',
margin = 5,
vb:horizontal_aligner {
mode = 'justify',
vb:column {
vb:text {
font = 'bold',
text = '? About GT16-Colors v1.2'
}
},
vb:column {
vb:horizontal_aligner {
but_cm.aq, but_cm.bk, but_cm.bl, but_cm.br, but_cm.gl, but_cm.gy, but_cm.gr, but_cm.og, but_cm.pl, but_cm.pn, but_cm.ps, but_cm.rd, but_cm.sk, but_cm.vl, but_cm.wh, but_cm.yl
}
}
},
vb:horizontal_aligner { height = 5 },
vb:column {
style = 'body',
height = '100%',
margin = 5,
txt_A01,
vb:horizontal_aligner {
mode = 'right',
txt_A02
}
}
}
}
},
------------------------------------------------------------------------------ GT16-Colors
------------------------------------- Advanced Tools (Pattern Editor)
vb:column {
vb:horizontal_aligner { height = 5 },
visible = false,
id = 'hlptab_tls',
vb:column {
style = 'group',
margin = 5,
vb:horizontal_aligner {
mode = 'right',
vb:column {
vb:horizontal_aligner {
mode = 'right',
vb:text {
font = 'big',
text = '⚒'
},
vb:text {
font = 'bold',
text = 'Advanced Tools '
}
}
},
vb:column {
vb:horizontal_aligner {
swi_cl_tmenu,
vb:horizontal_aligner { width = 4 },
swi_cl_atmenu
}
}
},
-------------------------------Tool 01
vb:column {
visible = false,
id = 'tlstab_01',
style = 'body',
width = 694,
margin = 08,
--- ---
PEST, --Tool 01 Added!
--- ---
},
-------------------------------Tool 02
vb:column {
visible = false,
id = 'tlstab_02',
style = 'body',
width = 694,
margin = 08,
--- ---
MESS, --Tool 02 Added!
--- ---
},
-------------------------------Tool 03
vb:column {
visible = false,
id = 'tlstab_03',
style = 'body',
width = 694,
margin = 08,
--- ---
DCSP, --Tool 03 Added!
--- ---
},
-------------------------------Tool 04
vb:column {
visible = false,
id = 'tlstab_04',
style = 'body',
width = 694,
margin = 08,
--- ---
GTC, --Tool 04 Added!
--- ---
},
-------------------------------Tool 05
vb:column {
visible = false,
id = 'tlstab_05',
style = 'body',
width = 694,
margin = 08,
--- ---
AMIC, -- Tool 05
--- ---
},
-------------------------------Tool 06
vb:column {
visible = false,
id = 'tlstab_06',
style = 'body',
width = 694,
margin = 08,
--- ---
SPNO, -- Tool 06
--- ---
},
-------------------------------Tool 07
vb:column {
visible = false,
id = 'tlstab_07',
style = 'body',
width = 694,
margin = 08,
--- ---
TL07, -- Tool 07
--- ---
},
-------------------------------Tool 08
vb:column {
visible = false,
id = 'tlstab_08',
style = 'body',
width = 694,
margin = 08,
--- ---
TL08, -- Tool 08
--- ---
},
-------------------------------Tool 09
vb:column {
visible = false,
id = 'tlstab_09',
style = 'body',
width = 694,
margin = 08,
--- ---
TL09, -- Tool 09
--- ---
},
-------------------------------Tool 10
vb:column {
visible = false,
id = 'tlstab_10',
style = 'body',
width = 694,
margin = 08,
--- ---
TL10, -- Tool 10
--- ---
}
-------------------------------
}
}
}
------------------------------------------------------------
show_tab(2) -- 2, start the things [1-6]
show_sgrtab(1) -- 1, SubGroups/Octaves [1-4]
show_subtab(1) -- 1, Combined [1-2]
show_hlptab(4) -- 1, Hide/Keys/?/Advancet Tools [1-4]
show_tlstab(4) -- 4, Advanced Tools Selector 1-...-9-0 [10]
show_attab(1) -- 1, Show/hide Controls [1-2]
show_cbox_bars(T) -- F, Show/hide Navigation Bars [True/False]
return content
end
--------------------------------------------------------------------------------
-- KEYHANDLER
--------------------------------------------------------------------------------
function keyhandler( key )
rprint(key) -- print the value of key to the console
-- return key -- uncomment to pass key on to Renoise
local choice_via_shortcut = nil
-- Insert, Process --------------------------------------------------------------------------------
if ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_menu.value == 2 ) then choice_via_shortcut = 'Insert MGr' insert_01()
elseif ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_menu.value == 3 ) then choice_via_shortcut = 'Insert Gr' insert_02()
elseif ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 1) then choice_via_shortcut = 'Insert SGr' insert_03()
elseif ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 2) then choice_via_shortcut = 'Insert Oct' insert_oct()
elseif ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_menu.value == 5 ) then choice_via_shortcut = 'Insert Tr' insert_04()
---
elseif ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_smenu.value == 1 ) then choice_via_shortcut = 'Insert Comb. MGr' insert_05()
elseif ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_smenu.value == 2 ) then choice_via_shortcut = 'Insert Comb. Gr' insert_06()
elseif ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_smenu.value == 3 ) then choice_via_shortcut = 'Insert Comb. SGr' insert_07()
elseif ( key.modifiers == 'alt' and key.name == 'space' and swi_cl_smenu.value == 4 ) then choice_via_shortcut = 'Insert Comb. Tr' insert_08()
---
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 1 ) then choice_via_shortcut = 'Process Tool 01' process_01()
elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 2 ) then choice_via_shortcut = 'Process Tool 02' process_02()
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 3 ) then choice_via_shortcut = 'Process Tool 03' process_03()
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 4 ) then choice_via_shortcut = 'Process Tool 04' process_04()
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 5 ) then choice_via_shortcut = 'Process Tool 05' process_05()
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 6 ) then choice_via_shortcut = 'Process Tool 06' process_06()
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 7 ) then choice_via_shortcut = 'Process Tool 07' process_07()
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 8 ) then choice_via_shortcut = 'Process Tool 08' process_08()
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 9 ) then choice_via_shortcut = 'Process Tool 09' process_09()
--elseif ( key.modifiers == 'alt' and key.name == 'return' and swi_cl_tmenu.value == 10) then choice_via_shortcut = 'Process Tool 10' process_10()
-- Switches ------------------------------------------------------------------------------
elseif ( key.name == 'f1' ) then choice_via_shortcut = 'MGr' vb.views['main_switch'].value = 2
elseif ( key.name == 'f2' ) then choice_via_shortcut = 'Gr' vb.views['main_switch'].value = 3
elseif ( key.modifiers == 'shift' and key.name == 'f3' ) then choice_via_shortcut = 'Oct' vb.views['main_switch'].value = 4 vb.views['subgroup_switch'].value = 2
elseif ( key.name == 'f3' ) then choice_via_shortcut = 'SGr' vb.views['main_switch'].value = 4 vb.views['subgroup_switch'].value = 1
elseif ( key.name == 'f4' ) then choice_via_shortcut = 'Tr' vb.views['main_switch'].value = 5
elseif ( key.name == 'f5' ) then choice_via_shortcut = 'CMGr' vb.views['main_switch'].value = 6 vb.views['submain_switch'].value = 1
elseif ( key.name == 'f6' ) then choice_via_shortcut = 'CGr' vb.views['main_switch'].value = 6 vb.views['submain_switch'].value = 2
elseif ( key.name == 'f7' ) then choice_via_shortcut = 'CSGr' vb.views['main_switch'].value = 6 vb.views['submain_switch'].value = 3
elseif ( key.name == 'f8' ) then choice_via_shortcut = 'CTr' vb.views['main_switch'].value = 6 vb.views['submain_switch'].value = 4
-- NavTracks, Exit, Wipe & Del -----------------------------------------------------------------
elseif ( key.modifiers == 'control' and key.name == 'f9' ) then choice_via_shortcut = 'Swap Selected Track to Left' navt_swap_left()
elseif ( key.name == 'f9' ) then choice_via_shortcut = 'First Track' navt_first()
elseif ( key.modifiers == 'control' and key.name == 'f10' ) then choice_via_shortcut = 'Previous Track x 2' navt_01()
elseif ( key.name == 'f10' ) then choice_via_shortcut = 'Previous Track' navt_02()
elseif ( key.modifiers == 'control' and key.name == 'f11' ) then choice_via_shortcut = 'Next Track x 2' navt_03()
elseif ( key.name == 'f11' ) then choice_via_shortcut = 'Next Track' navt_04()
elseif ( key.modifiers == 'control' and key.name == 'f12' ) then choice_via_shortcut = 'Swap Selected Track/Main Group to Right' navt_swap_right()
elseif ( key.name == 'f12' ) then choice_via_shortcut = 'Last Track' navt_last()
elseif ( key.name == 'esc' ) then choice_via_shortcut = 'Exit' dialog:close() -- (key.name == 'esc' or key.name == 'e') -- ...or 'e'
elseif ( key.name == 'ç' ) then choice_via_shortcut = 'Active/Off Track/Group' navt_on_off()
elseif ( key.modifiers == 'shift + control' and key.name == 'k' ) then choice_via_shortcut = 'Collapse/Expand Track/Group' navt_coll()
elseif ( key.modifiers == 'control' and key.name == 'z' ) then choice_via_shortcut = 'Undo' navt_undo()
elseif ( key.modifiers == 'control' and key.name == 'y' ) then choice_via_shortcut = 'Undo' navt_redo()
elseif ( key.modifiers == 'shift + control' and key.name == 'del' ) then choice_via_shortcut = 'Delelte' navt_rem()
elseif ( key.modifiers == 'control' and key.name == 'del' ) then choice_via_shortcut = 'Delelte' navt_del()
-- Close below, Keys, & About -----------------------------------------------------------------
elseif ( key.modifiers == 'control' and key.name == 'ins' ) then choice_via_shortcut = 'Advanced Tools' vb.views['help_switch'].value = 4 vb.views['main_switch'].value = 1
elseif ( key.modifiers == 'control' and key.name == 'home' ) then choice_via_shortcut = 'Compact Window' vb.views['main_switch'].value = 1
elseif ( key.modifiers == 'control' and key.name == 'end' ) then choice_via_shortcut = 'Close Window' vb.views['help_switch'].value = 1
elseif ( key.modifiers == 'control' and key.name == 'prior' ) then choice_via_shortcut = 'Key Commands' vb.views['help_switch'].value = 2
elseif ( key.modifiers == 'control' and key.name == 'next' ) then choice_via_shortcut = 'About' vb.views['help_switch'].value = 3
-- Advanced Tools ------------------------------------------------------------------------
elseif ( key.modifiers == 'shift + control' and key.name == '2' ) then choice_via_shortcut =
'Tool 02' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 2 vb.views['main_switch'].value = 4 vb.views['subgroup_switch'].value = 2
elseif ( key.modifiers == 'control' and key.name == '1' ) then choice_via_shortcut = 'Tool 01' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 1
elseif ( key.modifiers == 'control' and key.name == '2' ) then choice_via_shortcut = 'Tool 02' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 2
elseif ( key.modifiers == 'control' and key.name == '3' ) then choice_via_shortcut = 'Tool 03' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 3
elseif ( key.modifiers == 'control' and key.name == '4' ) then choice_via_shortcut = 'Tool 04' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 4
elseif ( key.modifiers == 'control' and key.name == '5' ) then choice_via_shortcut = 'Tool 05' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 5
elseif ( key.modifiers == 'control' and key.name == '6' ) then choice_via_shortcut = 'Tool 06' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 6
elseif ( key.modifiers == 'control' and key.name == '7' ) then choice_via_shortcut = 'Tool 07' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 7
elseif ( key.modifiers == 'control' and key.name == '8' ) then choice_via_shortcut = 'Tool 08' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 8
elseif ( key.modifiers == 'control' and key.name == '9' ) then choice_via_shortcut = 'Tool 09' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 9
elseif ( key.modifiers == 'control' and key.name == '0' ) then choice_via_shortcut = 'Tool 10' vb.views['help_switch'].value = 4 vb.views['tools_switch'].value = 10
end
----
local vb_switch = vb.views['mgr_switch_cl']
if ( key.name == 'right' and swi_cl_menu.value == 2 ) then
vb_switch.value = math.min( #vb_switch.items , vb_switch.value + 1 )
elseif ( key.name == 'left' and swi_cl_menu.value == 2 ) then
vb_switch.value = math.max( 1 , vb_switch.value - 1 )
end
local vb_popup = vb.views['mgr_popup']
if ( key.name == 'down' and swi_cl_menu.value == 2 ) then
vb_popup.value = math.min(#vb_popup.items,vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_menu.value == 2 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_switch = vb.views['gr_switch_cl']
if ( key.name == 'right' and swi_cl_menu.value == 3) then
vb_switch.value = math.min( #vb_switch.items , vb_switch.value + 1 )
elseif ( key.name == 'left' and swi_cl_menu.value == 3 ) then
vb_switch.value = math.max( 1 , vb_switch.value - 1 )
end
local vb_popup = vb.views['gr_popup']
if ( key.name == 'down' and swi_cl_menu.value == 3 ) then
vb_popup.value = math.min( #vb_popup.items,vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_menu.value == 3 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_switch = vb.views['sgr_switch_cl']
if ( key.name == 'right' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 1 ) then
vb_switch.value = math.min( #vb_switch.items , vb_switch.value + 1 )
elseif ( key.name == 'left' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 1 ) then
vb_switch.value = math.max( 1 , vb_switch.value - 1 )
end
local vb_popup = vb.views['sgr_popup']
if ( key.name == 'down' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 1 ) then
vb_popup.value = math.min( #vb_popup.items , vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 1 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_switch = vb.views['oct_switch_cl']
if ( key.name == 'right' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 2 ) then
vb_switch.value = math.min( #vb_switch.items , vb_switch.value + 1 )
elseif ( key.name == 'left' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 2 ) then
vb_switch.value = math.max( 1 , vb_switch.value - 1 )
end
local vb_popup = vb.views['oct_popup']
if ( key.name == 'down' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 2 ) then
vb_popup.value = math.min( #vb_popup.items , vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_menu.value == 4 and swi_cl_sgrmenu.value == 2 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_switch = vb.views['tr_switch_cl']
if ( key.name == 'right' and swi_cl_menu.value == 5 ) then
vb_switch.value = math.min( #vb_switch.items , vb_switch.value + 1 )
elseif ( key.name == 'left' and swi_cl_menu.value == 5 ) then
vb_switch.value = math.max( 1 , vb_switch.value - 1 )
end
local vb_popup = vb.views['tr_popup']
if ( key.name == 'down' and swi_cl_menu.value == 5 ) then
vb_popup.value = math.min( #vb_popup.items , vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_menu.value == 5 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_popup = vb.views['cmgr_popup']
if ( key.name == 'down' and swi_cl_smenu.value == 1 ) then
vb_popup.value = math.min( #vb_popup.items , vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_smenu.value == 1 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_popup = vb.views['cgr_popup']
if ( key.name == 'down' and swi_cl_smenu.value == 2 ) then
vb_popup.value = math.min( #vb_popup.items , vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_smenu.value == 2 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_popup = vb.views['csgr_popup']
if ( key.name == 'down' and swi_cl_smenu.value == 3 ) then
vb_popup.value = math.min( #vb_popup.items , vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_smenu.value == 3 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_popup = vb.views['ctr_popup']
if ( key.name == 'down' and swi_cl_smenu.value == 4 ) then
vb_popup.value = math.min( #vb_popup.items,vb_popup.value + 1 )
elseif ( key.name == 'up' and swi_cl_smenu.value == 4 ) then
vb_popup.value = math.max( 1 , vb_popup.value - 1 )
end
----
local vb_switch = vb.views['tls_switch_cl']
if ( key.name == 'right' and swi_cl_hmenu.value == 4 and swi_cl_tmenu.value == 2 ) then
vb_switch.value = math.min( #vb_switch.items , vb_switch.value + 1 )
elseif ( key.name == 'left' and swi_cl_hmenu.value == 4 and swi_cl_tmenu.value == 2 ) then
vb_switch.value = math.max( 1 , vb_switch.value - 1)
end
end
--------------------------------------------------------------------------------
-- SHOW_DIALOG
--------------------------------------------------------------------------------
function show_dialog()
song = renoise.song()
if dialog and dialog.visible then dialog:show() return end -- Prevents duplicate of the floating window ( when reaching this, the dialog never was created before or was closed )
dialog = renoise.app():show_custom_dialog ( ' '.. tool_name .. ' v' .. tool_version .. ' by: ulneiz' , gt16_content() , keyhandler )
renoise.app():show_status('GT16-Colors is charged... Enjoy the colors and control!')
end
renoise.tool().app_new_document_observable:add_notifier(show_dialog)
-- Reload the script whenever this file is saved. Additionally, execute the attached function.
-- _AUTO_RELOAD_DEBUG = function() show_dialog() end
-- _AUTO_RELOAD_DEBUG = true
--------------------------------------------------------------------------------
-- MENU ENTRIES
--------------------------------------------------------------------------------
renoise.tool():add_menu_entry {
name = 'Main Menu:Tools:'..tool_name..'... [* ALT + CTRL + G]',
invoke = show_dialog
}
renoise.tool():add_menu_entry {
name = 'Pattern Editor:'..tool_name..'... [* ALT + CTRL + G]',
invoke = show_dialog
}
renoise.tool():add_menu_entry {
name = 'Mixer:'..tool_name..'... [* ALT + CTRL + G]',
invoke = show_dialog
}
--------------------------------------------------------------------------------
-- KEY BINDING (RECOMENDED CTRL + ALT + G)
--------------------------------------------------------------------------------
renoise.tool():add_keybinding {
name = 'Global:Tools:' ..tool_name..'... [* ALT + CTRL + G]',
invoke = show_dialog
}
--------------------------------------------------------------------------------
-- MIDI/KEY MAPPING
--------------------------------------------------------------------------------
--[[
renoise.tool():add_midi_mapping {
name = 'Tools:GT16-Colors:Clean All values in Track [Trigger]', -- MIDI MAPPING
invoke = function()tool_01_33() end
}
]]
--[[ UNICODE SYMBOLS
✓ ✔ ⇅ ⇆ ← → ↑ ↓ ↆ ❙❙❙ ☲ ❘❘❘ ☰ ⎓ ➤ ❤ ✦ ✉ ▬ ⚫ ◤ ◢ ◆ ┃ ℗ Ⓒ ➥ ✘ ✖ ⬒ ⬓ ▦ ⯬ ⇱ ☲K ? ⚒ ⚯ ☊ ☋ ♞
≡◄ ▲ ▼ ◄ ◄◄ ►► ► ◂ ⏹ ⏯ ⏵⏸⏴ ⏪ ⏩ ⏮ ⏭ ☚ ☛ ↩ ↪ ↶ ↷ ? ⚒ ☠ ☢ ☣ ⚠ ☺ ⧗ ? ? ⇱ ⇲ ☊ ↹ ♬ ⭍ ♆
http://unicode-table.com/en/#optical-character-recognition
--]]
Could you fix it?It’s what I need for the tool to work fine (organize properly, and load details).Before adding the slider, everything worked fine, tabs (switches) included.Maybe I have an organizational problem or some line of code is missing to avoid the type error: " 'ViewBuilder: a view with the id ‘???’ was already registered to this viewbuilder instance."
I suspect there is something wrong in SHOW DIALOG… and in the general organization inside main.lua.
I apologize for asking this! (The code is long and boring). Normally, I fix the things.
Thank you very much!