Old 02-15-2020, 10:22 AM   #1
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default LUA : Archie_Info; Counter time project.lua

Archie_Info; Counter time project(AutoRun).lua
Hello everybody!
It seems to me that the reaper lacked a function that would show the real time spent on the project.
So, I made a script that counts the working time in the project.
The script has AFK mode, in this mode the script pauses its timer if the project is idle for one minute (this time can be changed), in order to change it, you need to edit the line "AFK = 60" and enter the required number of seconds instead of 60.

I want to draw attention to the fact that the time spent on working on a project goes even when the script window is closed, i.e. the script does not need to be run all the time, but run only if you need to see how much you are working on the project.

At the first start, the script will ask you to restart the reaper and after rebooting the reaper, the script will start its work, even if you did not run it.

The time counter is stored in the project, and written to the project when the project is saved.
Right-click for more information about the project.

Note: Please note that script cannot be added to reaper startup, as script is already initially loaded with reaper.


Updated 20.02.20 V. 1. 06
Added a new theme (scr 2)
Added three new tracked time from the start of the Reaper
Added saving the dock, now the script remembers its dock when Reaper is rebooted
Added window opening, i.e. If the window was opened when the Reaper was closed, then the next time the Reaper is started, the window will be opened and will be in the same place(scr 3).

Updated 21.02.20 V. 1. 07
Fixed bug - where time stopped after one minute when playing or recording.


Updated 22.02.20 V.1.10.
Fixed: Reset time when creation a new project from the menu 'File'.
Added item Remove Focus Win to the right click menu.


Updated 23.02.20 V.1.11
Added reset all project timers to the context menu.


Updated 24.02.20 V.1.15
Added: playing Time since inception of project v.1.15





scr 2




scr 3



Archie_Info; Counter time project(AutoRun).lua
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate

Last edited by Archie; Yesterday at 09:33 PM.
Archie is offline   Reply With Quote
Old 02-18-2020, 03:36 PM   #2
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 118
Default

I use something similar from user Sexan "Script: Sexan_Project time counter with AFK mode.lua" but this is more advanced!!! The only thing is that when you dock the script, it doesn't remember the docked position when you reopen the project or reaper, could you please take a look when you get a chance... Thank you so much for your time Archie!
_TIP_ is offline   Reply With Quote
Old 02-19-2020, 11:47 AM   #3
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 555
Default

How does the script determine whether the user is idle or not? Mouse movement? Project states?

Just curious. I used to use a modded version of Sexan's timer script.
__________________
My Scripts
Dafarkias is offline   Reply With Quote
Old 02-20-2020, 09:11 AM   #4
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Quote:
Originally Posted by _TIP_ View Post
I use something similar from user Sexan "Script: Sexan_Project time counter with AFK mode.lua" but this is more advanced!!! The only thing is that when you dock the script, it doesn't remember the docked position when you reopen the project or reaper, could you please take a look when you get a chance... Thank you so much for your time Archie!
Added, now remembers. The first message contains a list of updates. V. 1. 06

Quote:
Originally Posted by Dafarkias View Post
How does the script determine whether the user is idle or not? Mouse movement? Project states?

Just curious. I used to use a modded version of Sexan's timer script.
The script monitors the project state if no changes were made in the project within one minute, i.e. if nothing was selected/moved/clicked, the time is stopped.
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate

Last edited by Archie; 02-21-2020 at 01:25 AM.
Archie is offline   Reply With Quote
Old 02-20-2020, 01:16 PM   #5
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,021
Default

Really nice!
__________________
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 02-20-2020, 04:42 PM   #6
Denys
Human being with feelings
 
Denys's Avatar
 
Join Date: Jan 2011
Location: Qc
Posts: 127
Default

Hello! Nice work, this looks promising!


Does it take in account the playing state? Let's say, for instance, that I listen to a track during 5mn without moving the mouse: is time counted?
__________________
My Bandcamp Page
Denys is offline   Reply With Quote
Old 02-20-2020, 06:37 PM   #7
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,080
Default

Brilliant idea!
__________________
Cheers,
Andrew K
v6.03+dev0114 - January 14 2020 • Mac 10.12.+ • i7 Quad 2.9GHz • 24GB
Thonex is offline   Reply With Quote
Old 02-21-2020, 01:14 AM   #8
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Quote:
Originally Posted by Denys View Post
Does it take in account the playing state? Let's say, for instance, that I listen to a track during 5mn without moving the mouse: is time counted?
Yes indeed when listening or when recording for more than one minute, time stopped.
Fixed - now when listening or recording, time always goes by. v 1.07
As for the mouse, the script does not look at the state of the mouse at all, because you can, for example, dig into the browser on the second monitor, and the script will think that you are working and will never stop time when you are at the computer, so the script only looks at the state project, if the project has not occurred any changes i.e. if nothing was selected / moved / pressed within one minute, then the time stops.
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old 02-21-2020, 05:44 AM   #9
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Thanks for the script! Some thoughts:

