View Single Post
Old 05-14-2019, 07:40 PM   #3
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 142
Default

@Justin

I wrote a lua script to creat the marker

Code:
it=reaper.GetSelectedMediaItem(0, 0)

start=reaper.GetMediaItemInfo_Value(it, "D_POSITION")

length=reaper.GetMediaItemInfo_Value(it, "D_LENGTH")

fr=reaper.SNM_GetIntConfigVar("projfrbase", -1)

d=1/fr

reaper.gmem_attach("cutdetect")

reaper.gmem_write(0, 0.0)

time=math.ceil(length/d)

reaper.SetEditCurPos(start, 0, 0)

for i=1, time do

  cur=reaper.GetCursorPosition()

  reaper.SetEditCurPos(cur+d, 0, 1)

  pos=reaper.gmem_read(0)

  if pos~=0 then

    reaper.AddProjectMarker2(0, 0, pos, 0, "cut:"..i, reaper.CountProjectMarkers(0), 16777471)

    reaper.gmem_write(0, 0.0)

  end

end
But it's too slow. Is there any way to make it faster?
dsyrock is offline   Reply With Quote