Hello Renoise community,
I am reaching out to seek your expertise and assistance in creating a custom rendering tool for Renoise. I must admit that I am not proficient in scripting, but I have been experimenting with tools like GPT to enhance my understanding.
My goal is to develop a tool that mimics the functionality of the default rendering tool in Renoise, with one specific addition. I would like the rendering process to be repeated a certain number of times (let’s call it “X”) without requiring manual intervention for each render.
The reason behind this request is that I am working on generating procedurally generated samples within Renoise, and automating the rendering process would greatly enhance my workflow. I believe this could lead to more efficient and creative exploration of sound design possibilities.
If any of you have experience with Renoise scripting or are knowledgeable in creating tools, I would greatly appreciate your guidance and support in achieving this functionality. Your assistance will be instrumental in helping me streamline my creative process.
I end up with such code, and i admit I dont know if its any good or its just some fantasy generated by chat GPT
-- main.lua
local vb = renoise.ViewBuilder()
renoise.tool():add_menu_entry {
name = "Main Menu:Tools:RenderSong",
invoke = function()
show_combined_render_dialog()
end
}
function show_combined_render_dialog()
local dialog_content = vb:column {
margin = 10,
vb:text {
text = "Choose options for rendering:",
font = "bold"
},
vb:row {
vb:text {
text = "Save Path:"
},
vb:textfield {
id = "save_path",
width = 200,
notifier = function()
-- Add validation or processing if needed
end
},
vb:button {
text = "Browse",
notifier = function()
browse_for_save_path()
end
}
},
vb:row {
vb:text {
text = "Song Name:"
},
vb:textfield {
id = "song_name",
width = 200,
notifier = function()
-- Add validation or processing if needed
end
}
},
vb:row {
vb:text {
text = "Number of Renders:"
},
vb:valuebox {
id = "render_count",
min = 1,
max = 10,
value = 1
}
},
vb:button {
text = "Render Song",
notifier = function()
render_song()
end
}
}
renoise.app():show_custom_dialog("Render Song", dialog_content)
end
function browse_for_save_path()
local dialog = renoise.app():prompt_for_path("Choose a folder to save the rendered song")
if dialog then
local save_path_field = vb.views.save_path
if save_path_field then
save_path_field.text = dialog
end
end
end
function render_song()
local song = renoise.song()
if not song then
renoise.app():show_error("No active song found.")
return
end
local sequencer = song.sequencer
if not sequencer then
renoise.app():show_error("No sequencer found in the active song.")
return
end
local pattern_sequence = sequencer.pattern_sequence
if not pattern_sequence then
renoise.app():show_error("No pattern sequence found in the active song's sequencer.")
return
end
-- Set rendering options for the combined tool
local render_options_combined = {
start_pos = 1,
end_pos = pattern_sequence:find_last_pattern(pattern_sequence:sequence_length()),
sample_rate = 44100,
bit_depth = 16,
interpolation = "cubic",
create_backups = false,
}
-- Set the rendering filename
local save_path_combined = vb.views.save_path.text
local song_name_combined = vb.views.song_name.text
local filename_combined = save_path_combined .. "/" .. song_name_combined .. "_RenderedSong_combined.wav"
-- Display a message
renoise.app():show_message("Combined Rendering started. Please check Renoise for progress.")
-- Start the combined rendering process
local render_count_combined = vb.views.render_count.value
for i = 1, render_count_combined do
local success_combined, error_message_combined = song:render(render_options_combined, filename_combined, rendering_done_callback_combined)
if not success_combined then
renoise.app():show_error("Combined Rendering failed. Error: " .. error_message_combined)
return
end
end
renoise.app():show_message("Combined Rendering completed successfully.")
end
-- Callback function for combined rendering done
function rendering_done_callback_combined()
renoise.app():show_message("Combined Rendering done callback called.")
end