1. Could it be possible to not have the script window be focuse on Reaper-Startup?

2. I do not quite get the "session" timer. Somehow it seems to me to be always the same as "Reaper" timer.

3. I have no idea to make it better, but "Afk" is better explained as "effective worked time on this project" and thus seems oddly labeld to me. But it's not that critical, if once get how this is really meant to be.

Great work and a great timer, thank you !
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old 02-21-2020, 06:23 AM   #10
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Quote:
Originally Posted by Tagirijus View Post
1. Could it be possible to not have the script window be focuse on Reaper-Startup?
At the beginning of the script, set the OpenWinStartReaper = 2 parameter to the OpenWinStartReaper = 0, and the script will not remember the window state active or not when the Reaper is rebooted

Quote:
Originally Posted by Tagirijus View Post
2. I do not quite get the "session" timer. Somehow it seems to me to be always the same as "Reaper" timer.
At first, Yes, this time may seem the same, but as soon as you open the second project in the tab, this time will run up, because the active project will tick, and in an inactive project, the time will not go.
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate

Last edited by Archie; 02-21-2020 at 06:34 AM.
Archie is offline   Reply With Quote
Old 02-21-2020, 07:17 AM   #11
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Quote:
Originally Posted by Archie View Post
At the beginning of the script, set the OpenWinStartReaper = 2 parameter to the OpenWinStartReaper = 0, and the script will not remember the window state active or not when the Reaper is rebooted
Thanks. This can deactivate the script from opening automatically. There is no inbetween solution to let it open, but give back the focus to the main window of Reaper, hm?


Quote:
Originally Posted by Archie View Post
At first, Yes, this time may seem the same, but as soon as you open the second project in the tab, this time will run up, because the active project will tick, and in an inactive project, the time will not go.
Ok, I think I am going to understand. So "session" means "tab" here, if I am right. Thanks for explaining!
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old 02-21-2020, 08:02 AM   #12
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

I think I found some kind of bug:

When auto saving is enabled and you worked with an unsaved project, it still saves the unsaved project (in my case in the set up folder to save backups with timestamps). Then you can save the file manually and it also saves the time etc.

But now when you make a new and clean project, the timer seems to take the time from the previous project (or maybe the backuped untitled project from the backup folder?). The timer will be reset, if you make a new project again, though.

Don't know if this might something you want to look after. To me it is not really annoying, I think it is just good to know though ... in case you work on a project, you are in the flow and suddenly you think "I should save!", do it, start a new project, be in a flow, save and suddenly for the new project the timer is quite wrong, since it would add the time for the other project as well ... or so.

Edit:
Apparently it also just happened after creatign a new project from another loaded project.
__________________
Tagirijus.de

Last edited by Tagirijus; 02-21-2020 at 08:14 AM.
Tagirijus is online now   Reply With Quote
Old 02-21-2020, 08:41 AM   #13
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

@Tagirijus
I don’t quite understand what you mean. A timer for each project is stored inside the project, so the timer cannot be reset when another project is created. Could you make a gif - where, what is dumped?
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old 02-21-2020, 08:57 AM   #14
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Is this okay to understand? -->




Another thing: is it somehow possible to completely reset the project timer (the "total" timer)?
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old 02-21-2020, 11:10 AM   #15
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Yes, indeed, time is not reset, for some reason, changes to the project in the API do not occur. I’ll definitely look later and fix it.
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old 02-21-2020, 11:13 AM   #16
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Thank you very much for the effort!

Also the thing with the reset: is there any way to reset the total time, or is it a bug as well an the "Reset timer" option should do this in the first place and just does not work?


Edit:
I just found out that a Reaper project file can easily be opened in a text editor and I think I might see were your script saves the time. Just wow. Reaper is so incredible! So it could be a workaround for me to just "reset" the project time by hand, if it really is needed. Just in case you do not have the time for maybe adding individual reset-options.
__________________
Tagirijus.de

Last edited by Tagirijus; 02-21-2020 at 11:44 AM.
Tagirijus is online now   Reply With Quote
Old 02-21-2020, 11:35 AM   #17
_TIP_
Human being with feelings
 
_TIP_'s Avatar
 
Join Date: Apr 2014
Location: NY
Posts: 118
Default

