View Single Post
Old 11-25-2014, 09:13 AM   #23
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by X-Raym View Post
Hi !
Is there any way to modify take playback with eel script ? I don't find functions on this in the API.
Hi,
Do you mean "take playback rate"?

(takes can get random rates from 0 to 2 in this script)
Code:
function rand_take_pb_rate() local(i, item, take)
(
  i = 0;
  loop(CountSelectedMediaItems(0), 
    (item = GetSelectedMediaItem(0, i)) ? (
      (take = GetActiveTake(item)) ? (
        //GetMediaItemTakeInfo_Value(take, "D_PLAYRATE");
        SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", rand(2));
        SetMediaItemTakeInfo_Value(take, "B_PPITCH", floor(rand(1) + 0.5)); // random "preserve pitch"
      );
    );
    i += 1;
  );
  UpdateArrange(); // refresh arrange view
  Undo_OnStateChange("Randomize take playback rate");
);

rand_take_pb_rate();
EDIT: added: random "preserve pitch"

Last edited by spk77; 11-25-2014 at 09:18 AM.
spk77 is offline   Reply With Quote