Created
August 16, 2013 09:59
-
-
Save triss/6248658 to your computer and use it in GitHub Desktop.
find last recorded sample in renoise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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