分离音频左右声道
原文:如何分离音频左右通道
sylion 提问:
很久以前,我好像在本论坛看过一个帖子,讲的是用 REAPER 制作消音伴奏的。大致是把伴奏音频轨左右声道分离,然后把其中一个声道反转等等等。 现在那个帖子找不到了。想尝试一下,竟然找不到分离左右声道的方法了,怎么弄,伴奏轨都是整体一块,做不到上下两个的。 应该怎么弄呢?我在 Action List 里面用 split 搜索都没找到需要的动作。
提炼得到的方法
- 对着音频块右键,选择
Item processing > Explode multichannel audio or MIDI items to new one-channel items
。
- 对着音频块右键,选择
Item settings > Take channel mode...
选择一个声道,或进行下混缩。
- 通过扩展脚本实现(见下文)。
bobo198504 的原回答:
也可以复制一轨,在这个菜单的第一项,把一轨设成 Left,一轨设成 Right。
todoublez 的原回答:
去年剛好有寫一個這個腳本...拿去試試吧
(点击展开)
--[[ ___ ___ ___ ___ ___ ___ /\ \ /\ \ /\ \ /\ \ /\ \ /\__\ /::\ \ /::\ \ /::\ \ /::\ \ /::\ \ /::| | /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /:|:| | /:/ \:\ \ /::\~\:\ \ /::\~\:\ \ /::\~\:\__\ /:/ \:\ \ /:/|:| |__ /:/__/ \:\__\ /:/\:\ \:\__\ /:/\:\ \:\__\ /:/\:\ \:|__| /:/__/ \:\__\ /:/ |:| /\__\ \:\ \ \/__/ \/__\:\/:/ / \/_|::\/:/ / \:\~\:\/:/ / \:\ \ /:/ / \/__|:|/:/ / \:\ \ \::/ / |:|::/ / \:\ \::/ / \:\ /:/ / |:/:/ / \:\ \ /:/ / |:|\/__/ \:\/:/ / \:\/:/ / |::/ / \:\__\ /:/ / |:| | \::/__/ \::/ / /:/ / \/__/ \/__/ \|__| ~~ \/__/ \/__/ * 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