去年剛好有寫一個這個腳本...
拿去試試吧
- --[[
- ___ ___ ___ ___ ___ ___
- /\ \ /\ \ /\ \ /\ \ /\ \ /\__\
- /::\ \ /::\ \ /::\ \ /::\ \ /::\ \ /::| |
- /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /:|:| |
- /:/ \:\ \ /::\~\:\ \ /::\~\:\ \ /::\~\:\__\ /:/ \:\ \ /:/|:| |__
- /:/__/ \:\__\ /:/\:\ \:\__\ /:/\:\ \:\__\ /:/\:\ \:|__| /:/__/ \:\__\ /:/ |:| /\__\
- \:\ \ \/__/ \/__\:\/:/ / \/_|::\/:/ / \:\~\:\/:/ / \:\ \ /:/ / \/__|:|/:/ /
- \:\ \ \::/ / |:|::/ / \:\ \::/ / \:\ /:/ / |:/:/ /
- \:\ \ /:/ / |:|\/__/ \:\/:/ / \:\/:/ / |::/ /
- \:\__\ /:/ / |:| | \::/__/ \::/ / /:/ /
- \/__/ \/__/ \|__| ~~ \/__/ \/__/
- * ReaScript Name: Split Stereo Item to mono (with dialogue)
- * Author: todoublez / X-raym
- * Repository: CARBON Premium Scripts
- * Licence: GPL v3
- * REAPER: 5.0
- * Version: 1.2.0
- * Changelog:
- * v1.1 + Conditions to item selection.Preventing wrong track removal if mono item was selected.
- * v1.2 + Rearrange UndoBlock.
-
- * v1.2 (2019-10-07)
- * v1.1 (2019-10-07)
- * v1.0 (2019-10-06)
- + Initial Release
- --]]
- ------------------------------USER--CONFIG--AREA---------------------------
- --
- Channel_number = 2-- mono:1 /stereo:2 /5.1surround:6 etc.. --
- --
- -----------------------------SCRIPT--STARTS--BELOW-------------------------
- -------------------------USERS--ITEM--SELECTION'S--FILTER-----------------------
- function main(output) -- local (i, j, item, take, track)
- reaper.Undo_BeginBlock() -- Begining of the undo block. Leave it at the top of your main function.
- -- GET SELECTED NOTES (from 0 index)
- for i = 0, count_sel_items-1 do
-
- item = reaper.GetSelectedMediaItem(0, count_sel_items-1-i)
- take = reaper.GetActiveTake(item)
-
- if take ~= nil then
-
- if reaper.TakeIsMIDI(take) == false then
-
- take_pcm = reaper.GetMediaItemTake_Source(take)
-
- take_pcm_chan = reaper.GetMediaSourceNumChannels(take_pcm)
- take_chan_mod = reaper.GetMediaItemTakeInfo_Value(take, "I_CHANMODE")
-
- select = 0
-
- if output == 1 and ((take_chan_mod > 1 and take_chan_mod < 67) or take_pcm_chan == 1) then
- select = 1
- end
-
- if output == 2 and (take_chan_mod > 66 or (take_chan_mod <= 1 and take_pcm_chan == output)) then
- select = 1
- end
-
- if output > 1 and take_chan_mod <= 1 and take_pcm_chan == output then
- select = 1
- end
-
- if select == 0 then reaper.SetMediaItemSelected(item, false) end
-
- else
- reaper.SetMediaItemSelected(item, false)
- end
-
- else
- reaper.SetMediaItemSelected(item, false)
- end
-
- end
- end
- ----------DESELECT--ITEMS--AFTER--FILTERING--USER'S--ITEMs--SELECTION--------
- count_sel_items = reaper.CountSelectedMediaItems(0)
- output = Channel_number--VALUE FROM "USER'S CONFIG AREA" FROM TOP OF THE SCRIPT
- if count_sel_items > 0 and output ~= "" then
- reaper.PreventUIRefresh(1)
-
- output = tonumber(output)
-
- if output ~= nil then
- main(output) -- Execute your main function
- end
-
- reaper.UpdateArrange() -- Update the arrangement (often needed)
- reaper.PreventUIRefresh(-1)
-
- end
- --------------------SPLIT--STEREO--ITEMS--TO--2--MONO--ITEMS-------------------
- local function main()
- reaper.PreventUIRefresh(1)
- local retval = reaper.ShowMessageBox( "Exploding selected items to mono items\nCreat folder(s) for each pair of L/R items?", "Split Stereo Item to mono", 3, 6, true )--pop up 2 choices to make
- if retval == 6 then --6 means Yes
- reaper.Main_OnCommand(40894, 0)--explode selected item(s)
- reaper.Main_OnCommand(40006, 0)--remove selected item(s)
- end
-
- if retval == 7 then --7 means No
- reaper.Main_OnCommand(40894, 0)--explode selected item
- reaper.Main_OnCommand( reaper.NamedCommandLookup("_SWS_SELTRKWITEM"), 0)--Select only track(s) with selected item(s)
- reaper.Main_OnCommand(1041, 0)--Cycle track folder state
- reaper.Main_OnCommand(40005, 0)--remove selected track(s)
- end
-
- reaper.Undo_EndBlock('explode', 0)--undo block ends here
- reaper.PreventUIRefresh(-1)
- reaper.UpdateArrange()
- reaper.UpdateTimeline()
- end
- main()
复制代码
它會問你要不要為新的左右聲道軌創建Folder 你可以選要或不要 然後就拆了
你可以選擇直接拷貝上面代碼或是下載附件腳本...我不知道你習慣怎麼新增腳本,所以我就兩個都附上了。
都是一樣的東西。
這個腳本是work on item的,所以記得選中你想拆的item再執行腳本哦
main core coded by X-raym
modded by todoublez
cheers
本帖最后由 todoublez 于 20-6-14 20:18 编辑
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x