Skip to content

Instantly share code, notes, and snippets.

@triss
Created August 16, 2013 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save triss/6248658 to your computer and use it in GitHub Desktop.
Save triss/6248658 to your computer and use it in GitHub Desktop.
find last recorded sample in renoise
-- find last recorded sample's instrument index
local function find_last_recorded_sample_instrument_index()
local max = 0
local last_recorded_i
for i, inst in ipairs(rs.instruments) do
local recording_num = string.match(inst.name, "Recorded Sample (%d+)")
if recording_num then
if max < recording_num then
max = recording_num
last_recorded_i = i
end
end
end
return last_recorded_i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment