Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 10-18-2021, 09:33 AM   #1
Welrod
Human being with feelings
 
Join Date: Sep 2021
Posts: 8
Default Play/Pause while Playing but Play/Stop while Recording, possible w/ Space Key only ?

Hello everybody

This is what I wish :

- When I hit Spacebar when Reaper is playing = the cursor stay at the location when I hit Spacebar
(Play/Pause already do this)

- When I hit Spacebar WHILE RECORDING = it stop the playback and keep the cursor at the location when I hit Spacebar
(For the cursor location, I found in Preferences - Editing Behavior : Move edit cursor to end of recorded items on record stop)

The problem here is that I have to setup another key to that STOP option.

So is there a way to combine these options to an unique Spacebar key ?


First solution : Be able to keep the cursor location when we stop even when we are not recording
Second solution : Be able to stop the recording when we hit Pause button ? ..
Third solution : Let me know ?


English is not my mother tongue, sorry for that.

Thank you a lot.
Welrod is offline   Reply With Quote
Old 10-18-2021, 09:57 AM   #2
sockmonkey72
Human being with feelings
 
sockmonkey72's Avatar
 
Join Date: Sep 2021
Location: Berlin
Posts: 1,935
Default

This script should do what you want (I think).

Play_StopAtCurrentLocation.eel.zip

Here's the code in case you want to review it first:

Code:
states = GetPlayStateEx(0);
states == 0 || states & 2 ? (
  OnPlayButtonEx(0);
) : states & 1 || states & 4 ? (
  now = GetPlayPositionEx(0);
  OnStopButtonEx(0);
  SetEditCurPos2(0, now, 0, 0);
);
EDIT: fix logic for stop/pause vs play/record

Last edited by sockmonkey72; 10-18-2021 at 11:54 AM.
sockmonkey72 is offline   Reply With Quote
Old 10-18-2021, 01:15 PM   #3
Welrod
Human being with feelings
 
Join Date: Sep 2021
Posts: 8
Default

Thank you for your answer but could you do me like a noob tutorial to make this work ?


Quote:
Originally Posted by sockmonkey72 View Post
This script should do what you want (I think).

Attachment 46733

Here's the code in case you want to review it first:

Code:
states = GetPlayStateEx(0);
states == 0 || states & 2 ? (
  OnPlayButtonEx(0);
) : states & 1 || states & 4 ? (
  now = GetPlayPositionEx(0);
  OnStopButtonEx(0);
  SetEditCurPos2(0, now, 0, 0);
);
EDIT: fix logic for stop/pause vs play/record
Welrod is offline   Reply With Quote
Old 10-18-2021, 01:20 PM   #4
sockmonkey72
Human being with feelings
 
sockmonkey72's Avatar
 
Join Date: Sep 2021
Location: Berlin
Posts: 1,935
Default

Quote:
Originally Posted by Welrod View Post
Thank you for your answer but could you do me like a noob tutorial to make this work ?
1. Download the zip file and extract it to your REAPER resources folder (look in the Options menu > Show REAPER resource path), subfolder Scripts.
2. Open the Actions window (type '?' by default), choose New Action... and then Load ReaScript...
3. Navigate to the script file you just saved and load it.
4. Now the script will show up in your Actions window. Assign some unused key to the script action to test it out. If you're happy with it, you can assign the spacebar and overwrite the default mapping to Transport:Play/Stop.

There are plenty of tutorials online for installing and loading scripts in REAPER if those instructions aren't clear enough.
sockmonkey72 is offline   Reply With Quote
Old 10-18-2021, 01:29 PM   #5
Welrod
Human being with feelings
 
Join Date: Sep 2021
Posts: 8
Default

Thank you Mister, this is awesome !

It seems to work perfectly !



Quote:
Originally Posted by sockmonkey72 View Post
1. Download the zip file and extract it to your REAPER resources folder (look in the Options menu > Show REAPER resource path), subfolder Scripts.
2. Open the Actions window (type '?' by default), choose New Action... and then Load ReaScript...
3. Navigate to the script file you just saved and load it.
4. Now the script will show up in your Actions window. Assign some unused key to the script action to test it out. If you're happy with it, you can assign the spacebar and overwrite the default mapping to Transport:Play/Stop.

There are plenty of tutorials online for installing and loading scripts in REAPER if those instructions aren't clear enough.
Welrod 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 04:46 AM.


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