Old 06-28-2020, 03:00 AM   #1
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default Scripts for recording takes without splits

Hi guys,

I made two scripts a while back, that basically disable take auto-splitting when running in the background. Internally they work by automatically switching the recording mode to "record into lanes(layers)" and then cutting up the new layer when recording is done.

One caveat: You have to undo twice to undo your recorded take. (The first undo will bring back the recorded layer)

A: Without item extending (treat edges of items like splits)
https://stash.reaper.fm/v/38631/FTC_...w%20splits.lua


B: With item extending
https://stash.reaper.fm/v/38632/FTC_...20items%29.lua
FeedTheCat is online now   Reply With Quote
Old 06-28-2020, 07:55 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,584
Default

Nice !


I have made scripts to handle this problem after recoridng but not in background like that... can be very handy, thx !

note : consider reapack for sharing :P

https://reapack.com/upload
X-Raym is offline   Reply With Quote
Old 06-28-2020, 10:56 AM   #3
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,821
Default

Hey! This looks great!
Thanks.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 06-28-2020, 03:51 PM   #4
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,200
Default

NICE ONE FTC!!

Quote:
Originally Posted by X-Raym View Post
Nice !


I have made scripts to handle this problem after recoridng but not in background like that... can be very handy, thx !
Yeah... me too... although I think this will be more elegant.

Will try it tomorrow.

Great job @ FTC!!
__________________
Cheers,
Andrew K
v6.03+dev0114 - January 14 2020 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
Thonex is online now   Reply With Quote
Old 06-28-2020, 08:24 PM   #5
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Super Nice!!! Thanks

Already put in my fav scripts toolbar, will be testing it

Quote:
Originally Posted by X-Raym View Post
Nice !

note : consider reapack for sharing :P

https://reapack.com/upload
2!
daniellumertz is offline   Reply With Quote
Old 06-29-2020, 03:40 AM   #6
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

Right, I'm posting again since this script got a brand new thread of its own:

