Not sure what the issue is with the point settings, will try to find time to dig into it, I haven’t yet had the chance to get into the API for 3.1
Hi afta8, no trouble
Just quickly, this function:
-- Add a new point value (or replace any existing value) at time.
renoise.song().instruments[].sample_modulation_sets[].devices[]:add_point_at(time, value)
If I call that with a value greater than MAX_NUMBER_OF_POINTS (which is set at 6144 (6.144 seconds) ) I get:
>>> renoise.song().instruments[1].sample_modulation_sets[1].devices[1]:add_point_at(6145,0)
*** std::logic_error: 'envelope.point: invalid point time. time must be >= 1 and <= MAX_NUMBER_OF_POINTS'
So it is next to impossible to add a point to the envelope up to 16.38 seconds. Also to complicate the issue, via the GUI you can kinda add points to the envelope up to 38.4 seconds of time
Anyway that’s more a Taktik thing (which we won’t go into because, well, Taktik certainly isn’t )
(The following is assuming the current download in Post #10…)
Now to bore you to death with silly technical nonsense afta8
Watching Djeroek run your 2.8 version of this tool was painful, so I figured I’d try and help the man out a little (hope you don’t mind ) So 10-15 minutes later I put in a For loop that crudely scans for a Volume/Pan/Pitch envelope device in modulation set 1 (See lines 46-56 of main.lua). Works okay, well for what Djeroek needs for his experiments anyway, but naturally it isn’t amazingly solid and bullet proof. You would probably have some sort of GUI where the user can select the target envelope device(s) or something of that nature.
Now unfortunately I was kinda hoping that your math would hold up, wishful thinking on my part. I never programmed 2.8 envelopes but I assume it worked in ‘ticks’ (looking at your math.) It works in milliseconds now, so I had to think about how to calculate this. Luckily you wrapped your calculation part in a local function, I’ve modified it to now read (lines 126-135):
-- Function to return an envelope time position for a given pattern line number and delay value
local function env_tick(line, delay)
local line_ticks = ((((line-1)/lpb)/bpm)*60000)+1
local delay_ticks = ((((1/lpb)/bpm)*60000)/256)*delay
if line_ticks > renoise.SampleEnvelopeModulationDevice.MAX_NUMBER_OF_POINTS then
line_ticks = 0
return line_ticks
else
return line_ticks + delay_ticks
end
end
Now I don’t know, I just came up with that quickly (but you would probably do it better and differently than that.)
That’s about it modification wise. The only other thing is line 152, which at the moment reads:
note = ((note-1)%24+1)/24 -- Convert note pitch to envelope value
That is your original conversion from a Renoise note to a pitch value. Thing is you could probably do that better now, as Renoise caters for up to 96 semitones (8 octaves) on its pitch envelope? Something to think about Also I haven’t verified if the volume or pan calculation works correctly in Renoise 3.1.
My God, that is a boring read