Skip to content

Instantly share code, notes, and snippets.

@Nagasaki45
Created December 15, 2016 02:51
Show Gist options
  • Save Nagasaki45/98110bc9205ca7225d5865ecd5f606d8 to your computer and use it in GitHub Desktop.
Save Nagasaki45/98110bc9205ca7225d5865ecd5f606d8 to your computer and use it in GitHub Desktop.
A Reaper ReaScript to randomize the panning of the selected items
selected_item_count = reaper.CountSelectedMediaItems(0)
for i = 0, selected_item_count - 1 do
item = reaper.GetSelectedMediaItem(0, i)
item_take = reaper.GetActiveTake(item)
random_pan = math.random() * 2 - 1
reaper.SetMediaItemTakeInfo_Value(item_take, 'D_PAN', random_pan)
reaper.UpdateItemInProject(item)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment