Time Display in Global Rackspace

I did, nothing happened

In terms of the gig file I posted above - I tested on both MacOS and Windows, and the time starts displaying immediately when you open the gig file. I canā€™t think of a reason why it would not work for you.

Can you open the script editor from the menu bar and click the ā€˜Compileā€™ button:
Window > Show Global Rakspace Script Editor
image

This is what I see.
So what I am doing wrong? :slight_smile:

I think, but not 100% sure Initialization is a rack space call not a global call. I couldnā€™t find one that works in global rackspace. try copying my script verbatim and it should start when you switch rackspaces. Also have you got the widget name correct.

Maybe a bit offtopic, but I was wondering if a generator could be used for the time, as the callback function for the time is called many times or (un)regularly per second, so a generator may be more CPU friendly maybe.

Probably using the SetGeneratorCoarseness and SetGeneratorFrequency functions.

This is a.gig file I got from someone here.
So when I loaded in, it should also work for meā€¦ isnā€™t it?
Iā€™ve didnā€™t change anythingā€¦
But this doesnā€™t work for meā€¦

Can you upload the gig file which is not working for you?

OKā€¦ I accidentally posted earlier to the wrong Time Clock thread and without enough detailā€¦ letā€™s try this again.

I recently got a new computer, moving from an Intel Mac (Ventura 13.2) to an M2 Mac (Ventura 13.5). Since moving my gig file from the old computer to the new I canā€™t get this Time Clock script to work. My current gig file is the gig file I transferred over from my old computer, but have been tweaking on utilizing some of the new features. As a test I have created a brand new gig file, created a couple rackspaces and copied in the script and still havenā€™t been able to get it running.

The script compiles without issue and there are no errors in the log. The text widget just shows the text ā€œlbl_timeā€ (no quotes) instead of the current time. I have verified that the text widget has ā€œlbl_timeā€ entered in the OSC/GPScript Name field on the advanced table of the text widget. I have switched between several rackspaces in order to kickstart it.

I am not very scripting savvy, so I am betting there is something simple going on that I am not picking up on.

Below are some screenshots of what I have going on.

Thanks in advance for any advice!

(And my apologies in advance if I left out any needed details! :upside_down_face: )

ā€“ Peter

Text Widget General Tab

Text Widget Advanced Tab

Global Rackspace Script Editor

I was the original poster and what you have done sounds about right, but I do not have Mac M2 to confirm operation. I can confirm this continued to work on all my Macs and Windows machines after the change to GP 4.7.

1 Like

Just tried turning off custom caption and still no luck.

Pete

Upload your test gig file that isnā€™t working. Ta

time test.gig (47.7 KB)

Here you go!

Works fine.

This is so bizarreā€¦ I copied my test file to the old computer and the time clock starts working right away.

Any thoughts on what might be keeping it from running?

There is an alternate version that was modified by @rank13 to start the time when the gig is loaded. If you change these lines of your script above.

From:

// Called when rackspace is activated
On Rackspace(oldRs : Integer, newRs : Integer )

To:

// Called automatically after script is loaded
Initialization

Everything else remains unchanged.

1 Like

This is most probably the reason why it doesnā€™t work.
Because itā€™s not shown on the screenshots of @Sternen , i can only guess that there are not multiple local rackspaces yet, so that there canā€™t happen a ā€œrackspace changeā€, which was needed to trigger the timer to start running.
If you use the Initialization routine instead of the rackspace change callback, the timers should be already triggered on compiling the script or on first load of the (global) rackspace and so the clock would start running immediately.

1 Like

Thanks for the ideas, guys! I did add multiple rack spaces when I created my test gig file, and my main gig file has tons of rackspaces. Unfortunately, switching between rackspaces isnā€™t kickstarting the time clock.

I changed to code as Spav suggested but I am still not getting the time.

There is one change though, now I am getting an error in the log file that says:
"GLOBAL RACKSPACE (GlobalRackspace) - Warning in ā€œMainā€: Line 7, Col 24: Double variable is not initialized: "

I wasnā€™t getting this last night.

As a test I went back and grabbed the script for creating a Time Clock in a local rackspace (the thread I accidentally posted to yesterday).

I pasted that script into the current rackspace editor and created a text widget in the local rackspace with the correct GPScript name.

Works perfectlyā€¦ hmmm

It would be interesting if you could now move it to global rackspace.

1 Like

If you are now using the initialise method that code can be reduced to this, as it only runs once.

// Called automatically after script is loaded
Initialization
    SetTimersRunning(true)        
End

1 Like