Given the complexity of Renoise, it is quite possible that there is no reasonable way to obtain the following:
The intention is to introduce very quickly in a table the BPM values of each line along all the patterns of the whole song according to the sequence. Thus, said table will be used to consult it for a cumulative time calculation function.
This is an experiment that I have done:
local function sleep(ms)
local sec=tonumber(os.clock()+ms)
while (os.clock()<sec) do
end
end
local function rec_bpm_lpb()
local song=renoise.song()
local trn=song.transport
local tbl_bpm={}
local tbl_lpb={}
local ssq=song.sequencer
for seq=1,#ssq.pattern_sequence do
song.selected_sequence_index=seq
tbl_bpm[seq]={}
local nol=song:pattern(ssq:pattern(seq)).number_of_lines
song.selected_line_index=1
for l=1,nol do
tbl_bpm[seq][l]=trn.bpm
sleep(0.050)
if l<nol then
song.selected_line_index=l+1
end
end
end
rprint(tbl_bpm)
end
rec_bpm_lpb()
This function is excessively slow because it is not possible to extract the BPM value per line quickly (that’s why the function uses a sleep).
…
This implies 2 things:
- Attend to the BPM values of the automation editor (something extremely complicated, because they are not the value of the points, but the value of the ramps in each line)
- And the ZTxx effects of all the lines (always take as priority the most right value of the line, in the track that is furthest to the right).
The objective is to create a tool that obtains down all the durations of all the patterns, individual and accumulated. But I’m afraid this is impossible to do.
As far as I have come, I have achieved a reasonably fast tool but only considers the changes for all the effects ZTxx (BPM value) throughout the song, (actually it also contains the changes of all the effects ZLxx (value LPB) ).
But at the moment of involving the BPM values of the automation editor, there does not seem to be any reasonable way. The most unfavorable scenario is 1000 patterns of 512 lines. The tool should calculate everything in a reasonably short time, between 10 or 20 seconds I think it would be quite reasonable.
I think all this is impossible to do. If someone wants to think about it, leave your comments here.
The only way that could be calculated is for the API to offer the exact BPM value of each line, which is a data that depends on its ZTxx effect and its BPM ramps from the automation editor.
It would imply having a record of:
- renoise.song (): pattern (p_idx): track (t_idx): line (l_idx) .bpm_value
- renoise.song (): pattern (p_idx): track (t_idx): line (l_idx) .lpb_value
- renoise.song (): pattern (p_idx): track (t_idx): line (l_idx) .tpl_value
Renoise does not have a vertical timeline in the sequence (left panel), where a cumulative time clock is detailed by pattern (let alone per line). And unfortunately there is no way to create a tool for this purpose, as far as I know.
Still other parameters exist that influence the duration of the song, and therefore in all the times accumulated by each line. This still complicates things more.
Has anyone ever tried something like this (create a tool that calculates the accumulated times of the song with all these factors)?