Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
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: 15,721
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, 176 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: 7,416
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
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 07-19-2016, 04:39 PM   #19
ijijn
Human being with feelings
 
ijijn's Avatar
 
Join Date: Apr 2012
Location: Christchurch, New Zealand
Posts: 482
Default

Oh boy, dare I re-resurrect this thread?

Well, it seems silly to create a new one when all the information is here and eerily current...

I only just discovered this problem because I haven't really used pause at all, but it's certainly something I'd like to support in my plugins, and of course I love JSFX so much that I'd like to see any minor rough edges taken care of.

I can confirm that the "pause = 2" feature still depends on the track being armed for recording, not on whether the plugin is actually running.

From my experiments, it seems that plugins are always stopped on pause, whereas their behaviour on stop is governed by the settings. Record arming a track overrides this to always on, of course, which is why it works as expected with armed tracks. Perhaps the pause case could obey the same laws as the stop, or have its own setting, or be always on, unless there's a reason that can't happen? Failing that, how about setting the value correctly as part of the finishing execution process?

I personally like JSFX plugins to be always on, especially those without any @sample code, because that means we can choose to do nothing (or just enough logic to accomplish the right kind of nothing) precisely when we want to.

Really sorry for being a nuisance, but is there any chance of looking into this? Doesn't it seem a bit weird that pause is more lethargic than stop?

Thanks!

PS Here's my quick and dirty visual test script, in case it's of use to anyone:

Code:
desc:Pause test

@init

ext_noinit = 1;

@block

blockCount += 1;
blockPlayState = play_state;

@gfx 300 300

gfxCount += 1;
gfx_a = gfx_r = gfx_g = gfx_b = 1;
gfx_x = gfx_y = 8;
gfx_drawstr(sprintf(#, "block processing: %d \n\n", blockCount));
gfx_drawstr(sprintf(#, "play_state: %d\n\n", blockPlayState));
gfx_drawstr(sprintf(#, "paused: %s\n\n", blockPlayState === 2 ? "true" : "false"));
gfx_drawstr(sprintf(#, "gfx processing: %d", gfxCount));
ijijn is offline   Reply With Quote
Old 04-21-2017, 04:46 PM   #20
jonhallur
Human being with feelings
 
Join Date: Feb 2012
Posts: 4
Default

Yes please, fix this so that play_state will report the proper states without the track having to be armed.
jonhallur 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 01:51 AM.


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