New Tool (2.8): RenderTrackNoFX

Sometimes I find myself needing to use toggle-dsps tool http://tools.renoise.com/tools/toggle-dsps to render samples as they run througth fx -> sends -> more fx -> master dsps/vst
but I really like just clicking render to sample and its done. So please could somebody who is savy with scripting either make this or maybe give me some pointers on how to make this:

Right click on pattern editor, Click Dry Render on menu, Toggles off all dsps and vst, does a render to sample then toggles all the dsps that were on before back on, all with one click.

Have you made any tools as of yet? Because let me be honest, this might not be the one you wanna start with.

Forget what I said, I’m making it right now

No never made a tool, I have done some very basic scripting before for another application.

Render to Sample is not available in the API.

You would need to write a renderer of your own with this function:

  
-- Start rendering a section of the song or the whole song to a WAV file.  
-- Rendering job will be done in the background and the call will return  
-- back immediately, but the Renoise GUI will be blocked during rendering. The  
-- passed 'rendering_done_callback' function is called as soon as rendering is  
-- done, e.g. successfully completed.  
-- While rendering, the rendering status can be polled with the song().rendering  
-- and song().rendering_progress properties, for example, in idle notifier  
-- loops. If starting the rendering process fails (because of file IO errors for  
-- example), the render function will return false and the error message is set  
-- as the second return value. On success, only a single "true" value is  
-- returned. Param 'options' is a table with the following fields, all optional:  
--  
-- options = {  
-- start_pos, -- renoise.SongPos object. by default the song start.  
-- end_pos, -- renoise.SongPos object. by default the song end.  
-- sample_rate, -- number, one of 22050, 44100, 48000, 88200, 96000. \  
-- -- by default the players current rate.  
-- bit_depth , -- number, one of 16, 24 or 32. by default 32.  
-- interpolation, -- string, one of 'cubic', 'sinc'. by default cubic'.  
-- priority, -- string, one "low", "realtime", "high". \  
-- -- by default "high".  
-- }  
--  
-- To render only specific tracks or columns, mute the undesired tracks/columns  
-- before starting to render.  
-- Param 'file_name' must point to a valid, maybe already existing file. If it  
-- already exists, the file will be silently overwritten. The renderer will  
-- automatically add a ".wav" extension to the file_name, if missing.  
-- Param 'rendering_done_callback' is ONLY called when rendering has succeeded.  
-- You can do something with the file you've passed to the renderer here, like  
-- for example loading the file into a sample buffer.  
renoise.song():render([options,] filename, rendering_done_callback)  
 -> [boolean, error_message]  
  

Then load the wav file back into an empty instrument.
The toggle_DSPs script already helps you out quite a lot.
For the start-pos and end-pos , you need the renoise.song().patterns[].tracks[].lines[].note_columns[].is_selected option to determine the start and end-boundary of a selection.
To figure out if a sample buffer has sample data you need:

  
local empty_sample_instrument = nil  
for x = 1, #renoise.song().instruments do  
 empty_sample_instrument = renoise.song().instruments[x].samples[1].sample_buffer.has_sample_data  
 if empty_sample_instrument == false then  
 empty_sample_instrument = x  
 break  
 end  
end  
  

Note the above is basic, you also would need to figure out if the instrument has a VST plugin loaded or has an external midi device configured to be sure it is absolutely not used.

To reload the created wav file into an empty sample buffer, you need
renoise.song().instruments[empty_sample_instrument].samples[1].sample_buffer:load_from(filename)

It is basic, but will get you on the road.

This is what I have so far (just to let you know)

  
-------------------------------------------------------------  
-- Render Track No FX v0.1 by Cas Marrav (for Renoise 2.8) --  
-------------------------------------------------------------  
  
-- Vars  
local indexes_on = {}  
local dialog  
  
