|
|
|
03-22-2015, 08:05 AM
|
#1
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
REQ: Script to automatically set Record Mode
Hello!
I would like a script that would do the following:
- Check if there is a time selection
yes -> set record mode to autopunch time selection
no ->
- Check if there are any items selected
yes -> set record mode to autopunch selected items
no -> leave the Record mode as it is (unchanged)
Could someone make it for me? Thanks!
EDIT:
spk77's script (working in Reaper 4)
heda's script (requires v5)
Thank you guys!!!
Last edited by amagalma; 03-23-2015 at 04:38 AM.
|
|
|
03-22-2015, 09:07 AM
|
#2
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
The main core should be something like this..
Code:
GetSet_LoopTimeRange(a, "", "", "", "")
a=1 ? Main_OnCommand(40076, "") :
CountSelectedMediaItems(0) > 1 ? Main_OnCommand(40253, "")
Could someone correct it for me?
|
|
|
03-22-2015, 09:50 AM
|
#3
|
Human being with feelings
Join Date: Sep 2010
Location: Finland
Posts: 776
|
I'm using an SWS custom conditional action for this. It also adds pre-record if preroll is enabled (to avoid cutting off the start of the first note). (I can post it later if you wish).
A ReaScript would be a much more straightforward way to do this though. I can try and give it a shot when I get back to my comp...
__________________
Grey, flat and minimal theme for Reaper: Symbiosis
|
|
|
03-22-2015, 09:54 AM
|
#4
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Please do post it!
|
|
|
03-22-2015, 10:00 AM
|
#5
|
Human being with feelings
Join Date: Jul 2009
Posts: 1,071
|
SWS/BR Cycle through record modes can be mapped to a keyboard shortcut.
You need to have SWS extensions installed.
I am pretty sure you can't change record modes on the fly though, you would have to stop recording in each mode before switching as files are generated accordingly.
You could make some custom actions that set record enabled and the mode at the same time though.
For example,
Record: Set record mode to selected item auto-punch
Transport: Record
Record: Set record mode to time selection auto-punch
Transport: Record
Record: Set record mode to normal
Transport: Record
You normally wouldn't need to count the selected items as Reaper will only punch in on the selected items by default.
|
|
|
03-22-2015, 10:12 AM
|
#6
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Thanks J Reverb... but the idea is having the mode set automatically, so that I do not need to think about what mode to choose or what key to press.
I want to press record and if there is a time selection record to the time selection. If not, then if there are selected items, record the selected items.
|
|
|
03-22-2015, 10:35 AM
|
#7
|
Human being with feelings
Join Date: Jul 2009
Posts: 1,071
|
Problem is that you can have items selected and time selection at the same time so Reaper would have to know which mode you are in so it's a bit of a catch 22, therefore you have to tell Reaper what mode you are choosing and that requires an action to be performed. Either some sort of toggle or custom action in this case. Either way I think you are looking at pressing 1 of three buttons, I may be wrong, good luck though
|
|
|
03-22-2015, 10:43 AM
|
#8
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
Maybe something could be possible with defer function ? It allows to have script running in background.
I dont know a lot about this at this time.
|
|
|
03-22-2015, 10:57 AM
|
#9
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Quote:
Originally Posted by J Reverb
Problem is that you can have items selected and time selection at the same time...
|
There would be no problem! See the logic here:
Plus, the script does not need to run all the time. I will make a custom action that includes this script + Transport: Record. So, when I press Record, the script runs and decides the appropriate mode.
|
|
|
03-22-2015, 11:57 AM
|
#10
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Maybe this would work:
Code:
GetSet_LoopTimeRange(0, 0, start, end, 0);
start != end ? (
Main_OnCommand(40076, 0);
) :
CountSelectedMediaItems(0) > 0 ? (
Main_OnCommand(40253, 0);
);
|
|
|
03-22-2015, 12:04 PM
|
#11
|
Human being with feelings
Join Date: Sep 2010
Location: Finland
Posts: 776
|
Looks like I had modified the action a bit... I don't have the item auto-punch option, as I was not using that mode at all. Instead I have a little different recording button logic, with four different actions which do the following:
Main
NUM0: Record (This is a custom action created with SWS cycle action editor. Preroll amount depends on the current grid setting.)
Main (alt recording)
Enter/Space: (this action works like time auto punch, but it also records the preroll and tail, in case you might need them.)
NUM0:
NUM Del:
I've found the restoring of edit cursor position very handy if you need to restart the recording a lot (so many bad takes...) Hopefully you find this helpful.
__________________
Grey, flat and minimal theme for Reaper: Symbiosis
|
|
|
03-22-2015, 12:38 PM
|
#12
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Thank you both for your help!
Spk77, this is exactly what I was asking! Just in order for me to understand what is going on...
1) GetSet_LoopTimeRange(0, 0, start, end, 0)
Why the 0 (zeros)? What do they mean? And the variable names "start" and "end" are chosen by you? I mean could they be something else?
2) Main_OnCommand(40076, 0)
Again, what does the 0 (zero) denote?
Seventh, thank you for your cycle actions! It is a good workaround for Reaper's lack of ability to record in the pre-roll time!
|
|
|
03-22-2015, 01:01 PM
|
#13
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by amagalma
Thank you both for your help!
Spk77, this is exactly what I was asking! Just in order for me to understand what is going on...
1) GetSet_LoopTimeRange(0, 0, start, end, 0)
Why the 0 (zeros)? What do they mean? And the variable names "start" and "end" are chosen by you? I mean could they be something else?
|
In EEL, 0 = false and 1 = true
Here's the function description:
EEL: GetSet_LoopTimeRange(bool isSet, bool isLoop, & startOut, & endOut, bool allowautoseek)
- bool isSet: set this to 0 (false) to get values (1 would set the time selection)
- bool isLoop: we want to get values from the time selection (not from loop points), that's why it's set to 0
- &startOut: when getting values, time selection start is stored to this variable (you can choose the name by yourself)
- &endOut: when getting values, time selection end is stored to this variable (you can choose the name by yourself)
- bool allowautoseek: (not sure about this)
Quote:
Originally Posted by amagalma
2) Main_OnCommand(40076, 0)
Again, what does the 0 (zero) denote?
Seventh, thank you for your cycle actions! It is a good workaround for Reaper's lack of ability to record in the pre-roll time!
|
It's an "extra flag", but I think it should always be set to 0
|
|
|
03-22-2015, 02:02 PM
|
#14
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
BIG BIG THANKS!!! You 've made it so clear!!!
Quote:
Originally Posted by spk77
In EEL, 0 = false and 1 = true
- bool isSet: set this to 0 (false) to get values (1 would set the time selection)
- bool isLoop: we want to get values from the time selection (not from loop points), that's why it's set to 0
- &startOut: when getting values, time selection start is stored to this variable (you can choose the name by yourself)
- &endOut: when getting values, time selection end is stored to this variable (you can choose the name by yourself)
- bool allowautoseek: (not sure about this)
|
Did you write that, or do these things exist written somewhere for each of the commands? If they exist, then where!???
Because in the ReaScript Documentation I can only find this:
Code:
C: void GetSet_LoopTimeRange(bool isSet, bool isLoop, double* startOut, double* endOut, bool allowautoseek)
EEL: GetSet_LoopTimeRange(bool isSet, bool isLoop, &startOut, &endOut, bool allowautoseek)
Python: (Boolean isSet, Boolean isLoop, Float startOut, Float endOut, Boolean allowautoseek) = RPR_GetSet_LoopTimeRange(isSet, isLoop, startOut, endOut, allowautoseek)
Which is not very helpful...
|
|
|
03-22-2015, 11:21 PM
|
#15
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,241
|
Quote:
Originally Posted by amagalma
Because in the ReaScript Documentation I can only find this:
Code:
C: void GetSet_LoopTimeRange(bool isSet, bool isLoop, double* startOut, double* endOut, bool allowautoseek)
EEL: GetSet_LoopTimeRange(bool isSet, bool isLoop, &startOut, &endOut, bool allowautoseek)
Python: (Boolean isSet, Boolean isLoop, Float startOut, Float endOut, Boolean allowautoseek) = RPR_GetSet_LoopTimeRange(isSet, isLoop, startOut, endOut, allowautoseek)
Which is not very helpful...
|
The documentation is not very intuitive. It is more a reference than a documentation. It is not aimed at beginners. But once you understand how it is, it is the most used document when scripting
Thanks spk77 and amagalma. It is a very nice script idea
|
|
|
03-22-2015, 11:58 PM
|
#16
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,241
|
REAPER 5 version with toggle button support and runs in background.
Changed the behaviour to return to normal mode if no items are selected.
Download (for REAPER 5): Auto Record Mode.eel
* v0.1 (2015-03-23)
+ REAPER 5 version that runs in background and toggle button support
|
|
|
03-23-2015, 03:26 AM
|
#17
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Great script Heda!! :-) Solves the problem of needing a dedicated record button for automatic recording (as Reaper's default record button cannot be assigned to a custom action/script)
P.S. I'll add both scripts to my first post
Last edited by amagalma; 03-23-2015 at 04:35 AM.
|
|
|
06-13-2016, 02:56 PM
|
#18
|
Human being with feelings
Join Date: May 2016
Posts: 2,065
|
Quote:
Originally Posted by heda
REAPER 5 version with toggle button support and runs in background.
Changed the behaviour to return to normal mode if no items are selected.
Download (for REAPER 5): Auto Record Mode.eel
* v0.1 (2015-03-23)
+ REAPER 5 version that runs in background and toggle button support
|
Sorry to be such a newb, but how do I install the Auto Record script? I have the HeDa_Auto Record Mode.eel file download.
__________________
REAPER, just script it bro.
|
|
|
06-14-2016, 12:16 AM
|
#19
|
Human being with feelings
Join Date: Jan 2014
Location: Paris
Posts: 60
|
Conditionnal "actions"?
Why not using "conditionnal script"?
Depending on where the mouse cursor is the recording mode is selected...
|
|
|
09-22-2016, 10:58 AM
|
#20
|
Human being with feelings
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
|
Is this is ReaPack, what is its name there?
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:48 AM.
|