Here is a part of code that is placed inside notifier function of a button:
local notes_in_selection = {}
local filled_lines = {}
for k = selection.start_line, selection.end_line, 1 do
if song.selected_pattern.tracks[selection.start_track].lines[k].note_columns[selection.start_column].note_value < 120 then
table.insert(notes_in_selection, song.selected_pattern.tracks[selection.start_track].lines[k].note_columns[selection.start_column])
table.insert(filled_lines, k)
end
end
I want to create table with all notes in the 1st column of selection, and table with respective numbers of lines. After that goes the code that deletes these notes in pattern, but they are supposed to remain stored in tables. The problem is that they disappear from tables too. How to solve this issue?
EDIT: I guess I should add that I need this tables only during one execution of this function, i.e. store the original notes, then clear selection, then fill it with new notes with values from tables. It’s like quantization.