Old 01-15-2016, 11:04 AM   #1
0=0
Human being with feelings
 
Join Date: Nov 2009
Location: Toronto
Posts: 102
Default reascript/action that changes rate/pitch by 1 cent

hey.. i do a lot of sequencing of samples in reaper (don't we all) but i find the default assignments for changing the pitch/rate to not be so precise for tuning. you can do +/-10 cents but going more detailed requires adjusting the rate within the item properties.

i wanted to make my own toolbar/shortcut buttons that allow me to change the RATE and pitch by 1 cent

(i know you can do smaller pitch changes but that's using the stretching algorithms and i dont want that)

this would really accelerate my workflow within reaper.

j

0=0
0=0 is offline   Reply With Quote
Old 01-15-2016, 12:50 PM   #2
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default

EEL script

Value in red will determine amount (currently cents).

Code:
//Adjust Playrate by +1 cent

newRate=+0.001;
 
items = CountSelectedMediaItems(0);
  i=0;
  loop(items,
    item = GetSelectedMediaItem(0,i);
    take = GetActiveTake(item);
    rate = GetMediaItemTakeInfo_Value(take, "D_PLAYRATE");
    SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", rate-newRate);
    );
    i += 1;
UpdateArrange();
Code:
//Adjust Playrate by -1 cent

newRate=-0.001;
 
items = CountSelectedMediaItems(0);
  i=0;
  loop(items,
    item = GetSelectedMediaItem(0,i);
    take = GetActiveTake(item);
    rate = GetMediaItemTakeInfo_Value(take, "D_PLAYRATE");
    SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", rate-newRate);
    );
    i += 1;
UpdateArrange();
edit: this is microtonal I guess, seemed like a more useful amount to tweak by.

Last edited by J Reverb; 01-15-2016 at 01:17 PM.
J Reverb is offline   Reply With Quote
Old 01-15-2016, 07:28 PM   #3
0=0
Human being with feelings
 
Join Date: Nov 2009
Location: Toronto
Posts: 102
Default

you are a hero~!!!

but i meant musical cents so it would be ~0.06% (i'm not sure the exact number but i'll figure it out now and modify the code)

you are definitely getting a thank you on my album because this will help IMMENSELY

Quote:
Originally Posted by J Reverb View Post
EEL script

Value in red will determine amount (currently cents).

Code:
//Adjust Playrate by +1 cent

newRate=+0.001;
 
items = CountSelectedMediaItems(0);
  i=0;
  loop(items,
    item = GetSelectedMediaItem(0,i);
    take = GetActiveTake(item);
    rate = GetMediaItemTakeInfo_Value(take, "D_PLAYRATE");
    SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", rate-newRate);
    );
    i += 1;
UpdateArrange();
Code:
//Adjust Playrate by -1 cent

newRate=-0.001;
 
items = CountSelectedMediaItems(0);
  i=0;
  loop(items,
    item = GetSelectedMediaItem(0,i);
    take = GetActiveTake(item);
    rate = GetMediaItemTakeInfo_Value(take, "D_PLAYRATE");
    SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", rate-newRate);
    );
    i += 1;
UpdateArrange();
edit: this is microtonal I guess, seemed like a more useful amount to tweak by.
0=0 is offline   Reply With Quote
Old 01-15-2016, 07:41 PM   #4
0=0
Human being with feelings
 
Join Date: Nov 2009
Location: Toronto
Posts: 102
Default

actually i have no idea what numbers/formula reaper uses to convert musical values into rate values. anyone?

j

0=0
0=0 is offline   Reply With Quote
Old 01-15-2016, 07:51 PM   #5
0=0
Human being with feelings
 
Join Date: Nov 2009
Location: Toronto
Posts: 102
Default

multiply (or divide) the rate by %5.9463445332746 for each semitone?

so for the 10 cents it would be %0.59463445332746

and for 1 cent it would be 0.059463445332746

yes?

yay!

j

0=0
0=0 is offline   Reply With Quote
Old 01-15-2016, 08:00 PM   #6
0=0
Human being with feelings
 
Join Date: Nov 2009
Location: Toronto
Posts: 102
Default

Code:
//Adjust Playrate by +1 musical cent

newRate=1.00059463445332746;
 
items = CountSelectedMediaItems(0);
  i=0;
  loop(items,
    item = GetSelectedMediaItem(0,i);
    take = GetActiveTake(item);
    rate = GetMediaItemTakeInfo_Value(take, "D_PLAYRATE");
    SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", rate*newRate);
    );
    i += 1;
UpdateArrange();
yes? yes!

j

0=0

Last edited by 0=0; 01-15-2016 at 08:03 PM. Reason: yes
0=0 is offline   Reply With Quote
Old 01-15-2016, 08:05 PM   #7
0=0
Human being with feelings
 
Join Date: Nov 2009
Location: Toronto
Posts: 102
Default

not entirely perfect.

but getting there ha

close enough to get my pitches right enough!
0=0 is offline   Reply With Quote
Old 01-20-2016, 06:22 AM   #8
SmajjL
Human being with feelings
 
Join Date: Nov 2013
Location: IKEA
Posts: 2,772
Default

Also, we have mouse mod for Items, or even just the bottom half of the items for volume or pitch, 'fine' or semi.
Just info, i know, i know.
Edit: Just tryed the fine pitch on botton half and, tryed to combo with CTRL thinking it would be less sensitive like on faders, nope, nice try SmajjL.. :P anyway..

Last edited by SmajjL; 01-20-2016 at 06:36 AM.
SmajjL is offline   Reply With Quote
Old 01-20-2016, 11:28 AM   #9
Subz
Human being with feelings
 
Subz's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 3,210
Default

Hmmm,

watching this one!

looks interesting!

Subz
Subz is offline   Reply With Quote
Old 01-20-2016, 02:48 PM   #10
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default

This will do Playrate/Pitch/length
Quite nice if you map it to mousewheel.

Code:
//Adjust Playrate/Pitch/length 

newRate=1.00059463445332746;
 
items = CountSelectedMediaItems(0);
  i=0;
  loop(items, 
    item = GetSelectedMediaItem(0,i);
    take = GetActiveTake(item);
    rate = GetMediaItemTakeInfo_Value(take, "D_PLAYRATE");  
    pitch = GetMediaItemTakeInfo_Value(take, "D_PITCH");
    SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", rate*newRate);
    SetMediaItemTakeInfo_Value(take, "D_PITCH", rate*newRate);
    Main_OnCommand(40612, 0);
    );
    i += 1;
UpdateArrange();

Last edited by J Reverb; 01-20-2016 at 04:53 PM.
J Reverb is offline   Reply With Quote
Old 01-25-2016, 12:48 PM   #11
0=0
Human being with feelings
 
Join Date: Nov 2009
Location: Toronto
Posts: 102
Default

Quote:
Originally Posted by J Reverb View Post
Main_OnCommand(40612, 0);
what's the purpose of this line?

cheers

j

0=0
0=0 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.