Trouble passing options to renoise.song():render()?

Hey all I’m not having luck passing the options array into renoise.song():render(). In the code below it renders but the file is always 32 bit and ignores the start/end positions which I think? I’m inputting like it wants.

function rendering_done_callback()
    renoise.app():show_message("done")
end

filename = "C:\\Users\\Public\\test.wav"

star = renoise.SongPos(1,1)
en = renoise.SongPos(2,1)

options = {
  star,    
  en,       
  44100,                       
  16 ,    
  'default', 
  'high',       }
  
renoise.song():render(options, filename, rendering_done_callback)

--options = {
--       start_pos,     -- renoise.SongPos object. by default the song start.
--       end_pos,       -- renoise.SongPos object. by default the song end.
--       sample_rate,   -- one of 22050, 44100, 48000, 88200, 96000, 192000. \
--                      -- by default the players current rate.
--       bit_depth ,    -- number, one of 16, 24 or 32. by default 32.
--       interpolation, -- string, one of 'default', 'precise'. by default default'.
--       priority,      -- string, one "low", "realtime", "high". \
--                      -- by default "high".
--     }

Don’t ask (no lua expert), but what I’d give a go is:

function rendering_done_callback()
    renoise.app():show_message("done")
end

filename = "C:\\Users\\Public\\test.wav"

star = renoise.SongPos(1,1)
en = renoise.SongPos(2,1)

options = {
  ["start_pos"] = star,
  ["end_pos"] = en,
  ["sample_rate"] = 44100,
  ["bit_depth"] = 16,
  ["interpolation"] = 'default',
  ["priority"] = "high"
  }
  
renoise.song():render(options, filename, rendering_done_callback)
1 Like

You probably just have to respect the names when filling in the table:

options = {
  start_pos = star,
  end_pos = en,
  ...
}
1 Like

awesome, both those suggestions work, thanks!

rns = renoise.song()

function rendering_done_callback()
    renoise.app():show_message("done")
end

filename = "C:\\Users\\Public\\test.wav"

star = renoise.SongPos(1,1)
en = renoise.SongPos(5,1)

options = {
  start_pos = star,    
  end_pos = en,       
  sample_rate = 44100,                       
  bit_depth = 16 ,    
  interpolation = 'default', 
  priority = 'high',       }
  
rns:render(options, filename, rendering_done_callback)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.