Creating The Gui For A Tool Or Scripting?

I dont know how but I have missed it or not found it in the forum… I have renoise 2.6.1 and have enabled the show scripting development tools and can view and edit form the menu but how do you design the graphical layout of your view… please any help would be great!!!

For building a GUI for a tool see the Renoise.ViewBuilder.API.lua from the documentation files.

Thanks, so I guess its done via scripting no GUI to edit with?

i think i need to install LUA!.. wish there was a clear how to for people wanting to start creating tools. Maybe there is but its just not clear enough, I also did not find any online video tutorials (sucks!) anyways on my way now lets see how far I get!..

OK installed LUA on OSX using this link http://devthought.com/2009/03/17/how-to-install-lua-5-in-mac-os-x-leopard/
and i get an error when I try and execute the testpad script …

computername:~ username$ /var/folders/6u/6uEi9hX9E4KTWIqJmoRMSU+++TI/-Tmp-/Renoise-13074/Renoise_TmpFile-0-5.tmp.command ; exit;
lua: …Resources/Scripts/Libraries//remdebug/controller.lua:7: module ‘socket’ not found:
no field package.preload[‘socket’]
no file ‘./socket.lua’
no file ‘/usr/local/share/lua/5.1/socket.lua’
no file ‘/usr/local/share/lua/5.1/socket/init.lua’
no file ‘/usr/local/lib/lua/5.1/socket.lua’
no file ‘/usr/local/lib/lua/5.1/socket/init.lua’
no file ‘./socket.so’
no file ‘/usr/local/lib/lua/5.1/socket.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
stack traceback:
[C]: in function ‘require’
…Resources/Scripts/Libraries//remdebug/controller.lua:7: in main chunk
[C]: ?

** Failed to lauch the controller. Please make sure that Lua for Max OSX is installed.
logout

SO I Im thinking maybe LUA is incorrectly installed…this is hard and I have not even begun to write a script…I feel like giving up!

ok so I thought I was missing luasocket and i went here http://luaforge.net/projects/luasocket/ downloaded it unpacked tried to compile and failed with this error

ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [socket.so.2.0.2] Error 1
make: *** [all] Error 2

OK again I just discovered you need to have luasocket also configured for osx before compiling

edited the config file by uncommenting the osx part and commenting the linux part like this…

#------

Compiler and linker settings

for Mac OS X

CC=gcc
DEF= -DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common
LDFLAGS=-bundle -undefined dynamic_lookup
LD=export MACOSX_DEPLOYMENT_TARGET=“10.3”; gcc

#------

Compiler and linker settings

for Linux

#CC=gcc
#DEF=-DLUASOCKET_DEBUG
#CFLAGS= $(LUAINC) $(DEF) -pedantic -Wall -O2 -fpic
#LDFLAGS=-O -shared -fpic
#LD=gcc

compiled and installed (make) (make install)

now i can execute the testpad.lua

and

If Lua is correctly installed on your system, and remdebug was found, Renoise
should be frozen now, with a terminal window opened showing something like:

“Lua Remote Debugger”
“Paused at file RENOISE_PREFERENCES_FOLDER/Scripts/TestPad.lua line 5”

1 debug.start()
2
3 local function sum(a, B)
4 return a + b
5*** end
6
7 local c = sum(1, 2)
8 print©
9
10 debug.stop()

dont know where to go from here …
I have copied an existing tool and Im changing it into my own but I think this is not the best way to go about it. Can anybody please help!

lua come with renoise you don’t need to install it yourself
please see renoise lua scripting for more help
if you “have enabled the show scripting development tools and can view and edit form the menu” has you say in your firth post you have everything you need

ok so Im on my way designed some of the GUI thanks to the Renoise.Viewbuilder.API.lua and looking at various other people’s tools.

here is what it looks like so far

Looking good. Keep it up. :)

Here is the latest update… still need to add the functioning part behinde all the interface… hopefully this will make it easier for people out there who are mpc users to make the transition to renoise withouth having to buy expensive sample vst’s

Im trying to bind the valuebox for bpm for example and im having no luck…anybody?

  
function bpm_changed()  
 print(("something changed the BPM to %s"):format(renoise.song().transport.bpm))  
 -- Your code here?  
end  
  
renoise.song().transport.bpm_observable:add_notifier(bpm_changed)  
-- later on, maybe:  
renoise.song().transport.bpm_observable:remove_notifier(bpm_changed)  
  

Cut and paste from: https://code.google.com/p/xrnx/source/browse/trunk/Documentation/Renoise.Document.API.lua

Look for the section on Observables?

looks quite interesting, but what will this tool actually do? im too stupid to figure it out :)

the idea is to have an interface much like the AKAI mpc 2000xl to help people who own or have owned to make an easier transition into using renoise! It offers transport controls and acess to song features through a recognizable interface.

I have had simplify it a little for now and Im having trouble with bind values I cant seem to bind and observable object > no matter what I try! help!

An example code snippet / more details would help…

ok here is a snippet, I just cant figure this out

i can change the bpm in renoise from my tool but is I change the bpm in renoise my toll does not update… any help would e greatly appreciated

local options = renoise.Document.create(“ScriptingToolPreferences”) {
min = 32,
bpm = true,
flag = false,

vb:valuebox {
id = “beatpm”,
value = renoise.song().transport.bpm,
notifier = function(bp)
renoise.song().transport.bpm = bp
end,
bind = options.bpm_observable,
min = 32,
max = 999,
},

ok tried this too and still an epic fail!

vb:valuebox {
id = “beatpm”,
value = renoise.song().transport.bpm,
notifier = function(bp)
renoise.song().transport.bpm = bp
end,
bind = renoise.Document.bpm_observable,
min = 32,
max = 999,
},

If this is your code, then the reason is that you initiated value to the BPM at the time you initiated the GUI.

AFAIK this is not a pointer to the bpm objet or anything like that, rather its just the returned float at the time.

I would suggest an observer, something like:

  
--  
-- vb:valuebox declared before this snippet  
--  
function bpm_changed()  
 vb.views.beatpm.value = renoise.song().transport.bpm  
end  
renoise.song().transport.bpm_observable:add_notifier(bpm_changed)  
  

Hope this helps.

It WORKS! Thankyou so much! Im including you in the credits of this tool!

Just over a month and its ready…well in beta phase anyway has some bugs but will work them out over time.

Amayshing work. Will you post a video?