Difficulties using "i" as a variable

Hi, apparently I can only really use i for numbers, instead of i=a and then 0A00 gets output. I’m shocked I got this far, but just can’t handle 0a00-0f00 not working. What should I use to replace the “local i=F” which doesn’t work ;)

← ok this image seems to be missing unfortunately

function krooh()  
local vb=renoise.ViewBuilder()  
  
local arpeggio="00xy"  
local arpeggiotooltip="00xy - Arpeggio (x=base note offset1, y=base noteoffset 2) *"  
local arpeggiobutton= vb:button { text=arpeggio,  
 tooltip=arpeggiotooltip,  
 pressed = function() effect_arpeggio()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}, vb:text {text=arpeggiotooltip}  
  
local pitchslideup="01xx"  
local pitchslideuptooltip="01xx - Pitch Slide up (00-FF) *"  
local pitchslideupbutton = vb:button {text=pitchslideup,  
 tooltip=pitchslideuptooltip,  
 pressed = function() effect_pitchslideup()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local pitchslidedown="02xx"  
local pitchslidedowntooltip="02xx - Pitch Slide down (00-FF) *"  
local pitchslidedownbutton=vb:button { text=pitchslidedown,  
 tooltip=pitchslidedowntooltip,  
 pressed = function() effect_pitchslidedown()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
  local setchannelvol="03xx"  
local setchannelvoltooltip="03xx - Set Channel volume (00-FF)"  
local setchannelvolbutton=vb:button { text=setchannelvol,  
 tooltip=setchannelvoltooltip,  
 pressed = function() effect_channelvolume()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local volumeslicer="04xy"  
local volumeslicertooltip="04xy - Volume slicer x=factor (0=0.0, F=1.0), slice at tick y. *"  
local volumeslicerbutton=vb:button { text=volumeslicer,  
 tooltip=volumeslicertooltip,  
 pressed = function() effect_volumeslicer()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local glidetonote="05xx"  
local glidetonotetooltip="05xx - Glide to note with step xx (00-FF)*"   
local glidetonotebutton=vb:button { text=glidetonote,  
 tooltip=glidetonotetooltip,  
 pressed = function() effect_glidetonote()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local volumeslideup="06xx"  
local volumeslideuptooltip="06xx - Volume slide up with step xx (0064) (64x0601 or 2x0632 = slide0-full) *"  
local volumeslideupbutton=vb:button { text=volumeslideup,  
 tooltip=volumeslideuptooltip,  
 pressed = function() effect_volumeslideup()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local volumeslidedown="07xx"  
local volumeslidedowntooltip="07xx - Volume slide down with step xx (0064) *"  
local volumeslidedownbutton=vb:button { text=volumeslidedown,  
 tooltip=volumeslidedowntooltip,  
 pressed = function() effect_volumeslidedown()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local setpanning="08xx"  
local setpanningtooltip="08xx - Set panning (00-FF) (00: left; 80: center; FF: right)"  
local setpanningbutton=vb:button { text=setpanning,  
 tooltip=setpanningtooltip,  
 pressed = function() effect_setpanning()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local triggersample="09xx"  
local triggersampletooltip="09xx - Trigger sample offset, 00 is sample start, FF is sample end. *"  
local triggersamplebutton=vb:button { text=triggersample,  
 tooltip=triggersampletooltip,  
 pressed = function() effect_sampleoffset()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local surround="0Axx"  
local surroundtooltip="0Axx - Surround width (00-FF) *"  
local surroundbutton=vb:button { text=surround,  
 tooltip=surroundtooltip,  
 pressed = function() effect_surround()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local playsamplebackwards="0Bxx"  
local playsamplebackwardstooltip="0Bxx - Play sample backwards (B00) or forwards again (B01) *"  
local playsamplebackwardsbutton=vb:button { text=playsamplebackwards,  
 tooltip=playsamplebackwardstooltip,  
 pressed = function() effect_playbackwards()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local settrackvolume="0Cxx"  
local settrackvolumetooltip="0Cxx - Set track-volume (00-FF)"  
local settrackvolumebutton=vb:button { text=settrackvolume,  
 tooltip=settrackvolumetooltip,  
 pressed = function() effect_settrackvolume()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local delaynotes="0Dxx"  
local delaynotestooltip="0Dxx - Delay notes in track-row xx ticks before playing. (00-speed)"  
local delaynotesbutton=vb:button { text=delaynotes,  
 tooltip=delaynotestooltip,  
 pressed = function() effect_delaynotes()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local retrig="0Exy"  
local retrigtooltip="0Exy - Retrig notes in track-row every xy ticks (x=volume; y=ticks 0 - speed) **"  
local retrigbutton=vb:button { text=retrig,  
 tooltip=retrigtooltip,  
 pressed = function() effect_retrig()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
  
local vibrato="0Fxy"  
local vibratotooltip="0Fxy - Vibrato x= speed, y = depth; x=(0-F); y=(0-F)*"  
local vibratobutton=vb:button { text=vibrato,  
 tooltip=vibratotooltip,  
 pressed = function() effect_vibrato()  
 renoise.app().window.active_middle_frame = 1  
 renoise.app().window.lock_keyboard_focus=true  
 end}  
-------  
  
local dialog_title = "Nativity Scene v0.01 - Pattern Effect Commands"  
local DEFAULT_MARGIN = renoise.ViewBuilder.DEFAULT_CONTROL_MARGIN  
  
local effect_buttons = vb:column {  
arpeggiobutton,  
pitchslideupbutton,  
pitchslidedownbutton,  
setchannelvolbutton,  
volumeslicerbutton,  
glidetonotebutton,  
volumeslideupbutton,  
volumeslidedownbutton,  
setpanningbutton,  
triggersamplebutton,  
surroundbutton,  
playsamplebackwardsbutton,  
settrackvolumebutton,  
delaynotesbutton,  
retrigbutton,  
vibratobutton}  
  
local effect_desc = vb:column {  
vb:text{text=arpeggiotooltip},  
vb:text{text=pitchslideuptooltip},  
vb:text{text=pitchslidedowntooltip},  
vb:text{text=setchannelvoltooltip},  
vb:text{text=volumeslicertooltip},  
vb:text{text=glidetonotetooltip},  
vb:text{text=volumeslideuptooltip},  
vb:text{text=volumeslidedowntooltip},  
vb:text{text=setpanningtooltip},  
vb:text{text=triggersampletooltip},  
vb:text{text=surroundtooltip},  
vb:text{text=playsamplebackwardstooltip},  
vb:text{text=settrackvolumetooltip},  
vb:text{text=delaynotestooltip},  
vb:text{text=retrigtooltip},  
vb:text{text=vibratotooltip}  
}  
  
 local dialog_content = vb:row {effect_buttons, effect_desc}  
  
 --{vb:column {effect_buttons},{vb:column{effect_desc}}}  
  
 local function my_keyhandler_func(dialog, key)  
 if not (key.modifiers == "" and key.name == "exclamation") then  
 return key  
 else  
 dialog:close()  
 end  
end  
  
 renoise.app():show_custom_dialog(dialog_title, dialog_content,my_keyhandler_func)  
end  
  
 renoise.tool():add_keybinding {  
 name = "Global:Impulse:KRooh",  
 invoke = function() krooh()  
 end }  
  
-----  
--functions+ descriptions + etc + for 16 shortcuts for effects  
--local status="00xy - Arpeggio (x=base note offset1, y=base noteoffset 2) *"  
--local status="01xx - Pitch Slide up (00-FF) *"  
--local status="02xx - Pitch Slide down (00-FF) *"  
--local status="03xx - Set Channel volume (00-FF)"  
--local status="04xy - Volume slicer -- x=factor (0=0.0, F=1.0), slice at tick y. *"  
--local status="05xx - Glide to note with step xx (00-FF)*"   
--local status="06xx - Volume slide up with step xx (0064) (64x0601 or 2x0632 = slide0-full) *"  
--local status="07xx - Volume slide down with step xx (0064) *"  
--local status="08xx - Set panning (00-FF) (00: left; 80: center; FF: right)"  
--local status="09xx - Trigger sample offset, 00 is sample start, FF is sample end. *"  
--local status="0Axx - Surround width (00-FF) *"  
--local status="0Bxx - Play sample backwards (B00) or forwards again (B01) *"  
--local status="0Cxx - Set track-volume (00-FF)"  
--local status="0Dxx - Delay notes in track-row xx ticks before playing. (00-speed)"  
--local status="0Exy - Retrig notes in track-row every xy ticks (x=volume; y=ticks 0 - speed) **"  
--local status="0Fxy - Vibrato x= speed, y = depth; x=(0-F); y=(0-F)*"  
  
--Effect Functions  
  
function effect_arpeggio()  
local s = renoise.song()  
local w = renoise.app().window  
local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
local status="00xy - Arpeggio (x=base note offset1, y=base noteoffset 2) *"  
local i=0  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_pitchslideup()  
local i=1  
local status="01xx - Pitch Slide up (00-FF) *"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_pitchslidedown()  
local i=2  
local status="02xx - Pitch Slide down (00-FF) *"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_channelvolume()  
local s = renoise.song()  
local w = renoise.app().window  
local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
local status="03xx - Set Channel volume (00-FF)"  
local i=3  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_volumeslicer()  
local i=4  
local status="04xy - Volume slicer -- x=factor (0=0.0, F=1.0), slice at tick y. *"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_glidetonote()  
local i=5  
local status="05xx - Glide to note with step xx (00-FF)*"   
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_volumeslideup()  
local s = renoise.song()  
local w = renoise.app().window  
local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
local status="06xx - Volume slide up with step xx (0064) (64x0601 or 2x0632 = slide0-full) *"  
local i=6  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_volumeslidedown()  
local i=7  
local status="07xx - Volume slide down with step xx (0064) *"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_setpanning()  
local i=8  
local status="08xx - Set panning (00-FF) (00: left; 80: center; FF: right)"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_sampleoffset()  
local i=9  
local status="09xx - Trigger sample offset, 00 is sample start, FF is sample end. *"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_surround()  
local i=A  
local status="0Axx - Surround width (00-FF) *"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_playbackwards()  
local i=B  
local status="0Bxx - Play sample backwards (B00) or forwards again (B01) *"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_settrackvolume()  
local i=C  
local status="0Cxx - Set track-volume (00-FF)"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_delaynotes()  
local i=D  
local status="0Dxx - Delay notes in track-row xx ticks before playing. (00-speed)"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_retrig()  
local i=E  
local status="0Exy - Retrig notes in track-row every xy ticks (x=volume; y=ticks 0 - speed) **"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  
  
function effect_vibrato()  
local i=F  
local status="0Fxy - Vibrato x= speed, y = depth; x=(0-F); y=(0-F)*"  
 local s = renoise.song()  
 local w = renoise.app().window  
 local efc = s.selected_effect_column  
 s.selected_effect_column_index=1  
 if efc==nil then  
 return  
 else  
 if efc.number_value==i then  
 efc.number_value=00  
 efc.amount_value=00  
 else  
 efc.number_value=i  
 efc.amount_value=00  
 renoise.app():show_status(status)  
 end  
 w.active_middle_frame = 1  
 w.lock_keyboard_focus = true  
end  
end  

Okay, ended up going the quicker route which was instead of using i=A just replace i with 10 etc.

[details=“Click to view contents”] ```lua

function krooh()
local vb=renoise.ViewBuilder()

local arpeggio=“00xy”
local arpeggiotooltip=“00xy - Arpeggio (x=base note offset1, y=base noteoffset 2) *”
local arpeggiobutton= vb:button { text=arpeggio,
tooltip=arpeggiotooltip,
pressed = function() effect_arpeggio()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}, vb:text {text=arpeggiotooltip}

local pitchslideup=“01xx”
local pitchslideuptooltip=“01xx - Pitch Slide up (00-FF) *”
local pitchslideupbutton = vb:button {text=pitchslideup,
tooltip=pitchslideuptooltip,
pressed = function() effect_pitchslideup()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local pitchslidedown=“02xx”
local pitchslidedowntooltip=“02xx - Pitch Slide down (00-FF) *”
local pitchslidedownbutton=vb:button { text=pitchslidedown,
tooltip=pitchslidedowntooltip,
pressed = function() effect_pitchslidedown()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local setchannelvol=“03xx”
local setchannelvoltooltip=“03xx - Set Channel volume (00-FF)”
local setchannelvolbutton=vb:button { text=setchannelvol,
tooltip=setchannelvoltooltip,
pressed = function() effect_channelvolume()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local volumeslicer=“04xy”
local volumeslicertooltip=“04xy - Volume slicer x=factor (0=0.0, F=1.0), slice at tick y. *”
local volumeslicerbutton=vb:button { text=volumeslicer,
tooltip=volumeslicertooltip,
pressed = function() effect_volumeslicer()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local glidetonote=“05xx”
local glidetonotetooltip=“05xx - Glide to note with step xx (00-FF)*”
local glidetonotebutton=vb:button { text=glidetonote,
tooltip=glidetonotetooltip,
pressed = function() effect_glidetonote()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local volumeslideup=“06xx”
local volumeslideuptooltip=“06xx - Volume slide up with step xx (0064) (64x0601 or 2x0632 = slide0-full) *”
local volumeslideupbutton=vb:button { text=volumeslideup,
tooltip=volumeslideuptooltip,
pressed = function() effect_volumeslideup()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local volumeslidedown=“07xx”
local volumeslidedowntooltip=“07xx - Volume slide down with step xx (0064) *”
local volumeslidedownbutton=vb:button { text=volumeslidedown,
tooltip=volumeslidedowntooltip,
pressed = function() effect_volumeslidedown()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local setpanning=“08xx”
local setpanningtooltip=“08xx - Set panning (00-FF) (00: left; 80: center; FF: right)”
local setpanningbutton=vb:button { text=setpanning,
tooltip=setpanningtooltip,
pressed = function() effect_setpanning()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local triggersample=“09xx”
local triggersampletooltip=“09xx - Trigger sample offset, 00 is sample start, FF is sample end. *”
local triggersamplebutton=vb:button { text=triggersample,
tooltip=triggersampletooltip,
pressed = function() effect_sampleoffset()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local surround=“0Axx”
local surroundtooltip=“0Axx - Surround width (00-FF) *”
local surroundbutton=vb:button { text=surround,
tooltip=surroundtooltip,
pressed = function() effect_surround()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local playsamplebackwards=“0Bxx”
local playsamplebackwardstooltip=“0Bxx - Play sample backwards (B00) or forwards again (B01) *”
local playsamplebackwardsbutton=vb:button { text=playsamplebackwards,
tooltip=playsamplebackwardstooltip,
pressed = function() effect_playbackwards()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local settrackvolume=“0Cxx”
local settrackvolumetooltip=“0Cxx - Set track-volume (00-FF)”
local settrackvolumebutton=vb:button { text=settrackvolume,
tooltip=settrackvolumetooltip,
pressed = function() effect_settrackvolume()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local delaynotes=“0Dxx”
local delaynotestooltip=“0Dxx - Delay notes in track-row xx ticks before playing. (00-speed)”
local delaynotesbutton=vb:button { text=delaynotes,
tooltip=delaynotestooltip,
pressed = function() effect_delaynotes()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local retrig=“0Exy”
local retrigtooltip=“0Exy - Retrig notes in track-row every xy ticks (x=volume; y=ticks 0 - speed) **”
local retrigbutton=vb:button { text=retrig,
tooltip=retrigtooltip,
pressed = function() effect_retrig()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local vibrato=“0Fxy”
local vibratotooltip=“0Fxy - Vibrato x= speed, y = depth; x=(0-F); y=(0-F)*”
local vibratobutton=vb:button { text=vibrato,
tooltip=vibratotooltip,
pressed = function() effect_vibrato()
renoise.app().window.active_middle_frame = 1
renoise.app().window.lock_keyboard_focus=true
end}

local dialog_title = “Nativity Scene v0.01 - Pattern Effect Commands”
local DEFAULT_MARGIN = renoise.ViewBuilder.DEFAULT_CONTROL_MARGIN

local effect_buttons = vb:column {
arpeggiobutton,
pitchslideupbutton,
pitchslidedownbutton,
setchannelvolbutton,
volumeslicerbutton,
glidetonotebutton,
volumeslideupbutton,
volumeslidedownbutton,
setpanningbutton,
triggersamplebutton,
surroundbutton,
playsamplebackwardsbutton,
settrackvolumebutton,
delaynotesbutton,
retrigbutton,
vb:text {text=" 0Exy "},
vibratobutton}

local effect_desc = vb:column {
vb:text{text=arpeggiotooltip},
vb:text{text=pitchslideuptooltip},
vb:text{text=pitchslidedowntooltip},
vb:text{text=setchannelvoltooltip},
vb:text{text=volumeslicertooltip},
vb:text{text=glidetonotetooltip},
vb:text{text=volumeslideuptooltip},
vb:text{text=volumeslidedowntooltip},
vb:text{text=setpanningtooltip},
vb:text{text=triggersampletooltip},
vb:text{text=surroundtooltip},
vb:text{text=playsamplebackwardstooltip},
vb:text{text=settrackvolumetooltip},
vb:text{text=delaynotestooltip},
vb:text{text=retrigtooltip},
vb:text{text="** y= [1. -1] [2. -2] [3. -4] [4. -8] [5. -16] [6. *2/3] [7. *1/2] [8. --] [9. +1] [a. +2] [b. +4] [c. +8] [d. +16] [e. *3/2] [f. *2]"},
vb:text{text=vibratotooltip}
}

local dialog_content = vb:row {effect_buttons, effect_desc}

–{vb:column {effect_buttons},{vb:column{effect_desc}}}

local function my_keyhandler_func(dialog, key)
if not (key.modifiers == “” and key.name == “exclamation”) then
return key
else
dialog:close()
end
end

renoise.app():show_custom_dialog(dialog_title, dialog_content,my_keyhandler_func)
end

renoise.tool():add_keybinding {
name = “Global:Impulse:KRooh”,
invoke = function() krooh()
end }


–functions+ descriptions + etc + for 16 shortcuts for effects
–local status=“00xy - Arpeggio (x=base note offset1, y=base noteoffset 2) *”
–local status=“01xx - Pitch Slide up (00-FF) *”
–local status=“02xx - Pitch Slide down (00-FF) *”
–local status=“03xx - Set Channel volume (00-FF)”
–local status=“04xy - Volume slicer – x=factor (0=0.0, F=1.0), slice at tick y. "
–local status="05xx - Glide to note with step xx (00-FF)

–local status=“06xx - Volume slide up with step xx (0064) (64x0601 or 2x0632 = slide0-full) *”
–local status=“07xx - Volume slide down with step xx (0064) *”
–local status=“08xx - Set panning (00-FF) (00: left; 80: center; FF: right)”
–local status=“09xx - Trigger sample offset, 00 is sample start, FF is sample end. *”
–local status=“0Axx - Surround width (00-FF) *”
–local status=“0Bxx - Play sample backwards (B00) or forwards again (B01) "
–local status=“0Cxx - Set track-volume (00-FF)”
–local status=“0Dxx - Delay notes in track-row xx ticks before playing. (00-speed)”
–local status=“0Exy - Retrig notes in track-row every xy ticks (x=volume; y=ticks 0 - speed) **”
–local status="0Fxy - Vibrato x= speed, y = depth; x=(0-F); y=(0-F)

–Effect Functions

function effect_arpeggio()
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
local status=“00xy - Arpeggio (x=base note offset1, y=base noteoffset 2) *”
local i=0
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_pitchslideup()
local i=1
local status=“01xx - Pitch Slide up (00-FF) *”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_pitchslidedown()
local i=2
local status=“02xx - Pitch Slide down (00-FF) *”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_channelvolume()
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
local status=“03xx - Set Channel volume (00-FF)”
local i=3
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_volumeslicer()
local i=4
local status=“04xy - Volume slicer – x=factor (0=0.0, F=1.0), slice at tick y. *”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_glidetonote()
local i=5
local status=“05xx - Glide to note with step xx (00-FF)*”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_volumeslideup()
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
local status=“06xx - Volume slide up with step xx (0064) (64x0601 or 2x0632 = slide0-full) *”
local i=6
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_volumeslidedown()
local i=7
local status=“07xx - Volume slide down with step xx (0064) *”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_setpanning()
local i=8
local status=“08xx - Set panning (00-FF) (00: left; 80: center; FF: right)”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_sampleoffset()
local i=9
local status=“09xx - Trigger sample offset, 00 is sample start, FF is sample end. *”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==i then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=i
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_surround()
local status=“0Axx - Surround width (00-FF) *”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==10 then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=10
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_playbackwards()
local status=“0Bxx - Play sample backwards (B00) or forwards again (B01) *”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==11 then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=11
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_settrackvolume()
local status=“0Cxx - Set track-volume (00-FF)”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==12 then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=12
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_delaynotes()
local status=“0Dxx - Delay notes in track-row xx ticks before playing. (00-speed)”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==13 then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=13
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_retrig()
local status=“0Exy - Retrig notes in track-row every xy ticks (x=volume; y=ticks 0 - speed) **”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==14 then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=14
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

function effect_vibrato()
local status=“0Fxy - Vibrato x= speed, y = depth; x=(0-F); y=(0-F)*”
local s = renoise.song()
local w = renoise.app().window
local efc = s.selected_effect_column
–s.selected_effect_column_index=1
if efc==nil then
return
else
if efc.number_value==15 then
efc.number_value=00
efc.amount_value=00
else
efc.number_value=15
efc.amount_value=00
renoise.app():show_status(status)
end
w.active_middle_frame = 1
w.lock_keyboard_focus = true
end
end

local i = 0xA

You’re looking for the hexadecimal prefix. “0x” indicating that you are describing a numeric value in a hexadecimal base. By doing “local i = a” you are telling i to reference the variable a so basically you have to define a for this to work.

local a = 10 or 0xA
local i = a

or just simply:
local i = 0xA

Thank you, fixed and works :)

and to translate numbers to hex you can use:
bit.tohex(decimal_number [,digits])
If you don’t supply the amount of digits that the function should return, it returns 8 by default.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.