Tool Request: More Effects

You mean table sort? I guess there is some descending-sorting functionality…? Or some lib doing that: Programming in Lua : 19.3

table.sort(tbl, function(a, b) return a > b end)

The problem is that the value to be modified is the third one (sample_value):

renoise.song().instruments[].samples[].sample_buffer:set_sample_data(
  channel_index, frame_index, sample_value)

How do you invest that table without losing the opposite value, just with an operation? At the time of creating another table and deposit the values already double the number of operations.

@neinMC Where did you see that it is possible to access the cursor position of the sample from the API?

I have not seen it anywhere. But this seems fundamental to me to be able to build tools to generate waves, or rather, to modify existing waves.

The cursor position is not the same as the start of the sample selection. The cursor position always exists when there is a buffer. Sample selection may or may not exist.

Sorry, I mixed that up, my bad :confused:

Maybe i miss the whole point here, but what is wrong with effect command:

-Bxx - Play phrase backwards (xx = 00) or forwards (xx = 01)

You can even combine this with,

-Sxx - Trigger phrase from line xx

to play the sample backwards at a specific point.

1 Like

Exactly what I wrote. It’s a small lua optimization that requires only one iteration, but the amount of sample access will be the same.

In effect, that’s the same as doing:

local temp_a = a
a = b
b = temp_a

Do it like that and you’ll optimize it a tad further. It might cut some millisecond off on large samples :wink: Iirc, you’re also cutting a bit by localizing temp_a outside the loop and re-using it all the time, but I can’t vouch for that.

(maybe this topic should be broken-out)