The parameter sample_buffer.display_start is read only.
Writing to it gives the following error:
>>> renoise.song().selected_sample.sample_buffer.display_start = 1
*** std::logic_error: 'invalid display_start index '1'. no display_start's are available. 0 may be allowed.'
*** stack traceback:
*** [C]: ?
*** [C]: in function '__newindex'
*** [string "do..."]:22: in function
*** [string "renoise.song().selected_sample.sample_buffe..."]:1: in main chunk
Trying to set display_start when there is no sample results in the following:
*** std::logic_error: 'can not access properties of a sample buffer with no sample data.'
*** stack traceback:
*** [C]: ?
*** [C]: in function '__index'
*** [string "do..."]:36: in function
*** TestPad.lua:3: in main chunk
Load a sample into an instrument (I just dragged from the filebrowser into the sample editor window).
Then the following will occur:
>>> oprint(renoise.song().selected_sample.sample_buffer.display_length)
160364
>>> renoise.song().selected_sample.sample_buffer.display_start = 20000
*** std::logic_error: 'invalid display_start index '20000'. no display_start's are available. 0 may be allowed.'
*** stack traceback:
*** [C]: ?
*** [C]: in function '__newindex'
*** [string "do..."]:22: in function
*** [string "renoise.song().selected_sample.sample_buffe..."]:1: in main chunk
>>> renoise.song().selected_sample.sample_buffer.display_length = 20000
>>> renoise.song().selected_sample.sample_buffer.display_start = 10000
It looks like you cannot set display_start until you set display_length.
Yes, you can not set a “display_start” which would invalidate the end, would move it past the right boundary of the sample because of the “display_length”.
Probably should not be so picky here and internally clip the length then, or even remove “display_start” property completely in favor of “display_range”.
So for now use “display_range” instead please, which allows setting both properties atomically.