Old 02-25-2020, 01:42 PM   #1
LarrySeyer
Human being with feelings
 
LarrySeyer's Avatar
 
Join Date: Sep 2006
Location: Austin, Tx
Posts: 84
Default Insert Time Key

Seems like such a required item but can’t seem to find it.

Is there a script/function to insert X number of seconds at the cursor point?
LarrySeyer is online now   Reply With Quote
Old 02-25-2020, 08:21 PM   #2
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,282
Default

I think you have some confusion maybe about how this works
you never insert any amount of time into the ruler itself
what you can do is move everything to the right by some amount of time
which in effect 'inserts' some time in the project

or maybe I don't understand what you want to accomplish
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain
hopi is offline   Reply With Quote
Old 02-26-2020, 09:48 PM   #3
LarrySeyer
Human being with feelings
 
LarrySeyer's Avatar
 
Join Date: Sep 2006
Location: Austin, Tx
Posts: 84
Default

That is exactly what I'm trying to do.

And yes, I know I can split all items at the cursor point and then move everything to the right of the timeline further to the right.

But how many keystrokes / mouse moves / item selections does that take when there are hundreds of tracks? (more than I want to count)

In many other daws (and video editors) there is a keystroke/function that does exactly this:

1. place your cursor where you want to insert time.
2. hit a key
3. a window pops up and asks how much time to insert.
4. everything is split at that cursor position
5. all objects to the right are moved over by the amount of time you specified.

This is absolutely necessary when working on audio for film... and also used extensively when editing book audio dialog.

Seems like a function Reaper should have had years ago.

L
LarrySeyer is online now   Reply With Quote
Old 02-27-2020, 03:50 PM   #4
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,360
Default

Time selection: Insert empty space at time selection (moving later items)
Reapack
Insert empty space from time selection at edit cursor (moving later items)
Insert empty space at time selection (prevent moving locked items)

It would be easy enough to script what you need if you want a user input box.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Old 02-27-2020, 03:55 PM   #5
LarrySeyer
Human being with feelings
 
LarrySeyer's Avatar
 
Join Date: Sep 2006
Location: Austin, Tx
Posts: 84
Default

Quote:
Originally Posted by MusoBob View Post
Reapack
Insert empty space from time selection at edit cursor (moving later items)
Insert empty space at time selection (prevent moving locked items)

It would be easy enough to script what you need if you want a user input box.
That would be awesome.

The way that you describe above requires you to select time first... but if there is no space to select time, then what?

In my opinion, there needs to be a function that pops up a text box asking for X number of seconds (or X number of beats/measures) to insert at the cursor position.

Doing it this way does not require making a time selection where space to do so does not exist.

BTW, if you're offering to make a script to do this, it would be greatly appreciated!

You have been helpful in the past with my requests. Thank you for taking the time.

All the best to you!
LarrySeyer is online now   Reply With Quote
Old 02-27-2020, 04:08 PM   #6
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,360
Default

So rather than select the amount with time selection you want to enter it in a box ?

__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Old 02-27-2020, 04:27 PM   #7
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,360
Default

Try that
Code:
retval_inputs, time_set = reaper.GetUserInputs( "Set Time to Insert", 1, "Insert Time amount", "0" )
if retval_inputs then   
  cur_pos = reaper.GetCursorPosition() 

  start_time, end_time = reaper.GetSet_LoopTimeRange2(0, true, false, cur_pos, cur_pos + time_set, true)  

  reaper.Main_OnCommand(40200, 0)  -- Time selection: Insert empty space at time selection (moving later items)

  reaper.Main_OnCommand(40635, 0)  -- Time selection: Remove time selection
end
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com

Last edited by MusoBob; 02-27-2020 at 04:38 PM.
MusoBob is offline   Reply With Quote
Old 02-27-2020, 09:41 PM   #8
LarrySeyer
Human being with feelings
 
LarrySeyer's Avatar
 
Join Date: Sep 2006
Location: Austin, Tx
Posts: 84
Default

Quote:
Originally Posted by MusoBob View Post
Try that
Code:
retval_inputs, time_set = reaper.GetUserInputs( "Set Time to Insert", 1, "Insert Time amount", "0" )
if retval_inputs then   
  cur_pos = reaper.GetCursorPosition() 

  start_time, end_time = reaper.GetSet_LoopTimeRange2(0, true, false, cur_pos, cur_pos + time_set, true)  

  reaper.Main_OnCommand(40200, 0)  -- Time selection: Insert empty space at time selection (moving later items)

  reaper.Main_OnCommand(40635, 0)  -- Time selection: Remove time selection
end
YES!

That is exactly what I was looking for.

Thank you!
LarrySeyer is online now   Reply With Quote
Old 03-03-2020, 11:28 AM   #9
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,282
Default

Quote:
Originally Posted by MusoBob View Post
Try that
Code:
retval_inputs, time_set = reaper.GetUserInputs( "Set Time to Insert", 1, "Insert Time amount", "0" )
if retval_inputs then   
  cur_pos = reaper.GetCursorPosition() 

  start_time, end_time = reaper.GetSet_LoopTimeRange2(0, true, false, cur_pos, cur_pos + time_set, true)  

  reaper.Main_OnCommand(40200, 0)  -- Time selection: Insert empty space at time selection (moving later items)

  reaper.Main_OnCommand(40635, 0)  -- Time selection: Remove time selection
end
thanks Bob... but a question plz
about the value we enter...
seems a little strange... if I enter 1 it inserts half of a measure
if I enter 0.5 it inserts 1/4 of a measer
if I enter 2 it inserts a full measure

can you explain the logic here?
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain
hopi is offline   Reply With Quote
Old 03-03-2020, 02:55 PM   #10
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,360
Default

It's in time as he was working with video.
If you want beats or bars you will need to get the current tempo and beats bars to work out time to insert.
I think there are already scripts in ReaTrak that prompt for amount of bars to insert.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Old 03-03-2020, 04:21 PM   #11
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,282
Default

OIC thanks that clears it up and makes it workable
so now I know 1 will insert 1 sec of space.... actually that is fine and easy enough to make sense and do whatever is desired
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain
hopi is offline   Reply With Quote
Old 03-03-2020, 06:19 PM   #12
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,360
Default

Try this it should work on the current time signature and tempo at the cursor:
Code:
retval_inputs, bars_set = reaper.GetUserInputs( "Set Bars to Insert", 1, "Insert Bars", "0" )
if retval_inputs then   
  cur_pos = reaper.GetCursorPosition()
  
  timesig_num, timesig_denom, bpm = reaper.TimeMap_GetTimeSigAtTime(0, cur_pos)
  
  time_set = (((bars_set * timesig_num) / bpm) * 60) 

  start_time, end_time = reaper.GetSet_LoopTimeRange2(0, true, false, cur_pos, cur_pos + time_set, true)
  
  reaper.Main_OnCommand(40200, 0)  -- Time selection: Insert empty space at time selection (moving later items)
  
  reaper.Main_OnCommand(40635, 0)  -- Time selection: Remove time selection  
end
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Old 03-04-2020, 09:08 AM   #13
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,282
Default

oh yeah... that is lovely Bob...

works perfectly with both whole numbers and decimals

got it added to the Main Insert menu now

Thanks so much!
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain
hopi 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 08:18 AM.


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