Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 01-13-2021, 05:21 AM   #1
timothys_monster
Human being with feelings
 
timothys_monster's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 1,133
Default How to create an empty (silent) audio file?

Hey folks,

REAPER has always been my DAW for music making, but since I am working in a foley studio, I have to use Pro Tools on a daily basis. There is no way I can convince everyone to switch to REAPER (yet! ), so I opted for a middle way:

I purchased AATranslator and want to use REAPER for cueing and editing our Pro Tools sessions.

The editing is pretty straight forward I guess. But the cueing seems to be difficult to translate to Pro Tools.

This is how we do it in PT: We create empty audio files as a placeholder and name it according to the props or footsteps we will record.

Now I wanted to do that with REAPER's empty items, which, with a little bit of scripting, I think can be done even easier. BUT! The problem is, that AATranslator only converts actual existing media items to pass on to Pro Tools.

So I was wondering if in REAPER there is a way to create emtpy audio items with only silence.

I looked in the action list with most of ReaPack's repositories installed and found nothing of that sort. Maybe someone has got a hint???

EDIT:
I might have found a way using MIDI items to create the placeholder and then converting those into audio files using "Script: sr_Render VSTi item(s) without track FX and delete MIDI take(s).lua". Will further investigate if it can be read later by Pro Tools, too.

Last edited by timothys_monster; 01-13-2021 at 05:34 AM.
timothys_monster is offline   Reply With Quote
Old 01-13-2021, 05:33 AM   #2
bolgwrad
Human being with feelings
 
bolgwrad's Avatar
 
Join Date: Mar 2011
Location: On my arse in Glasgow, Scotland
Posts: 2,052
Default

Record the output of an empty track to itself - record 5 seconds, drag to extend and glue it? edit: and use a take marker
__________________
www.sachetsofrelish.com
bolgwrad is offline   Reply With Quote
Old 01-13-2021, 05:46 AM   #3
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

If you "glue" an empty item you get a silent audio item.

But you should probably check if AAtranslator can do what you want directly. Seeing as how you've paid for it.

Incidentally, filenames are a dumb way of communicating metadata, but I see how you have to work with the system.
__________________
it's meant to sound like that...

Last edited by jrk; 01-13-2021 at 06:03 AM.
jrk is offline   Reply With Quote
Old 01-13-2021, 06:34 AM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Quote:
This is how we do it in PT: We create empty audio files as a placeholder

Wait, what ? Are these placeholders linked to any sound file ? Or are they similar to empty items in REAPER ?


--


Usually the most straightforward way to export/import generic data across DAW is using MIDI tracks, with text events.


MIDI support is ususaly good, and as it is a standard format, there isn't too much trouble.


Also, they can be append to existing session.
X-Raym is offline   Reply With Quote
Old 01-13-2021, 01:25 PM   #5
timothys_monster
Human being with feelings
 
timothys_monster's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 1,133
Default

Thank you so much for your input, guys!

I think I kind of have a good workaround now. MIDI items are the way to go.

I create MIDI items and they get named after the track, which is great. Then I created a custom action for converting them into silent audio files:
  • Script: me2beats_Delete 'untitled MIDI item' in items names.lua
  • Item: Apply track/take FX to items
  • Take: Switch items to previous take
  • Take: Delete active take from items

Now I only need to get rid of the "render" suffix in the filenames...

@X-Raym:
Unfortunatley, Pro Tools is a dinosaur. And dinosaurs eat a lot - in this case disk space. It actually creates empty WAV files every time you use those placeholders. You could probably do it with MIDI items in PT, too, but then you can't record over your placeholders, which we like to do here. This way no separate recording track is needed and the placeholders are deleted (overwritten) when the recording is done.
timothys_monster is offline   Reply With Quote
Old 01-13-2021, 03:32 PM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

This is not Dinosaur worklow. This is Alien one 👽


Or dinosaur alien at least 😁
X-Raym is offline   Reply With Quote
Old 01-14-2021, 03:08 AM   #7
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

Quote:
Originally Posted by X-Raym View Post
This is not Dinosaur worklow. This is Alien one
Whichever pointy-headed manager came up with this workflow is (politely) not a positive asset in the workplace.
__________________
it's meant to sound like that...
jrk is offline   Reply With Quote
Old 01-16-2021, 01:50 AM   #8
Runaway
Human being with feelings
 
Runaway's Avatar
 
Join Date: Jun 2009
Location: Sydney, Australia
Posts: 2,510
Default