Hey Archie, I just updated the script to the latest version 1.08, now it remembers the docking position when i open Reaper but it won't start as a global startup action if i close and the reopen Reaper agin, the global startup action is only working the first time you launch Reaper. Thank you so much for all the updates!!!
_TIP_ is offline   Reply With Quote
Old 02-22-2020, 02:18 AM   #18
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Quote:
Originally Posted by Tagirijus View Post
There is no inbetween solution to let it open, but give back the focus to the main window of Reaper, hm?
Added item Remove Focus Win to the right click menu v.1.10


Quote:
Originally Posted by Tagirijus View Post
I think I found some kind of bug:
Fixed: Reset time when opening a new project from the menu 'File' v.1.10

Quote:
Originally Posted by Tagirijus View Post
is there any way to reset the total time
Just in case you do not have the time for maybe adding individual reset-options.
I do not specifically add a time reset so that the timer always shows accurate data. And if you add the "reset all timers" button, then all timers will lose their meaning. So that all timers show their own exact time, and if you need to detect something from this minute, then for this there is a timer called "Reset", right-click and reset it to reset the time.


Quote:
Originally Posted by _TIP_ View Post
Hey Archie, I just updated the script to the latest version 1.08, now it remembers the docking position when i open Reaper but it won't start as a global startup action if i close and the reopen Reaper agin, the global startup action is only working the first time you launch Reaper. Thank you so much for all the updates!!!
I don't quite understand, I always have a script window that remembers its state and opens with the Reaper. Could you make a GIF that where you don't open?
--------------

I apologize for the fact that I do not understand much without pictures and for my English. Just with English very tight, I write using Google translator.
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old 02-22-2020, 06:13 AM   #19
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Quote:
Originally Posted by Archie View Post
Added item Remove Focus Win to the right click menu v.1.10
Wow! Thanks for this.


Quote:
Originally Posted by Archie View Post
Fixed: Reset time when opening a new project from the menu 'File' v.1.10
Also thanks for the fix; yes it works now!



Quote:
Originally Posted by Archie View Post
I do not specifically add a time reset so that the timer always shows accurate data. And if you add the "reset all timers" button, then all timers will lose their meaning. So that all timers show their own exact time, and if you need to detect something from this minute, then for this there is a timer called "Reset", right-click and reset it to reset the time.
Alright, I can understand this philosophy. Thank you so much for your effort!
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old 02-23-2020, 08:30 AM   #20
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Added reset all project timers to the context menu. v1.11
I had to add because if you load / create a project from a template, the timer will not count the time from scratch, but will continue to read the one that has already been registered in the template.
So if the project is loaded from the template, then you must definitely do a reset.
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old 02-23-2020, 09:18 AM   #21
RJHollins
Human being with feelings
 
Join Date: Dec 2011
Posts: 1,420
Default

Just imported this from Reapack.

Running the Counter Time Project, I get this error:

Archie_Info; Counter time project.lua:421: bad argument #2 to 'EnumProjects' (string expected, got no value)
RJHollins is offline   Reply With Quote
Old 02-23-2020, 09:59 AM   #22
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Quote:
Originally Posted by RJHollins View Post
Just imported this from Reapack.

Running the Counter Time Project, I get this error:

Archie_Info; Counter time project.lua:421: bad argument #2 to 'EnumProjects' (string expected, got no value)
I don't know, everything works for me, and the EnumProjects function doesn't have a second argument, as your error says, so I don't know what's wrong with you. Try updating the script.
Make a GIF at what point the error appears
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate

Last edited by Archie; 02-23-2020 at 10:26 AM.
Archie is offline   Reply With Quote
Old 02-23-2020, 10:40 AM   #23
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

@RJHollins
Try updating the V. 1.12
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old 02-23-2020, 11:46 AM   #24
RJHollins
Human being with feelings
 
Join Date: Dec 2011
Posts: 1,420
Default

Quote:
Originally Posted by Archie View Post
@RJHollins
Try updating the V. 1.12
Just tried the 1.12 update.

After loading script, immediately get this error message:

Archie_Info; Counter time project.lua:440: bad argument #2 to 'EnumProjects' (string expected, got no value)
RJHollins is offline   Reply With Quote
Old 02-23-2020, 09:49 PM   #25
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

@RJHollins
Try again v.1.14
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old 02-24-2020, 12:31 AM   #26
RJHollins
Human being with feelings
 
Join Date: Dec 2011
Posts: 1,420
Default

Quote:
Originally Posted by Archie View Post
@RJHollins
Try again v.1.14
Downloaded. Reaper Re-Start.

WORKING !

yeah.

2. Wondering ... is it at all possible that the Counter could be tied to the Transport Status ?

In other words ... the Counter is active ONLY when in PLAY mode ? When stopped, the Counter is also stopped.
RJHollins is offline   Reply With Quote
Old 02-24-2020, 02:14 AM   #27
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Yeah, I also noticed that the timer should be "resetable" for templates, hehe. But now you updated it again, just wow! Thank you so much. So kind of you !!
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old 02-24-2020, 04:43 AM   #28
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Quote:
Originally Posted by RJHollins View Post
2. Wondering ... is it at all possible that the Counter could be tied to the Transport Status ?

