Old 12-12-2018, 10:38 PM   #1
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 3,409
Default JSFX: How to use play_state properly?

play_state is only available in @block and @sample, but, at least according to my tests, it never goes in to pause mode (value 2) when the transport is paused. How is this value to be used/read?

Thanks!
clepsydrae is offline   Reply With Quote
Old 12-13-2018, 04:21 AM   #2
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default

That's odd. It changes to 2 here when playing is Paused (and 6 when recording is Paused).

Reaper v5.95, Windows 7 SP1
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 12-13-2018, 08:51 AM   #3
Chris T
Human being with feelings
 
Join Date: Dec 2010
Posts: 48
Default

when you click pause in transport a jsfx plugin should show play_state=2 in the system variables list. can you confirm? anyhow, is it possible to change the play_state from the plugin? what's odd about the states 2 and 6? any combination of play pause and record has a different state number..
Chris T is offline   Reply With Quote
Old 12-13-2018, 01:01 PM   #4
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 3,409
Default

Using a blank config directory, in 5.963 on linux, if I make a new track (not record armed) and place this code in there:

Code:
@sample

play_state < 0 ? gotlt0+=1;
play_state == 0 ? got0+=1;
play_state == 1 ? got1+=1;
play_state == 2 ? got2+=1;
play_state == 3 ? got3+=1;
play_state == 4 ? got4+=1;
play_state == 5 ? got5+=1;
play_state == 6 ? got6+=1;
...I see the 0-state counting up. I press play on transport and I see 1-state counting up. I press pause and everything stops counting, and play_state in the debugger sits at 1.

Maybe this is because reaper detects that no audio is streaming through the plugin and effectively stops servicing it to save CPU? (E.g. if the track is record enabled it works as expected and 2-state counts up.)

Are you all seeing differently?

In windows on 5.27 (in a VM) I see the same, with the additional caveat that sometimes the stop state doesn't seem to increase while stopped, and other times it does.
clepsydrae is offline   Reply With Quote
Old 12-13-2018, 02:34 PM   #5
Chris T
Human being with feelings
 
Join Date: Dec 2010
Posts: 48
Default

same here. The track needs to be record armed!!
Chris T is offline   Reply With Quote
Old 12-15-2018, 11:31 AM   #6
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

Yes, play_state seems to be a bit broken. I couldn't say when it happened but it definitely used to work as described in the documentation. I just tested and pause doesn't register in normal playback unless the track is record armed.
IXix 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 02:40 PM.


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