Hi Oliver, PoLyGLoT,
@Oliver, I just tested on LC 6.1.3 and in fact the screen refresh is much faster, almost no delays. I had forgotten about that

thanks for reminding.
Things have gotten much more involved regarding timing in 6.7 and on.
@ PoLyGLoT,
Hi PoLyGLoT,
What is "mod", and how was kFrameLength determined?
Mod:
when you divide an integer(dividend) by an integer(divisor) then you might get a real number, i.e. in the case of 13/4 = 3,25
When you are interested in the remaining integer after division you can do
13 mod 4 = 1
Likewise you can do
13 div 4 = 3
in case of timing to the next screen refresh, assuming it is synced to the system clock and occurs every 50 milliseconds then you can say
Code: Select all
put (char -3 to - 1 of the milliseconds) into tTime
put 50 -( tTime mod 50) into tMod
put tTime & cr & tMod
this would put as an example
364
36
into the message box
meaning that in 36 milliseconds the next screen refresh will take place. (at 400)
have a look at the dictionary for mod and div.
But the hard part is to find out what the exact screen refresh rates are, it seems for a Mac it is either 60 or 75 Hz, 60 Hz would be every 16.7 milliseconds. I just don't know. My testing gives inconsistent results.
If you want to do scientific research on subliminal effects I would get the accepted software and you are out of any trouble proving that you get the exact 16.7 milliseconds.
But then the fun is gone.
kFrameLength is a constant (dictionary) declared at the top of the script like
constant kFrameLength = 40
-- The length of time in millisecs between frame updates. Here, 40ms gives us a
-- framerate of 25fps.
constant kFrameLength = 40
I am not even sure anymore if Kevin wanted to get a consistent framerate or if he also wanted to sync to the screen update.
send "updateSwirl pLastTime, pPhase, pPhaseStart, pPhaseEnd" to me in tNextTime - tTime millisecs
these are all parameters send with the send in time message which will arrive at handler "updateSwirl" in tNextTime-tTime milliseconds. The last part is how Kevin syncs to his framerate.
With your code (subliminal Cueing) --> you reference field 2
field 2 is there, look at it with the Project Browser. It is at the right side of the stack. If you made the stack smaller it might not be visible anymore. It logs the different timings.
Kind regards
Bernd