My first thoughts are to emulate direct access to the octave field via a shortcut and numrow taking into account the current step length, and provide a direct shortcut(s) for mix-paste data methods without having to mouse click the little mixpaste check box to switch to mixpaste mode.
Important for emulating direct access to the octave column will be reading and changing the data currently under the cursor, however reading through the docs and other scripts, I only see ways to edit an entire track, or a current selection. What is under the cursor is not considered a selection unless it is clicked on or manually selected by holding shift and hitting an arrow key.
Currently I can read all the data currently under the cursor using:
notedata = renoise.song().selected_note_column
but this is considered userdata, not string data which may be broken up and manipulated.
Thanks! My main concern was that access to note data under the cursor, but not selected, might be neglected from being manipulated in ways I have seen other scripts use the various iteration methods to perform similar changes I have in mind. When googling info about userdata, most of the results read like: Userdata values cannot be created or modified in Lua, only through the C API.
[luabox]
– Thanks to suva for the function per octave declaration loop
– http://www.protman.com
function ProcessOctave(new_octave)
local new_pos = 0
local song = renoise.song()
local editstep = renoise.song().transport.edit_step
new_pos = song.transport.edit_pos
if song.selected_note_column.note_value < 120 then
song.selected_note_column.note_value = song.selected_note_column.note_value % 12 + (12 * new_octave)
end
new_pos.line = new_pos.line + editstep
if new_pos.line <= song.selected_pattern.number_of_lines then
song.transport.edit_pos = new_pos
end
end
for oct=0,9 do
renoise.tool():add_keybinding {
name = "Pattern Editor:Pattern:Set Note to Octave " … oct,
invoke = function() ProcessOctave(oct) end
}
end