Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions movement/lib/flowtime/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# flowtime for sensor-watch

## What is flowtime?

flowtime is an art project and thought experiment that challenges and reimagines our traditional understanding of time. It explores the relationship between our perception of time and our ability to enter [flow states](1), periods of deep focus and engagement with the present moment. In essence, flowtime is a manifestation of timelessness.

The concept emerged from a simple observation: whenever I became aware of time, whether by mechanically looking at my watch or involuntarily catching a glimpse of a screen, I momentarily and unconsciously time travel and lose touch with the present. This sparked a question: what if there were a way to decide consciously whether to know the time or remain immersed in the flow? This was the birth of flowtime.

Although it preserves the familiar structure of 24 hours per day 60 minutes per hour, the order of its hours and minutes is unpredictable and unique each day. Yet it remains universal, meaning the flowtime is the same for everyone, just like conventional time. This uncertainty encourages us to loosen our attachment to time, creating an opportunity to return into the flow of the present moment.

What started as a conceptual exploration has since materialized into a tangible, interactive technology that melds philosophical inquiry with practical application. It is now available in the form of a JavaScript library, a command line tool, a classic Casio watch, and on the [flowtime project website](7).

Concept and development by [Lionel Ringenbach (a.k.a. Ucodia)](6), started in September 2017.

## How does it work?

To compute the flowtime, the current date and time is used as input. The day and hour periods are derived by concatenating their numerical values. For example, `July 21 2018 09:28:42` has identifiers `20180721` for the day period and `2018072109` for the hour period. These identifiers then seed a [pseudorandom number generator (PRNG)](2) to produce a deterministic sequence of hours and minutes. This method ensures universality while remaining unpredictable to human beings.

The [xorshift32 algorithm](3) generates the random numbers, and the [Fisher-Yates algorithm](4) shuffles them, resulting in deterministically random sequences.

## Useful references

- [Flow state](1) on Wikipedia
- [Pseudorandom number generator](2) on Wikipedia
- [Xorshift](3) on Wikipedia
- [Fisher-Yates shuffle](4) on Wikipedia
- [Sensor Watch](5) official website
- [Lionel Ringenbach (a.k.a. Ucodia)](6) official website
- [flowtime](7) project official website

[1]: https://en.wikipedia.org/wiki/Flow_(psychology)
[2]: https://en.wikipedia.org/wiki/Pseudorandom_number_generator
[3]: https://en.wikipedia.org/wiki/Xorshift
[4]: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
[5]: https://www.sensorwatch.net/
[6]: https://ucodia.space
[7]: https://ucodia.space/flowtime
74 changes: 74 additions & 0 deletions movement/lib/flowtime/flowtime.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* MIT License
*
* Copyright © 2023-2025 Lionel Ringenbach <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#include "flowtime.h"
#include "watch.h"
#include <stdint.h>
#include <stdlib.h>

static uint32_t *random_sequence(uint32_t n, uint32_t seed) {
uint32_t *result = malloc(n * sizeof(uint32_t));
if (!result)
return NULL;
uint32_t state = seed;
for (uint32_t i = 0; i < n; i++) {
state ^= state << 13;
state ^= state >> 17;
state ^= state << 5;
int j = (uint32_t)(((double)state / 4294967296) * (i + 1));
result[i] = result[j];
result[j] = i;
}
return result;
}

watch_date_time date_to_flowtime(watch_date_time *date) {
static uint32_t cached_hours_seed = 0;
static uint32_t cached_minutes_seed = 0;
static uint32_t *cached_hours_sequence = NULL;
static uint32_t *cached_minutes_sequence = NULL;

uint32_t hoursSeed = (date->unit.year + WATCH_RTC_REFERENCE_YEAR) * 10000 +
date->unit.month * 100 +
date->unit.day;
uint32_t minutesSeed = hoursSeed * 100 + date->unit.hour;

if (hoursSeed != cached_hours_seed) {
free(cached_hours_sequence);
cached_hours_sequence = random_sequence(24, hoursSeed);
cached_hours_seed = hoursSeed;
}

if (minutesSeed != cached_minutes_seed) {
free(cached_minutes_sequence);
cached_minutes_sequence = random_sequence(60, minutesSeed);
cached_minutes_seed = minutesSeed;
}

watch_date_time flowtime = *date;
flowtime.unit.hour = cached_hours_sequence[date->unit.hour];
flowtime.unit.minute = cached_minutes_sequence[date->unit.minute];

return flowtime;
}
32 changes: 32 additions & 0 deletions movement/lib/flowtime/flowtime.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* MIT License
*
* Copyright © 2023-2025 Lionel Ringenbach <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#ifndef __FLOWTIME_H_
#define __FLOWTIME_H_

#include "watch.h"

watch_date_time date_to_flowtime(watch_date_time *date);

#endif // __FLOWTIME_H_
3 changes: 3 additions & 0 deletions movement/make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ INCLUDES += \
-I../lib/astrolib/ \
-I../lib/morsecalc/ \
-I../lib/smallchesslib/ \
-I../lib/flowtime/ \

# If you add any other source files you wish to compile, add them after ../app.c
# Note that you will need to add a backslash at the end of any line you wish to continue, i.e.
Expand All @@ -46,6 +47,7 @@ SRCS += \
../lib/morsecalc/calc_fns.c \
../lib/morsecalc/calc_strtof.c \
../lib/morsecalc/morsecalc_display.c \
../lib/flowtime/flowtime.c \
../../littlefs/lfs.c \
../../littlefs/lfs_util.c \
../movement.c \
Expand Down Expand Up @@ -149,6 +151,7 @@ SRCS += \
../watch_faces/sensor/accel_interrupt_count_face.c \
../watch_faces/complication/metronome_face.c \
../watch_faces/complication/smallchess_face.c \
../watch_faces/clock/flowtime_clock_face.c \
# New watch faces go above this line.

# Leave this line at the bottom of the file; it has all the targets for making your project.
Expand Down
1 change: 1 addition & 0 deletions movement/movement_faces.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
#include "accel_interrupt_count_face.h"
#include "metronome_face.h"
#include "smallchess_face.h"
#include "flowtime_clock_face.h"
// New includes go above this line.

#endif // MOVEMENT_FACES_H_
Loading