In other words ... the Counter is active ONLY when in PLAY mode ? When stopped, the Counter is also stopped.
Added a timer showing the playback time since the project was created v.1.15
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate

Last edited by Archie; 02-24-2020 at 05:00 AM.
Archie is offline   Reply With Quote
Old 02-24-2020, 07:55 AM   #29
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Another thing came to my mind: at the moment the AFK timer will go on, if something happens in Reaper like playback or selecting, right? Wouldn't it be clever to let it also go on on MIDI input? I just recognized that I was playing around a long time without noticing the AFK stopped. ... still I was technically working, though.

Just an idea.
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old 02-24-2020, 04:28 PM   #30
RJHollins
Human being with feelings
 
Join Date: Dec 2011
Posts: 1,420
Default

another inquiry ...

Is it at all possible to allow User 'editing' of the Times ?
RJHollins is offline   Reply With Quote
Old 02-25-2020, 01:53 AM   #31
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Quote:
Originally Posted by Tagirijus View Post
Another thing came to my mind: at the moment the AFK timer will go on, if something happens in Reaper like playback or selecting, right? Wouldn't it be clever to let it also go on on MIDI input? I just recognized that I was playing around a long time without noticing the AFK stopped. ... still I was technically working, though.

Just an idea.
Yes, this is really a drawback and it would be great if the AFK time did not stop when playing on a MIDI keyboard.
But unfortunately I do not know how to implement this. I don’t know how to receive messages about a keypress from a MIDI keyboard; a search in the forum did not return any results. If there was an opportunity to receive a message from the MIDI keyboard, then of course I would try to implement this.


Quote:
Originally Posted by RJHollins View Post
Is it at all possible to allow User 'editing' of the Times ?
No.
Although you can open the project file in notepad and change the time in it. There, the block "EXTSTATE> ARC_COUNTER_TIMER_IN_PROJ_WIN" is stored all the time in seconds. When editing a project file, the Reaper must be closed.

__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate

Last edited by Archie; 02-25-2020 at 03:36 AM.
Archie is offline   Reply With Quote
Old 03-29-2020, 04:52 AM   #32
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Today I did some quick tests in Reaper and suddenly I noticed (too late - so I am not sure how to reproduce it, unfortunately!) that all counter went negative!


... as already written: unfortunately I am not sure yet how to reproduce it. I played around with auto punch in / out, did some Ctrl+Z durgin the tests, but I could not reproduce it so that the timer went negative again. Maybe it was an individual situation, not sure.

I still wanted to report that at least it happened once for now. I will come back, if I am able to reproduce it!
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old Yesterday, 12:30 PM   #33
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Thanks for the updates. The update with the Reapack is broken, though.
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old Yesterday, 09:28 PM   #34
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

Quote:
Originally Posted by Tagirijus View Post
The update with the Reapack is broken, though.
What's the matter? What's happening? Error or ...
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old Today, 07:02 AM   #35
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Big sorry for being so noobish. Normally my bug reports are more professional ...

So I do these things:

1. ReaPack > Synchronize packages
2. It tells me: "The following packages were removed from their repositories and are no longer available" and lists your script in there:




3. I also cannot visit this link https://github.com/ArchieScript/Arch...t(AutoRun).lua from your first post.

Instead I went to your github and downloaded the newest version manually. Maybe some spelling went wrong for the ReaPack / Browser?
Attached Images
File Type: png 2020-04-01_16-01-59.png (4.3 KB, 6 views)
__________________
Tagirijus.de
Tagirijus is online now   Reply With Quote
Old Today, 07:25 AM   #36
Archie
Human being with feelings
 
Archie's Avatar
 
Join Date: Oct 2017
Location: Russia
Posts: 66
Default

@Tagirijus

I apologize for not warning. I renamed the script, adding in the title (AutoRun). Therefore, it appears in deleted ones, since it is deleted and a new one is created with the name Archie_Info; Counter time project(AutoRun).lua
Link should be working, I changed it immediately. It works great!
__________________
=================================
ReaPack| Archie-ReaScript: Discussion | Donate
Archie is offline   Reply With Quote
Old Today, 07:28 AM   #37
Tagirijus
Human being with feelings
 
Tagirijus's Avatar
 
Join Date: Feb 2020
Location: germany
Posts: 63
Default

Ah okay! I just deleted the old one and added the new one from the repository. Yes now it works again as intended, I guess. Thank you!
__________________
Tagirijus.de
Tagirijus is online now   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:34 AM.


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