Old 09-30-2009, 04:39 AM   #1
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default JS: play_state ignores pause button

In the JS engine the variable 'play_state' seems to ignore the pause button.

transport stopped -> click pause -> play_state=0 (According to the JS reference it should be 2)
transport play -> click pause -> play_state=1 (should be 2)
transport record -> click pause -> play_state=5 (should be 6)

(REAPER 3.11)

In the bug tracker:
http://forum.cockos.com/project.php?issueid=2226

Last edited by Blechi; 02-17-2011 at 05:03 AM.
Blechi is offline   Reply With Quote
Old 09-30-2009, 04:53 AM   #2
whatsup
Human being with feelings
 
whatsup's Avatar
 
Join Date: Aug 2008
Posts: 1,144
Default

Quote:
Originally Posted by Blechi View Post
In the JS engine the variable 'play_state' seems to ignore the pause button.

transport stopped -> click pause -> play_state=0 (According to the JS reference it should be 2)
transport play -> click pause -> play_state=1 (should be 2)
transport record -> click pause -> play_state=5 (should be 6)

(REAPER 3.11)
not confirmed.

work very well as it should, here. (new beta relase)

maybe you use old version ?
__________________
you can contack me on
whatsup@inn.co.il
whatsup is offline   Reply With Quote
Old 09-30-2009, 05:04 AM   #3
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

Just installed the new beta, still no luck here. (3.12pre2, Vista)
Has JS to be updated separately?

'play_state' should be 2 here:


and here 'play_state' should be 6:

Last edited by Blechi; 09-30-2009 at 05:30 PM.
Blechi is offline   Reply With Quote
Old 09-30-2009, 05:23 AM   #4
whatsup
Human being with feelings
 
whatsup's Avatar
 
Join Date: Aug 2008
Posts: 1,144
Default

now i see what you mean,
when in record mode, it seems that you have to add 5 to the play_state.