Quote:
Originally Posted by jrk View Post
If you "glue" an empty item you get a silent audio item.

But you should probably check if AAtranslator can do what you want directly. Seeing as how you've paid for it.
No it doesn't - essentially because we need to reference a media file to a clip in ProTools - otherwise we don't get a valid PT session file and that is something we take great pains in being able to create.

I would think that you could just record some silence and use that one media file to reference all the 'silent' place holders in Reaper and then convert that to PT? Or am I missing something?
__________________
AATranslator
Runaway is offline   Reply With Quote
Old 01-17-2021, 01:31 PM   #9
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

Quote:
Originally Posted by Runaway View Post
No it doesn't - essentially because we need to reference a media file to a clip in ProTool
Fair enough. I think the OP could probably make a custom action like:
Code:
SWS/BR: Select all empty items
Item: Glue items
How would AAT manage then?
__________________
it's meant to sound like that...
jrk is offline   Reply With Quote
Old 01-18-2021, 12:46 AM   #10
Runaway
Human being with feelings
 
Runaway's Avatar
 
Join Date: Jun 2009
Location: Sydney, Australia
Posts: 2,510
Default

Quote:
Originally Posted by jrk View Post
Fair enough. I think the OP could probably make a custom action like:
Code:
SWS/BR: Select all empty items
Item: Glue items
How would AAT manage then?
As long as a clip has a reference to a media file (silence or sound makes no difference) then we can create a valid PTX with that clip included.

The thing to remember is just because you can do something in Reaper doesn't mean that that same thing is valid/appropriate/possible/etc in another DAW ;-)
__________________
AATranslator
Runaway is offline   Reply With Quote
Old 01-18-2021, 01:02 AM   #11
martmix
Human being with feelings
 
martmix's Avatar
 
Join Date: Jan 2020
Location: quebec CA
Posts: 1,576
Default

would not insert-empty-item,would work??
__________________
[cpu=i7-6700,12gig ram]DAW=Reaper-[roland-quad-capture]-[krk rokit-5 G3]-[TR5-eq 81]-
[amplitube-max]
YouTube: ricky & marty
martmix is offline   Reply With Quote
Old 01-18-2021, 09:28 AM   #12
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

Quote:
Originally Posted by Runaway View Post
The thing to remember is just because you can do something in Reaper doesn't mean that that same thing is valid/appropriate/possible/etc in another DAW ;-)
Oh, for sure. The empty item is a Reaper idiom, but its typical function is to act as a placeholder. I dunno what the semantic equivalent is in other DAWs, but I guess it's the job of a translator to come up with one.
__________________
it's meant to sound like that...
jrk is offline   Reply With Quote
Old 01-19-2021, 05:33 AM   #13
Runaway
Human being with feelings
 
Runaway's Avatar
 
Join Date: Jun 2009
Location: Sydney, Australia
Posts: 2,510
Default

Quote:
Originally Posted by jrk View Post
I dunno what the semantic equivalent is in other DAWs, but I guess it's the job of a translator to come up with one.
Sure, let me put it on my list (which already rivals the Dead Sea scrolls) of things to do ;-)
__________________
AATranslator
Runaway is offline   Reply With Quote
Old 01-20-2021, 12:48 AM   #14
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,818
Default

I've done a metric ton of stuff like this when doing EdiCue lists for ADR in Reaper.

Apart from simply exporting a CSV of selected items with a custom script, I also just use this Lua script that comes in the ReaTeam repo iirc.

Script: Item - Glue items separately (preserve stuff).lua

I use empty items, then that script. AATranslator takes care of the rest, producing a Protools session. Protools starts to cry if the same audio file is referenced in multiple items for some reason. I haven't done this for a couple of years though.

Here's the CSV saving script by Planetnine and myself(it's somewhere on the forum as well). Perhaps it can be of some use to you or anyone else. There's a version that directly exports to the EdiCue format as well if anyone's interested. It's a niche thing, so I didn't include it here.

Code:
-- Script "Save Selected Items As CSV"
-- Authors : Airon, Planetnine on the Reaper forum

-- License : GPL v3

-- Produce a CSV file from selected items
-- Uses the filename as shown almost at the bottom of the script.
-- csvtargetfile = "RENAME_ME.csv"
--
-- This file will end up in the audio recording path of the project.

