Hi Guys
I created my first beta version of template with advanced features by the scripts.
Some indication:
- All the controllers have the show/hidden function. So if the controller is not present in the rackspace it’s not visible in touchOSC.
- Tapping on the song and part labels you can to moving up and down the songs parts
- On the sliders1 and sliders1 labels you can see 2 examples of two different mode to visualize the values. Slider1 visualizes a parameter value and Slider2 visualizes a midi Value
Note: If you want add some controllers is very important the “Tag”. All labels are grouped with the controllers by the “Tag”.
- The Page of SongList is a rivisited copy of template by “rank13”… Thank you man for your great Job.
The grid list is scrollable and the max number of songs visibles in the grid is determinate by the number of row and column of the grid. If you need to calibrate the scroller, after the modify of the grid, you can see the instructions in the scripts.
Issues encountered:
- If I change songs parts from TouchOSC everything work perfectly, but if I change songs parts from my midi controller or PC, the controllers in TouchOSC are shown or hidden randomly.
UDP ports in the router are opened and the speed of the Wifi is 866Mbps…I tried different router, Ethernet, wifi but the issue persist.
If I use my phone with touchOSC inside in hotspot mode connected to the Pc everything work well…
Same issue by the way with the Lemur template, so I don’t know…
Do you have some advice on this?
-I apologize for my poor knowledge of the English language. I hope you can understand me anyway.
I’m not a programmer, so if you have some advice to improve the scripts or the template in general you are welcome…All together we can create a perfect template.
As soon as I have the permissions I’ll post the images and the material to download so you can try it and let me know
Here the code in the root:
---- controllers grouped by Tag
local Faders={}
local Knobs={}
-----grid songs label
local songlist=root:findByName("sng",true)
-----Songs pager position
local songs= self.children.pager.children.SongsPage
local N_faders=4
local N_knob=4
function init()
sendOSC('/SetList/GetSongList')
sendOSC('/SelectSongByIndex', 0)
for i=1, N_faders do
Faders[i]=root:findAllByProperty("tag","F"..i,true)
Knobs[i]=root:findAllByProperty("tag","K"..i,true)
end
--[] <-- Deleting one of previous character (e.g. "["), the following command lines will be activate, renaming all the labels from song 1 to song"x"
--click on start and test the scrolling. If you need to calibrate it click on the fader used to scrolling the list and follow the instructions
--After that remember to reinsert the charater deleted before
for i = 1, #songlist.children do
songlist.children[i].values.text = "song "..i
end --]]
end
function onReceiveOSC(message,connections)
local path = message[1]
local arguments = message[2]
songlist: notify("list", {path, arguments})
------hide/show objects
for i=1 , #Faders do -- number of faders
for j=1, #Faders[i] do -- objects grouped to faders by tag name (labelName, labelValue, fader)
if path=='/ClearAll'
then
Faders[i][j].visible=false
Knobs[i][j].visible=false
end
if path=='/Slider'..i..'Name'
--or
--path=='/F_Val'..i..'Name'
then
Faders[i][j].visible=true
end
if path=='/Knob'..i..'Name'
-- or
--path=='/K_Val'..i..'Name'
then
Knobs[i][j].visible=true
end
end
end
----------------------------
-- If the setlist changes in GP, request the new song list
if path == '/SetListChanged' then
sendOSC('/SetList/GetSongList')
end
-- Use LUA string functions to extract the song number
-- from the GP SongName message e.g. /SongName9
-- The last message received will provide the total song count
if string.find(path, '/SongName') then
local songCount = tonumber(string.match(path, '%d+')) + 1
-- Store the song count in a label
songs.children['SongCount'].values.text = tostring(songCount)
end
-- Get the currently selected song number and store in a label
if path == '/CurrentSongIndex' then
local song = arguments[1].value + 1
-- Rather than set the label directly, you can also trigger
-- a callback for the label and pass it the song count.
-- There is a small script in the CurrentSong label to handle this.
self.notify(songs.children['CurrentSong'], tostring(song))
songlist: notify("songID", tostring(song))
end
-- Once the last song name has been received (and total count
-- is calculated), hide any song labels that aren't required.
if path == '/SongListEnd'
then
local songCount = tonumber(songs.children['SongCount'].values.text)
-- Iterate through all the song labels in the 'songs' group
-- and set the visibility property. Adding similar controls
-- to a 'Group' gives them an index, which is useful for processing.
songlist: notify("hide", songCount)
end
-- Similar to the song count, use LUA string functions to extract
-- the song part number and store in a hidden label.
if string.find(path, '/SongPart%d+') then
local partCount = tonumber(string.match(path, '%d+')) + 1
songs.children['SongPartCount'].values.text = tostring(partCount)
end
-- Once the last song part message is received (and total song part
-- is calculated), hide any song part labels that aren't required.
if path == '/SongPartsEnd' then
local partCount = tonumber(songs.children['SongPartCount'].values.text)
-- Iterate through all the song part labels in the 'SongParts' group
-- and set the visibility property.
for i = 1, #songs.children['SongParts'].children do
songs.children['SongParts'].children[i].visible = (i <= partCount)
end
end
end