Copy Slice Markers

I’ve just found out that you cannot copy and paste individual slice markers (or all of them) into another sample. It would be nice to be able to Ctrl-C/Ctrl-P markers to another sample at the exact same position it was in in the original sample.

1 Like

Totally needed!!

As far as I know, it is possible to do it using a tool, at least all the markers. But the target sample should be equally long that the original. With the API available I do not know how to obtain the last available position of the selected sample. If there is some way in the API to get the maximum value from the sample position, creating a tool would be very easy.

Reference:

  • property: .slice_markers (table)
  • method: :insert_slice_marker (mark_pos)

But I do not find anything to obtain the maximum possible value of the position in the sample. It is necessary to shield the paste function.

main.lua v1.0
local SLC_MAIN_TBL={}
local function slc_copy_slice_table()
  local song=renoise.song()
  local max=#song.selected_instrument:sample(song.selected_sample_index).slice_markers
  for sam_pos=1,max do
    SLC_MAIN_TBL[sam_pos]=song.selected_instrument:sample(song.selected_sample_index).slice_markers[sam_pos]
  end
  print("copy:")
  rprint(SLC_MAIN_TBL)
end

local function slc_paste_slice_table()
  local song=renoise.song()
  for sam_pos=1,#SLC_MAIN_TBL do
    song.selected_instrument:sample(song.selected_sample_index):insert_slice_marker(SLC_MAIN_TBL[sam_pos])
  end
  print("paste:")
  rprint(song.selected_instrument:sample(song.selected_sample_index).slice_markers)
end



--menu entry
renoise.tool():add_menu_entry{
  name=("Sample Editor:Copy Markers"),
  invoke=function() slc_copy_slice_table() end
}
renoise.tool():add_menu_entry{
  name=("Sample Editor:Paste Markers"),
  invoke=function() slc_paste_slice_table() end
}

Thank you very much @joule. With this I can make a simple tool. I have barely made tools related to the manipulation of samples. I still have to familiarize myself a little with the related API.

I just launched a tool in the tools section of www.renoise.com. It’s called Slice Importer.

https://www.renoise.com/tools/slice-importer

Enjoy!

3 Likes

I use “Slice Importer” often, especially for vocal comping.
So, I assigned keyboard shortcuts to “Slice Importer” for my productivity.
This is a snippet I added to main.lua file for my personal use (I would be happy if future update handles this keybinding).

-- Add key bindings
renoise.tool():add_keybinding{
  name = 'Sample Editor:Slices:Copy Markers',
  invoke=function() slc_copy_slice_table() end
}

renoise.tool():add_keybinding{
  name = 'Sample Editor:Slices:Paste Markers',
  invoke=function() slc_paste_slice_table() end
}

@oguma, leave a note here and I’ll update it as soon as I have time:

3 Likes

Thank you Raul for this tool, i find it very good for following technique:
let’s say you have drum break sliced up, and you resample it multiple times with different effects to new instruments - markers are lost!
now your tool chimes in to preserve sliced timing - and allow us easy & smooth variations between breaks (or any other audio) :slight_smile:

1 Like