Jump to content


Photo

New Library (3.0): "vLib", a UI library for Renoise


  • Please log in to reply
24 replies to this topic

#1 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 22 June 2015 - 21:34

Say hello to vLib, a library for building user interfaces with the Renoise API
 
The groundwork was done during the development of Redux, as I was collecting presets and organizing content for the release. 
To do that, I started to remake the XRNI-merger - the original tool is still online, but it's a monster - 3000 lines of code, and hardly re-usable. 
 
So I decided to split the user-interface into a separate project, and expand on it. vLib is the result of these efforts. 
 
Basically, it contains a number of widgets that you can use in your own tools, with a syntax that lies very close to the Renoise Viewbuilder API. 
 
For example, this is the code you need to create a hierarchical tree widget: 
-- include class files
_vlibroot = "classes/vLib/"
require (_vlibroot.."vLib")
require (_vlibroot.."vTree")

vtree = vTree{
  vb = vb,
  id = "vTree",
  width = 340,
  height = 200,
  num_rows = 12,
  data = {
    name = "Root",
    {
      name = "Node",
      expanded = true, -- initial state of this node/branch
      {
        name = "Item #1",
      },
      {
        name = "Item #2",
      }
    },
  },
}

-- once created, we can add it to an existing view 
viewbuilder_view:add_child(vtree.view)
 
Of course, you can change it's properties after having created it. The vTree even supports seamless loading of XML files, I have tried loading an entire Renoise song into it (it was slow, but it worked...) 
 
A functional demo of all components is included with the library - you can launch it by choosing "vLib Demo" from the tools menu after having installed the tool.
 
Here is a screenshot of the vTree page in the demo tool. 
 
vLib_demo.png
 
 
Other useful components include full-blown grid/table component (vTable), a graph and more. And the demo allows you to access most, if not all properties and methods of each component and change them in realtime. 
 
For now, I will just release vLib as it is. I have found it to be quite solid and fundamental changes to it's design are not likely to happen. I do have plenty of ideas for optimizations, but this is also not a reason to hold back. 
 
If you encounter a bug, have ideas for the library, or want to use it in your own projects, this is the place to discuss it  :)
 
Source is available on Github
HTML-formatted documentation can be found here
  • jiku, Ledger, afta8 and 7 others like this

Tracking with Stuff. API wishlist | Soundcloud


#2 Neurogami

Neurogami

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 511 posts
  • Gender:Male
  • Location:Scottsdale AZ
  • Interests:Art, music, technology

Posted 22 June 2015 - 22:21

Oh snap.  Sweet.  Thanks for this.  

 

Please now make each day a few hours longer so I have time to play with this. :)



#3 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 22 June 2015 - 22:39

@Neurogami: since summer solstice was yesterday, I'm afraid the opposite is true  :P

 

On a more general note, it's interesting to see how far we can push things using pure lua.

Performance is a key issue here, and especially the vGraph is absolutely killing my old netbook...but I have some ideas on how to improve that. 

 

Additional native components would be great, but nothing we could realistically expect would be as flexible as (for example) the current state of the vTable. In fact, I think a project like vLib is great for discovering exactly which things we need (i.e. a drawable canvas, luajit) and which things we don't necessarily need (a table/grid editor)


  • Neurogami likes this

Tracking with Stuff. API wishlist | Soundcloud


#4 toblerpone

toblerpone

    Guruh Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 901 posts
  • Gender:Not Telling
  • Location::c

Posted 23 June 2015 - 11:52

vGraph worked far better than I expected, this is neat



#5 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 23 June 2015 - 15:00

It just occurred to me that we can simulate clickable text by inserting a hidden checkbox in front of the text.

This is so, because the viewbuilder API basically hardwires a checkbox to any text immediately following it - the text then acts as a label 

 

What this means in practice is that e.g. the vTree or VFileBrowser can be made to act much more like the Renoise counterpart :-)

 

Edit #1: implemented this change to vTree, and made it selectable. 

Edit #2: Source is now on github. 


  • Neurogami likes this

Tracking with Stuff. API wishlist | Soundcloud


#6 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2754 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 24 June 2015 - 13:11

Hi, does the vTree support drag'n'drop events? 



#7 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 24 June 2015 - 15:59

Hi, does the vTree support drag'n'drop events? 

 

No, it's impossible to track the mouse position, so this is a no-go. 

 

You are looking for the ability to re-arrange items somehow? 


Tracking with Stuff. API wishlist | Soundcloud


#8 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2754 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 24 June 2015 - 16:28

You are looking for the ability to re-arrange items somehow? 

Yes exactly, I was thinking about an alternative plugin tree where drag'n'drop works....



#9 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 24 June 2015 - 23:28

Well, in an alternative-alternative reality where mice does not exist, we could make this happen with the keyboard.

Essentially, copy+paste with ability to insert at the selected node. Could even make it so that an item can't be pasted, but only shuffled around. 

 

But, regardless of what is done - the proper solution would require some kind of focus and clipboard management for vLib. 

Otherwise, it couldn't answer a simple question such as "what item did we just copy?" reliably when multiple trees or tables were present. 

 

As always, one idea leads to the next  :lol:


Tracking with Stuff. API wishlist | Soundcloud