it seems to me correct (== that's how it should be).

EDIT: add 4 (not 5) to the play_state
__________________
you can contack me on
whatsup@inn.co.il

Last edited by whatsup; 09-30-2009 at 05:26 AM.
whatsup is offline   Reply With Quote
Old 09-30-2009, 05:54 AM   #5
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

As it is now you can't tell whether playback/record is paused or not (using 'play_state').
Stopped yes, but not paused.
Blechi is offline   Reply With Quote
Old 09-30-2009, 06:25 AM   #6
whatsup
Human being with feelings
 
whatsup's Avatar
 
Join Date: Aug 2008
Posts: 1,144
Default

Quote:
Originally Posted by Blechi View Post
As it is now you can't tell whether playback/record is paused or not (using 'play_state').
Stopped yes, but not paused.
i think you can

if play_state is more than 4, it's in record mode,
now subtract 4 from the play_state to know its play mode.
__________________
you can contack me on
whatsup@inn.co.il
whatsup is offline   Reply With Quote
Old 09-30-2009, 06:35 AM   #7
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

I don't want to know if play or record mode.
I want to know if paused or not and that's not possible now.
Blechi is offline   Reply With Quote
Old 09-30-2009, 06:57 AM   #8
whatsup
Human being with feelings
 
whatsup's Avatar
 
Join Date: Aug 2008
Posts: 1,144
Default

Quote:
Originally Posted by Blechi View Post
I don't want to know if play or record mode.
I want to know if paused or not and that's not possible now.
when i said play mode i included the pause too.

let say you get in play_state value of 5, that means reaper is in record mode,
now i subtract 4 i get 1 == play mode

let say i get in play_state value of 6, that means reaper is in record mode,
now i subtract 4 i get 2 == pause mode

and if i get in play_state value below 5 i don't do any subtract.

isn't it so ?
__________________
you can contack me on
whatsup@inn.co.il
whatsup is offline   Reply With Quote
Old 09-30-2009, 07:23 AM   #9
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

That's right.
The thing is i don't get 6 nor 2 in 'play_state' here.
0,1 and 5, that's it.

play AND pause(play) both return 1 in play_state

record AND pause(record) both return 5 in play_state

As it is now i can add and subtract 'til the cows come home and i still don't know if play/record is paused or not.
Blechi is offline   Reply With Quote
Old 09-30-2009, 07:51 AM   #10
whatsup
Human being with feelings
 
whatsup's Avatar
 
Join Date: Aug 2008
Posts: 1,144
Default

Quote:
Originally Posted by Blechi View Post
That's right.
The thing is i don't get 6 nor 2 in 'play_state' here.
0,1 and 5, that's it.
now i understand you more, but i do get them, just checked again.
__________________
you can contack me on
whatsup@inn.co.il
whatsup is offline   Reply With Quote
Old 09-30-2009, 09:54 AM   #11
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 7,864
Default

Quote:
Originally Posted by Blechi View Post
That's right.
The thing is i don't get 6 nor 2 in 'play_state' here.
0,1 and 5, that's it.

play AND pause(play) both return 1 in play_state

record AND pause(record) both return 5 in play_state

As it is now i can add and subtract 'til the cows come home and i still don't know if play/record is paused or not.
This probably depends on whether you have FX running on stop.. play_state doesn't get updated when the JS is not running/processing audio, and it is likely that in your instance it is not running on pause...
Justin is offline   Reply With Quote
Old 09-30-2009, 10:21 AM   #12
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

Quote:
Originally Posted by Justin View Post
This probably depends on whether you have FX running on stop.. play_state doesn't get updated when the JS is not running/processing audio, and it is likely that in your instance it is not running on pause...
Do you mean the 'Run FX when stopped (good for certain VSTi)'-option ?
It's ticked.

'play_state' seems to be updated correctly when the track is record armed.
Then pause shows up in 'play_state'.
Is this supposed to work this way?
Blechi is offline   Reply With Quote
Old 09-30-2009, 02:27 PM   #13
whatsup
Human being with feelings
 
whatsup's Avatar
 
Join Date: Aug 2008
Posts: 1,144
Default

Quote:
Originally Posted by Blechi View Post
Do you mean the 'Run FX when stopped (good for certain VSTi)'-option ?
It's ticked.
i think he meant that, yeh.

so what you can do i think, is to upload your reaper.ini file + the project file, so we can look at it, maybe it'll help.
__________________
you can contack me on
whatsup@inn.co.il
whatsup is offline   Reply With Quote
Old 09-30-2009, 04:46 PM   #14
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

Thanks for your efforts.
A testproject and the reaper.ini are attached to this post.
How to reproduce:
- open the JS delay (or any other JS FX) in track one and click on 'edit..'
- look for the variable 'play_state' on the right side of the editor window
- record arm track 1 and click all combinations of play, stop, pause, record watching 'play_state' -> everything is as it should be (play_state= 0,1,2,5 or 6)
- now unarm track 1 and repeat the procedure. -> the pause states (2 and 6) do not show up in 'play_state' (play_state= 0,1 or 5)

pilot error or bug or design?
Attached Files
File Type: zip play_state confusion.zip (7.3 KB, 33 views)

Last edited by Blechi; 09-30-2009 at 05:29 PM.
Blechi is offline   Reply With Quote
Old 10-01-2009, 12:40 AM   #15
whatsup
Human being with feelings
 
whatsup's Avatar
 
Join Date: Aug 2008
Posts: 1,144
Default

i tried this several times, and it works fine here,
but there are 2 differences:
1. i don't have asio driver
2. i don't have the extensions.

so what you can do is a little test.

first, try to change the audio driver to WaveOut

second, if the problem still exist, rename the extension plugin file from ?.dll to ?. bak and restart reaper.

EDIT: it works fine even when run fx on stop - unchecked
__________________
you can contack me on
whatsup@inn.co.il

Last edited by whatsup; 10-01-2009 at 01:24 AM.
whatsup is offline   Reply With Quote
Old 10-01-2009, 03:09 AM   #16
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

results so far:
- fx on stop un-/checked: no luck
- using other audio drivers: no luck
- disabling extensions: no luck

Last edited by Blechi; 10-01-2009 at 03:13 AM.
Blechi is offline   Reply With Quote
Old 10-01-2009, 03:29 AM   #17
whatsup
Human being with feelings
 
whatsup's Avatar
 
Join Date: Aug 2008
Posts: 1,144
Default

Quote:
Originally Posted by Blechi View Post
- now unarm track 1 and repeat the procedure. -> the pause states (2 and 6) do not show up in 'play_state' (play_state= 0,1 or 5)
i'm sorry it's my fault ( i knew i should read it again)

in my settings, each track auto arm on select, so i didn't notice,
but now after re-reading this i got it.

you're absolutly right, the play_state var doesn't get updated on pause when the track is not armed.

Confirmed, it is a bug.
__________________
you can contack me on
whatsup@inn.co.il
whatsup is offline   Reply With Quote
Old 04-25-2011, 12:17 PM   #18
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 4,701
Default

Resurrecting an old thread, sorry...

I just stumbled on this. Pause is not reported as play_state == 2, which is what the JS programming ref claims. Any news on this? Will it be fixed?

What happens is, I play and my JS FX sees play_state == 1, which is fine. Then I hit ENTER to pause, and still play_state == 1, when it should be 2. My code does not work very well, not useful at all actually, since it needs to treat stopped and paused the same way.

And I have "Run FX on stop" turned on, and this is on R4alpha66
__________________
// MVHMF
Vote for the Starter Marker FR here http://forum.cockos.com/project.php?issueid=4371
Let's finally get rid of those ugly odd time measures.
Fabian 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 09:01 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.