-- Callback when rendering done  
local function render_done_callback()  
 renoise.app():show_status("Render Track without FX: Done.")  
  
 -- reset device on/off statuses  
 for i,d in ipairs(ct.devices) do  
 d.is_active = indexes_on[i]  
 end  
end  
  
-- Main --  
local function rendertracknofx()  
 local rs=renoise.song()  
 if rs.transport.playing then  
 rs.transport.panic()  
 end  
 if (not #rs.selected_instrument.samples>0 and rs.selected_instrument:sample(1).sample_buffer.has_sample_data) and   
 (not falsers.selected_instrument.plugin_properties.plugin_loaded) and   
 (rs.selected_instrument.midi_output_properties.device_name == "") then  
 -- instrument non empty - have to make new instrument  
 -- try to first select instrument used on current track so you keep the order a bit  
 rs:capture_nearest_instrument_from_pattern()  
 rs:insert_instrument_at(rs.selected_instrument_index+1)  
 end  
  
 -- info for current track (during rendering, current track can't be changed, thus we won't have to save that)  
 local cti = rs.selected_track_index  
 local ct = rs.selected_track  
  
 -- save state for all devices in current track, then turn them off  
 for i,d in ipairs(ct.devices) do  
 indexes_on[i] = d.is_active  
 if i ~= 1 then -- don't try to disable the 'mixer' device  
 d.is_active = false  
 end  
 end  
  
 -- make a window to display the progress  
  
 -- solo the track  
  
 -- render the pattern (callback function will reset the devices to original state)  
  
 -- register idle_observable listener to display progress  
  
end  
  
  
-- Menu --  
renoise.tool():add_menu_entry {  
 name = "Main Menu:Tools:CasTools:Render Track No FX",  
 invoke = rendertracknofx  
}  
  
  
-- Keys --  
renoise.tool():add_keybinding {  
 name = "Pattern Editor:Track Operations:Render Track No FX",  
 invoke = rendertracknofx  
}  
  
  
-- Midi --  
--[[  
renoise.tool():add_midi_mapping {  
 name = "Skeleton",  
 invoke = x  
}  
--]]  
  
  
_AUTO_RELOAD_DEBUG = function()  
  
end  
  

PS I’m looking at freeze track tool by mxb to fill in the blanks

I didn’t realize it was that much work, Thanks Cas / vV I wont attempt this it would take me way to long.

nl.jeweett.RenderTrackNoFX.xrnx v0.1
Two options: track and selection. Mind you the ‘render selection dry’ is not a real ‘render selection’; it only renders what’s on the current track inside selection. Because like vV said, Render to Sample is not available in the API as of yet, and it’s something that can be a little bit annoying to ‘remake’ with the regular render function. I don’t really mind the work of this though, because it’s typically one area of the Renoise API that I hadn’t touched yet so now I know a little bit more.
You’re free to study the code (and possibly, the progress of the code) at github

Also, let me know how well it works, what doesn’t work about it, etc.

PS., still, if you want to know about renoise tools, study any of the tools I’ve made at this link, there’s some starter-stuff in there that you can get ideas from, e.g. my first was “MidiSkip”, some other cool but simple ones are AutoSelectInstrument; AwesomeSawce; BestViews; BlockLoopSize; Clean Drums; EditStepTools; MiniTab (beta); MonoDelay2; Note Repeat; Pdub; PlayAndLoopPattern; RecentFiles; SirDanceALot; SliceNExact

edit: the educationally advised stuff in bold :P

Wicked stuff Cas, Thanks, 1 minor mistake render track and selection are the wrong way round ^_^ .

Hi Cas, one more request for this tool, can the ‘pre and post fx volume’ be set to 0db during the render then back to what it was before. The reason for this is if you have a lower or higher volume and do the render you have to adjust the renders volume after, this tool is so easy to add little slides and reverses to sliced up samples without needing more tracks but that’s the only thing that lets the process down a bit. When I get a bit of free time I will have a go at making a simple tool, Thanks again.