--
-- TAKE NAME(delimiter_insert)(number)(delimiter_postinsert)
-- this enables stuff like  "takeZZZZXXX25WWWWXXXXXX" and you can easily swap that stuff out later
-- or "take(25)" or just "take 25"


msg_flag = false
function msg(val) ; if msg_flag then ; reaper.ShowConsoleMsg(tostring(val).."\n"); end ; end

delimiter_insert = " " -- between the existing TAKE NAME and the number at the end
delimiter_postinsert = ""

-- Storing the item information could be done better ...
item         = {}   -- init item table
item_posn    = {}   -- init item position table
item_posnend = {}   -- init item position table for end time
item_actk    = {}   -- init item active take table
item_track   = {}   -- init track the item currently is on

csvcollect = ""     -- store the entire CSV export in this before writing it to a file
csvdel = ";"        -- delimiter for CSV file

num_sel_items = reaper.CountSelectedMediaItems(0) -- get number sel items (the check for zero selected items is further down)

-- Setup stuff
local path_separator = "\\"
if reaper.GetOS() ~= "Win32" and reaper.GetOS() ~= "Win64" then
    path_separator = "/"
end

function get_script_path()
  if reaper.GetOS() == "Win32" or reaper.GetOS() == "Win64" then
    return debug.getinfo(1,'S').source:match("(.*".."\\"..")"):sub(2) -- remove "@"
  end
    return debug.getinfo(1,'S').source:match("(.*".."/"..")"):sub(2)
end

function get_project_path()
--  if reaper.GetOS() == "Win32" or reaper.GetOS() == "Win64" then
    return reaper.GetProjectPath("") --.source:match("(.*".."\\"..")"):sub(2) -- remove "@"
--  end
--    return reaper.GetProjectPath("").source:match("(.*".."/"..")"):sub(2)
end


-- Sorting algorithms courtesy of Planetnine

local max_chunk_size = 12

function insertion_sort(array, first, last, goes_before)	-- used in "merge_sort" function
	for i = first + 1, last do
		local k = first
		local v = array[i]
		for j = i, first + 1, -1 do
			if goes_before( v, array[j-1] ) then
				array[j] = array[j-1]
			else
				k = j
				break
			end
		end
		array[k] = v
	end
end

function merge(array, workspace, low, middle, high, goes_before)	-- used in "merge_sort" function
	local i, j, k
	i = 1
	-- Copy first half of array to auxiliary array
	for j = low, middle do
		workspace[ i ] = array[ j ]
		i = i + 1
	end
	i = 1
	j = middle + 1
	k = low
	while true do
		if (k >= j) or (j > high) then
			break
		end
		if goes_before( array[ j ], workspace[ i ] )  then
			array[ k ] = array[ j ]
			j = j + 1
		else
			array[ k ] = workspace[ i ]
			i = i + 1
		end
		k = k + 1
	end
	-- Copy back any remaining elements of first half
	for k = k, j-1 do
		array[ k ] = workspace[ i ]
		i = i + 1
	end
end

function merge_sort( array, workspace, low, high, goes_before )		-- used in "stable_sort" function
	if high - low < max_chunk_size then
		insertion_sort( array, low, high, goes_before )
	else
		local middle = math.floor((low + high)/2)
		merge_sort( array, workspace, low, middle, goes_before )
		merge_sort( array, workspace, middle + 1, high, goes_before )
		merge( array, workspace, low, middle, high, goes_before )
	end
end

function stable_sort( array, goes_before )		-- used to replace table.sort
	local n = #array
	if n < 2 then  return array  end
	goes_before = goes_before or
	function (a, b)  return a < b  end
	local workspace = {}
	workspace[ math.floor( (n+1)/2 ) ] = array[1]		--  Allocate some room.
	if goes_before(array[1],array[1]) then
		error"invalid order function for sorting"
	end
	merge_sort( array, workspace, 1, n, goes_before )
	return array
end