#10 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2754 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 24 June 2015 - 23:40

Hehe.  Anyway cool worx, as always.



#11 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

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

Posted 18 August 2015 - 17:36

Looks great,

 

got me some learning to do!


--> 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


#12 kopias

kopias

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 153 posts
  • Gender:Male
  • Location:Łask, Poland

Posted 06 October 2015 - 08:01

Do i need to copy vlib classes to my tool folder or maybe I can import it from tools (after installing it as a tool)?



#13 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 06 October 2015 - 15:33

vLib is not (yet) a "real" library in the sense that it's not distributed along with Renoise.
And even if it was, this is what the info on the github repository has to say about that: 
 

Note: Distributed XRNX files should never rely on ANY external Libraries!! If your tools depends on a library, copy and paste this library locally into your tool before distributing it: make sure your distributed tools are always self-contained! The "Libraries" folder should only used temporarily for developers who are working with the trunk.


So, take a copy of the vLib classes, don't rely on the vLib as tool/library

Tracking with Stuff. API wishlist | Soundcloud


#14 harrynguyen

harrynguyen

    New Member

  • Normal Members
  • Pip
  • 1 posts
  • Gender:Male
  • Interests:Reading :)

Posted 08 October 2015 - 08:32

Oh, it's so great

Please now make each day a few hours longer so I will have time to do with this :)
Thanks for your sharing.

Edited by harrynguyen, 08 October 2015 - 08:33.


#15 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 08 October 2015 - 16:58

Please now make each day a few hours longer so I have time to play with this. :)

 

Please now make each day a few hours longer so I will have time to do with this :)

 

Ah, I thought I was having a deja vu here...

 

We could take vLib to the southern hemiphere where days are now becoming longer? 

Here in Berlin, I'm afraid the opposite is true for the next few months. But then, autumn and winter is a good chance to actually get something done...


  • Neurogami likes this

Tracking with Stuff. API wishlist | Soundcloud


#16 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2754 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 22 August 2016 - 16:54

Hey danoise,

can add a simple color picker control, similar to the xStream's one?

#17 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 23 August 2016 - 09:35

The color picker is part of the vPrompt class:

https://github.com/r...vPrompt.lua#L58

 

This is the one xStream is using, supply a callback function and the dialog will take care of itself.

For example: https://github.com/r...reamUI.lua#L749


  • ffx likes this

Tracking with Stuff. API wishlist | Soundcloud


#18 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2754 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 23 August 2016 - 21:36

Thanks! 

 

mmmh, vlib doesn't seem to update thru renoise tool updater?

 

Does it require xlib, too?  Used github version...


Edited by ffx, 23 August 2016 - 22:09.


#19 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 24 August 2016 - 17:42

No xLib dependancies, no. It does make use of vColor though (try it - your script will complain about missing required files).

Speaking of tool updater: this only works when publishing the tool on http://www.renoise.com/tools ...

Tracking with Stuff. API wishlist | Soundcloud


#20 ffx

ffx

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2754 posts
  • Gender:Not Telling
  • Interests:Renoise Sidechain

Posted 24 August 2016 - 18:20

Hm, but it states different, xLib missing. Wanted to make a sortable vtable, first column a editable textfield, second an editable color field, sortable by contents of first field.... I guess not possible?



#21 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 25 August 2016 - 11:28

Well, OK...something is making use of xLib then. Should be obvious from the error message?
You can get xLib from github as well (here). I suspect you'll only need the core class (which is just a bunch of handy functions really).

And any kind of custom sorting you'd have to implement yourself (manipulate the 'data' property and pass it over to the table).


Tracking with Stuff. API wishlist | Soundcloud


#22 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 29 August 2016 - 21:08

Can see now that I'm using bits of code here and there from xLib, so I've begun refactoring things a bit...

I'm now aiming for three general-purpose libraries instead of the current two: 

 

vLib - additional GUI elements for Renoise + other visual things (colorspace converters, such stuff)

xLib - everything specific to manipulating the Renoise document (and built on top of it...)

cLib - the new core library, basic data manipulation, methods and parsers


  • ffx, EnergyCrush and Raul (ulneiz) like this

Tracking with Stuff. API wishlist | Soundcloud


#23 The_Traveler

The_Traveler

    Advanced Member

  • Normal Members
  • PipPipPip
  • 109 posts
  • Gender:Male
  • Interests:Exploring timbrality ...

Posted 29 January 2017 - 23:18

Just curious danoise, but how are you progressing with your separation and refactoring?



#24 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6069 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 30 January 2017 - 16:04

I did the major work in the autumn, and most of my "library based" tools should be using the new structure.

At least, they will, as I push out new updates. 

 

https://github.com/r...noise.cLib.xrnx

https://github.com/r...noise.vLib.xrnx

https://github.com/r...noise.xLib.xrnx

 

The big beast, which is yet to receive the library treatment, is Duplex. Planning to give that one some love soon, too  :)


Tracking with Stuff. API wishlist | Soundcloud


#25 The_Traveler

The_Traveler

    Advanced Member

  • Normal Members
  • PipPipPip
  • 109 posts
  • Gender:Male
  • Interests:Exploring timbrality ...

Posted 05 February 2017 - 00:48

Wonderful! Thanks for the links too. :)