How to set button width? How to create a slider?

Hi, I have about 16 buttons in a GUI - how do I set their width so that it’s not set by the textual content of the button?

Also, is vb:slider really not the method of calling/creating a slider?

local vb = renoise.ViewBuilder()

local my_content = vb:column {

  vb:button {
    width = 100
  },

  vb:button {
    width = "50%"
  },

  vb:slider { },

  vb:minislider { }

}
local vb = renoise.ViewBuilder()

local my_content = vb:column {

vb:button {
width = 100
},
vb:button {
width = "50%"
},
vb:slider { },
vb:minislider { }
}

awesome! but i guess there’s a method of making a slider vertical, too?

Thanks a lot, though! i mean, i think there used to be some sort of example documentation going on where there were different types of sliders?

query, is there some way of making a global setting for vb:button ? so I don’t need to have 30 places have vb:button {width=50} for instance?

vb:button {width=50,

phew, was able to solve it

local globalwidth=50
local wikibutton= vb:button {width=globalwidth

The sliders will auto-adjust to vertical or horizontal depending on what width and height values you set.

hmm. i’m trying to figure out how to make a slider write to the pattern, i’m beating my head on the wall with this

local effect_slider = vb:column {vb:minislider{id="effectslider", width=30,height=127}}

function effectslide()
print (vb.views["effectslider"].value)
renoise.song().selected_track.delay_column_visible=true
renoise.song().selected_track.delay_column_value = vb.views["effectslider"].value
end

what in the world am i missing here?

  1. renoise.song().selected_track.delay_column_value is invalid. Track objects store properties for the track (thru-out the song). You want to look at patterntracks instead, which stores things like note data per pattern per track.

Delay column values would be in renoise.song().selected_pattern_track.lines[].note_columns[].delay_value

  1. You might also have to convert the floating value output from the slider. Using math.floor should suffice. (Maybe I’m wrong, and this is done automatically)
  1. renoise.song().selected_track.delay_column_value is invalid. Track objects store properties for the track (thru-out the song). You want to look at patterntracks instead, which stores things like note data per pattern per track.

Delay column values would be in renoise.song().selected_pattern_track.lines[].note_columns[].delay_value

  1. You might also have to convert the floating value output from the slider. Using math.floor should suffice. (Maybe I’m wrong, and this is done automatically)

Hi Joule, okay, I tried like this:

renoise.song().selected_note_column.delay_value = vb.views["effectslider"].value

But I’m not sure how vb.views then writes to it, or what kind of notifier or something i need to call when the id=effectslider slider content changes.

If you want it to auto-update whenever you move the slider, it’s easiest to use the notifier available in ViewBuilder controls.

vb:minislider {
  min = 0,
  max = 255,
  notifier = function(v)
    if renoise.song().selected_note_column then -- don't trigger error when in non-sequence track
      renoise.song().selected_note_column.delay_value = v
    end
  end
}

(My opinion, above beginner level: ID’s are mostly useful if you do dynamic stuff or somehow need multiple things to happen in a badly structured code :wink: I consider them ad-hoc and prefer containing these things in class structures where vb objects are accessed directly via variables/properties)

If you want it to auto-update whenever you move the slider, it’s easiest to use the notifier available in ViewBuilder controls.

vb:minislider {
min = 0,
max = 255,
notifier = function(v)
if renoise.song().selected_note_column then -- don't trigger error when in non-sequence track
renoise.song().selected_note_column.delay_value = v
end
end
}

(My opinion, above beginner level: ID’s are mostly useful if you do dynamic stuff or somehow need multiple things to happen in a badly structured code :wink: I consider them ad-hoc and prefer containing these things in class structures where vb objects are accessed directly via variables/properties)

Thank you, that totally made sense - I’m now able to map a slider to a specific place, in this case, panning_value. Now I guess it’s back to figuring out how to write to the effectcolumn amount, even if cursor is on notecolumn. thanks! this really helps. i had no idea how this was supposed to go, but you helped a great deal, Joule.