I'm on W10 x64 with Reaper 6.12c, and the script is not working here. Here's what I'm doing:
1) arm track
2) set recording to split into takes (default)
3) run script
4) start recording
5) record again (shorter? longer? it doesn't matter...)

Et voilà, the takes are all split as usual. I'm attaching a gif, it hopefully shows clearly so you can help me spot what I'm doing wrong!!



Thanks again,

M
metronomme is offline   Reply With Quote
Old 06-29-2020, 09:41 AM   #7
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Hi metronomme,

GIFs are always helpful Everything looks just fine though... I tried some stuff I had in mind to make the script malfunction, but nothing worked (which is a good thing I suppose ). So I need more info I guess. Could you check if the recording mode is switching to "Creates new media items in separate lanes (layers)" during recording? Doesn't look like it is, which pretty much would mean the script is not running in the background. Anything that's weird about your reaper setup? Stuff you have changed that come to mind or other scripts that are running?
FeedTheCat is online now   Reply With Quote
Old 06-30-2020, 01:28 AM   #8
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

Nah, I checked and as soon as I press record, the mode changes to "lanes (layers)", as expected.
I tried the script on a fresh, portable install of Reaper 6.12 and it also doesn't work! It is clearly something I am doing wrong

A couple of things:

* Are there any obvious dependencies that I am unaware of? (other scripts that everyone normally has but I might be missing?)
* Do the two version of the script need to be running at the same time for this to work? (I am only running the "extend items" version, and the other version is not even imported).

Thanks a lot for your help, and sorry for this mess...

Another hint:

- You mentioned the script creates a "double undo step" when reversing the recording, right? Well, in my case, as soon as I finish recording, if I press "undo" the recording is gone (in one only step), meaning that the script is not working somewhere after changing the mode to "lanes"

PS: I tried to have the two scripts running at the same time but they are clearly mutually exclusive: turning one on terminates the other, so that definitely can't be the answer to my problems

Last edited by metronomme; 06-30-2020 at 01:40 AM.
metronomme is offline   Reply With Quote
Old 06-30-2020, 02:24 AM   #9
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Quote:
Originally Posted by metronomme View Post
Nah, I checked and as soon as I press record, the mode changes to "lanes (layers)", as expected.
I tried the script on a fresh, portable install of Reaper 6.12 and it also doesn't work! It is clearly something I am doing wrong
To be fair, you seem to be doing everything correctly. What OS are you on? Maybe somebody else could also check if it works?

Quote:
Originally Posted by metronomme View Post
A couple of things:

* Are there any obvious dependencies that I am unaware of? (other scripts that everyone normally has but I might be missing?)
* Do the two version of the script need to be running at the same time for this to work? (I am only running the "extend items" version, and the other version is not even imported).
* There are no dependencies
* I made the scripts mutually exclusive so they don't get in a race condition. That's where I originally thought the issue might be...

Thanks for the hints, that gives me a lot more to work with! I'll have a look in the code right now. It's a bit hard to see what's going wrong, when I can't replicate it. I'll maybe add some debugging output so you can send me a screenshot of that, if that's ok with you.
FeedTheCat is online now   Reply With Quote
Old 06-30-2020, 03:29 AM   #10
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

@metronomme
Ok here's a version with some enabled debugging output:
https://stash.reaper.fm/v/39817/FTC_...29%20DEBUG.lua
Could you record once over an existing take while this is running and send me a screenshot of the console output?

While looking through the code I also found a bug that would affect empty lanes (fix incoming). And I had totally forgotten that it works with multiple armed tracks, which is pretty cool:

FeedTheCat is online now   Reply With Quote
Old 06-30-2020, 07:38 AM   #11
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

Code:
Play state changed. Current state: 0

Play state changed. Current state: 5
Switching to recording in layers
Found 1 armed track(s)
Track 2 contains 0 items before recording

Play state changed. Current state: 0
Restoring original recording mode
Track 2 contains 0 items after recording
Found 0 new item(s)!

Play state changed. Current state: 5
Switching to recording in layers
Found 1 armed track(s)
Track 2 contains 1 items before recording

Play state changed. Current state: 0
Restoring original recording mode
Track 2 contains 1 items after recording
Found 0 new item(s)!
Well, I think we might be onto something here....
Code:
"Found 0 new item(s)!"
That's clearly not what should happen, right?

(By the way, it says "Track 2 contains ..." but I did the recording test a fresh new project, which only contained 1 track!)

If I knew anything about lua scripting, I would try and delve into the code... but I don't

Thanks for your help, @FeedTheCat !
metronomme is offline   Reply With Quote
Old 06-30-2020, 09:12 AM   #12
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Quote:
Originally Posted by metronomme View Post
(By the way, it says "Track 2 contains ..." but I did the recording test a fresh new project, which only contained 1 track!)
Yeah it should say Track 1, that's an oopsie on my part

So it doesn't find a new item after recording :S Now that's weird. Since it successfully switches into the layer recording mode... Could you test the layer recording mode without the script running? Does that create a new item in a new lane?

Also, it looks like you recorded twice. What happened during the first recording? Wasn't there a new item on the track after recording?

Code:
Track 2 contains 0 items before recording
Track 2 contains 0 items after recording
Found 0 new item(s)!
FeedTheCat is online now   Reply With Quote
Old 06-30-2020, 09:21 AM   #13
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

I recorded twice, indeed. The first time, to create the initial item. The second time, to create the new overlapping take.

Each time I recorded, I ended with a new item in the track however the script didn't recognise it.
metronomme is offline   Reply With Quote
Old 06-30-2020, 10:49 AM   #14
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

I updated the debugging script. It has a potential fix and some more debugging output. I'd appreciate if you could post the console output:
https://stash.reaper.fm/v/39817/FTC_...29%20DEBUG.lua
FeedTheCat is online now   Reply With Quote
Old 06-30-2020, 01:15 PM   #15
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

Code:
Play state changed. Current state: 0

Play state changed. Current state: 5
Switching to recording in layers
Found 1 armed track(s)
Armed track 1 contains 0 items before recording
Track GUID: {789017F2-357B-47ED-A65C-9E48D9FD9944}
userdata: 000000000358B500

Play state changed. Current state: 0
Restoring original recording mode
Armed track 1:
Track GUID: {789017F2-357B-47ED-A65C-9E48D9FD9944}
userdata: 000000000358B500
It's the same track!
Armed track 1 contains 0 items after recording
Found 0 new item(s)!

Play state changed. Current state: 5
Switching to recording in layers
Found 1 armed track(s)
Armed track 1 contains 1 items before recording
Track GUID: {789017F2-357B-47ED-A65C-9E48D9FD9944}
userdata: 000000000358B500

Play state changed. Current state: 0
Restoring original recording mode
Armed track 1:
Track GUID: {789017F2-357B-47ED-A65C-9E48D9FD9944}
userdata: 000000000358B500
It's the same track!
Armed track 1 contains 1 items after recording
Found 0 new item(s)!
I just want to say how grateful I am that you are taking all this time to take care of this!

Would it be worth me sending my reaper.ini or any of those config files so you can reproduce my system on a portable install? (I wonder if I inadvertently set an option that is preventing the script from working?)
metronomme is offline   Reply With Quote
Old 06-30-2020, 02:28 PM   #16
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Well, there's all my suspicions out the window
Quote:
Originally Posted by metronomme View Post
I just want to say how grateful I am that you are taking all this time to take care of this!
Sure mate You seem adamant about making it work so I don't mind at all.
Quote:
Originally Posted by metronomme View Post
Would it be worth me sending my reaper.ini or any of those config files so you can reproduce my system on a portable install? (I wonder if I inadvertently set an option that is preventing the script from working?)
Could be worth a shot. It has to be some sort of setting. If only reaper didn't have 2 billion You said it does not work on your computer on a fresh portable install?
FeedTheCat is online now   Reply With Quote
Old 06-30-2020, 04:16 PM   #17
DanSwizer
Human being with feelings
 
DanSwizer's Avatar
 
Join Date: Sep 2019
Posts: 27
Default

Finally thank you man!Now we can use take system without pain in the ass!!
DanSwizer is offline   Reply With Quote
Old 06-30-2020, 04:59 PM   #18
xav
Human being with feelings
 
Join Date: Sep 2012
Posts: 24
Default

Great!
Your script is fantastic. Even better now.
I think that works only if the script runs from the first take. The script cannot work if there are already takes with a comp (without your script running), and we want to run your script for another recording from the beginning, without any split? Or am I missing something?
xav is offline   Reply With Quote
Old 06-30-2020, 05:22 PM   #19
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

Quote:
Originally Posted by FeedTheCat View Post
You said it does not work on your computer on a fresh portable install?
It doesn't. All the debug logs I've been sending come from the portable install...
I may try tomorrow to make a new fresh portable install and see if that changes anything, but in the meantime, here is the reaper.ini files of both the portable install, and my production install.

I am trying to get up to speed to learn ReaScript, I'd love to be able to help sorting this out! (But for the time being, I am pretty useless with both lua and eel...)
Attached Files
File Type: ini REAPER.ini (27.4 KB, 5 views)
metronomme is offline   Reply With Quote
Old 06-30-2020, 05:27 PM   #20
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

Oops, the portable install's ini didn't upload. Here it is:
Attached Files
File Type: ini reaper.ini (2.5 KB, 5 views)
metronomme is offline   Reply With Quote
Old 07-01-2020, 12:22 AM   #21
Pink Wool
Human being with feelings
 
Join Date: Apr 2020
Posts: 73
Default

Oh wow! This is a real improvement on the confusing take system on Reaper!

This should really be the style of takes BY default on Reaper. Now about those autosplits...

Thank you!
Pink Wool is online now   Reply With Quote
Old 07-01-2020, 01:12 AM   #22
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Quote:
Originally Posted by xav View Post
Great!
Your script is fantastic. Even better now.
I think that works only if the script runs from the first take. The script cannot work if there are already takes with a comp (without your script running), and we want to run your script for another recording from the beginning, without any split? Or am I missing something?
That sounds about right. The script only extends items until it hits another existing item. Look at the following example. One might expect the first two items to be combined into one take. But that would be a destructive process in reaper, since it is currently not possible for a single take to contain multiple source files (has been requested). As it stands the items would have to be glued together, which might not be a good idea. Hope I'm making sense, just woke up

FeedTheCat is online now   Reply With Quote
Old 07-01-2020, 01:45 AM   #23
myfeltgood
Human being with feelings
 
myfeltgood's Avatar
 
Join Date: Apr 2018
Location: Atlanta, GA, USA
Posts: 188
Default

This is great. It would be nice if you could share it via Reapack too.
myfeltgood is online now   Reply With Quote
Old 07-01-2020, 02:19 AM   #24
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Quote:
Originally Posted by myfeltgood View Post
This is great. It would be nice if you could share it via Reapack too.
I'll look into that over the weekend.
FeedTheCat is online now   Reply With Quote
Old 07-01-2020, 04:33 AM   #25
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

Right!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I found it.

(Bloooody hell....) ��*♀️��

In my setup, Reaper prompts me to keep/discard upon every recording. That means that when play_state changes to stop and the script runs the code to check for new items, the new item is still not created in the arrangement area!
I disabled that and it works like a charm.

However, I would love to keep using the "new recording prompt"; is there a way to trigger the code only when the take is actually created?
I am thinking something like this pseudo code:

Code:
var isRecordPrompt = 1
if play_state changes
   if isRecordPrompt
      wait until item is created / recording validated
      count new items
   endif
   count new items
endif
I tried to look in the reascript api for a function to wait until the new record prompt is accepted, but couldn't find. Is there something like this? Otherwise I'll happily live without it; your script is definitely worth it!

Thanks

Last edited by metronomme; 07-01-2020 at 04:41 AM.
metronomme is offline   Reply With Quote
Old 07-01-2020, 09:08 AM   #26
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

haha, that makes so much sense I had totally forgotten that existed. It's even the default behavior isn't it?

Quote:
Originally Posted by metronomme View Post
I tried to look in the reascript api for a function to wait until the new record prompt is accepted, but couldn't find. Is there something like this? Otherwise I'll happily live without it; your script is definitely worth it!
Thanks
I don't think there is something that gets triggered after that dialog. But I'll see if I can find some elegant solution.
FeedTheCat is online now   Reply With Quote
Old 07-01-2020, 09:35 AM   #27
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

At least it would be nice if we could get the user prefs and check that the option is not checked; if it is, the script could warn the user so it can be changed manually!

Or at least, now that you know you can document it so we avoid surprises...

Thanks a lot for your hard work!
metronomme is offline   Reply With Quote
Old 07-01-2020, 10:28 AM   #28
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Quote:
Originally Posted by metronomme View Post
At least it would be nice if we could get the user prefs and check that the option is not checked; if it is, the script could warn the user so it can be changed manually!

Or at least, now that you know you can document it so we avoid surprises...

Thanks a lot for your hard work!
I had it checked as well There's also different actions to stop recording in different ways, so I haven't seen this dialog for ages.. Anyhow, I think I found a relatively elegant solution. Could you check if it works?
https://stash.reaper.fm/v/39817/FTC_...29%20DEBUG.lua
FeedTheCat is online now   Reply With Quote
Old 07-03-2020, 10:04 AM   #29
xav
Human being with feelings
 
Join Date: Sep 2012
Posts: 24
Default

Once more thank you very much FeedtheCat, comping is now really easier.
Just one more question : reascript console output window pops up everytime I play or record when your script is active. Not a big deal, but is it possible to avoid that?
xav is offline   Reply With Quote
Old 07-03-2020, 12:09 PM   #30
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Quote:
Originally Posted by xav View Post
Once more thank you very much FeedtheCat, comping is now really easier.
Just one more question : reascript console output window pops up everytime I play or record when your script is active. Not a big deal, but is it possible to avoid that?
I think you might be using an old DEBUG version I posted for metronomme. I'm not quite sure yet how good this version works. For now it's safer to use the one from the first post. Or even the latest DEBUG version and tell me if it works If you want to quickly disable the reascript output, there should be this line in the script somewhere near the top: "local debug = true". Change the true to false. ("local debug = false")
FeedTheCat is online now   Reply With Quote
Old 07-03-2020, 02:23 PM   #31
xav
Human being with feelings
 
Join Date: Sep 2012
Posts: 24
Default

Yes! It's perfect now.
xav is offline   Reply With Quote
Old 07-10-2020, 04:21 AM   #32
metronomme
Human being with feelings
 
Join Date: Mar 2018
Posts: 28
Default

Quote:
Originally Posted by FeedTheCat View Post
I had it checked as well There's also different actions to stop recording in different ways, so I haven't seen this dialog for ages.. Anyhow, I think I found a relatively elegant solution. Could you check if it works?
https://stash.reaper.fm/v/39817/FTC_...29%20DEBUG.lua
Sorry for taking so long in checking this, I have been using your script with the option "prompt to save/delete/rename new files" switched off, and it works a charm.

However, I did try today with your debug script, and it threw the following error:

Code:
...Record takes without new splits (extend items) DEBUG.lua:57: bad argument #1 to 'SetMediaItemTakeInfo_Value' (MediaItem_Take expected)
metronomme is offline   Reply With Quote
Old 07-10-2020, 04:56 AM   #33
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Great scripts! Thank you! These behaviors should be native to Reaper. Consider sharing them via ReaPack. They will be available to more people and it will be easier for you to maintain and for people to always get the latest version etc.
amagalma is offline   Reply With Quote
Old 07-10-2020, 05:28 AM   #34
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,191
Default

Quote:
Originally Posted by FeedTheCat View Post
One caveat: You have to undo twice to undo your recorded take. (The first undo will bring back the recorded layer)

If you don't create undo points by yourself then when undoing you don't have to undo twice. BUT if you decide to redo after undoing then you get overlapping items and not what your script did.
amagalma is offline   Reply With Quote
Old 07-10-2020, 12:49 PM   #35
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Posts: 102
Default

Quote:
Originally Posted by amagalma View Post
Great scripts! Thank you! These behaviors should be native to Reaper. Consider sharing them via ReaPack. They will be available to more people and it will be easier for you to maintain and for people to always get the latest version etc.
Yup, will do. I keep saying that lol Still really busy on my Midi Editor Magic script.

Quote:
Originally Posted by amagalma View Post
If you don't create undo points by yourself then when undoing you don't have to undo twice. BUT if you decide to redo after undoing then you get overlapping items and not what your script did.
yeah... there's downsides to both. Wish we could consolidate existing undo points.
FeedTheCat is online now   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:57 AM.


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