function load_list(array)					-- load array to "list" table for idx sort...
	list = {}								-- init "list" table
	msg("Unsorted table order...")			-- bugfix msgs
	for idx, value in pairs(array) do  		-- load table "item_posn" into table "list"...
		list[#list+1] = idx  				-- add index to table
		if list[idx] then msg("idx:"..idx.."  list[idx]:"..list[idx].. "  array:".. array[list[idx]]) end	-- bugfix msgs
	end
end

function byval(a,b)							-- this function makes table sort by value 
	return (item_posn[a] < item_posn[b]) 		-- or (item_posn[a] == item_posn[b]) 	-- and (item[a] < item[b])
end

function append_label()               -- UNUSED in this script
	reaper.PreventUIRefresh(1); 	      -- prevent UI refresh (hold screen)
	msg("")                             -- console msgs
	msg("< sort by value >")
	msg("{L} sel item - pos'n")
	for k=1,#list do
		item_posn_string = reaper.format_timestr_pos(item_posn[list[k]], "", 5)							-- create time string from pos'n
		msg("{"..k .."}  si:"..list[k] .. " - " .. item_posn[list[k]] .. " ["..item_posn_string.."]")		-- console msg
		retval, take_name = reaper.GetSetMediaItemTakeInfo_String(item_actk[list[k]], "P_NAME", "", 0)  -- get take name
		take_name = (take_name .. delimiter_insert .. k .. delimiter_postinsert)                        -- append take name
		reaper.GetSetMediaItemTakeInfo_String(item_actk[list[k]], "P_NAME", take_name, true)            -- set appended take name
	end
	msg("")
	reaper.PreventUIRefresh(-1); -- restore UI refresh
end


-- Sorting functions end
-- =====================

function get_item_param()
    local retval
	for i =1, num_sel_items do                                -- loop through sel items...
		item[i]         = reaper.GetSelectedMediaItem(0, i-1)   -- get item number (ID)
		item_actk[i]    = reaper.GetActiveTake(item[i])         -- get active take for item
		item_posn[i]    = reaper.GetMediaItemInfo_Value(item[i], "D_POSITION")                  -- get item's pos'n
        item_posnend[i] = item_posn[i] + reaper.GetMediaItemInfo_Value(item[i], "D_LENGTH") -- item's position end
--      local item_track_ref  = reaper.GetMediaItem_Track(item[i])                          -- get track name the item is on
        retval, item_track[i] = reaper.GetSetMediaTrackInfo_String(reaper.GetMediaItem_Track(item[i]), "P_NAME", "", false) -- get take name
    end
end


-- ## Adds a leading zero to the hour part of the SMPTE timecode that Reaper provides.
-- ## This makes for cleaner spreadsheets
function padd_tc(e) -- expects SMPTE timecode
    local tc = tostring(e)
    local hh = ""
    pattern = "(%d+)%:(%d+)%:(%d+)%:(%d+)"
    hh = tc:match(pattern) -- gets you the HOUR part of the SMPTE timecode. To get more do hh,mm,ss,ff = tc:match(pattern)
    if string.len(hh) == 1 then -- hour part has just one digit ?
        tc = "0"..tc            -- Then add a padding zero at the start.
    end
    return tc
end


-- ### Main program ###
if num_sel_items >0 then 
	get_item_param()          -- get item parameters
  load_list(item_posn)      -- loads "item_posn" table into "list" table
	stable_sort(list, byval)  -- sort table by value ("unstable" sort)

    for k=1,#list do
        --msg(k-1 ..": "..list[k] .. " - " .. item_posn[list[k]])          -- console msg
        kount = list[k]
        retval, take_name = reaper.GetSetMediaItemTakeInfo_String(item_actk[kount], "P_NAME", "", 0)  -- get take name
        tc_start = padd_tc( reaper.format_timestr_pos(item_posn[kount], "", 5) )    -- SMPTE TC Start
        tc_end   = padd_tc( reaper.format_timestr_pos(item_posnend[kount], "", 5) ) -- SMPTE TC End
        trackname     = tostring(item_track[kount])
        itemnotes = "" -- to be done
        -- dump each successive item and its information in the csvcollect variable
        csvcollect = csvcollect..k..csvdel..trackname..csvdel..take_name..csvdel..tc_start..csvdel..tc_end..csvdel..itemnotes.."\n"
    end
    

    local script_path = get_script_path()
    local project_path = get_project_path()
    -- get current time, convert to SMPTE and sub ":" for "-"
    -- local time = string.gsub(reaper.format_timestr_pos(reaper.time_precise(), "", 5),":","-")
    -- Unfortunately we're not using anything clever to make the filename right now.
    
    csvtargetfile = "RENAME_ME.csv"
    --csvtargetfile = project name_yymmdd_hhmm.csv -- our target filename
    csv_filename = project_path .. path_separator .. csvtargetfile

    ---- Write to file ----
    file = io.open(csv_filename,"w+")
    file:write(csvcollect)
    file:close()
end
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom

Last edited by airon; 01-20-2021 at 12:57 AM.
airon is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.