Sleep Diary Core Library

Documentation and code for manipulating sleep diaries


Project maintained by sleepdiary Hosted on GitHub Pages — Theme by mattgraham

SleepChart 1.0 Format

SleepChart 1.0 is a Windows program, available from a link near the bottom of a page on supermemo.com.

The source code for this program is not publicly available, but there is a link near the bottom of the page offering to release it on request.

We have not been able to find any official documentation about the file format.

In this directory

You may find the following useful:

Using the program

During normal use, users will generally do the following:

These commands are rarely useful in normal use, but can be very useful during testing:

Users can also click File then Import from Excel. We have not investigated that feature.

Flag terminology

The program describes the two flags using several terms:

To toggle the first flag, the user (un)ticks a menu item labeled Forced awakening. Then a confirmation box appears, which either asks if they want to mark the selected block as interrupted sleep or if they want to mark the selected block as terminated naturally, depending on which way the flag is being toggled.

To toggle the second flag, the user (un)ticks a menu item labeled Delayed retirement. Then a confirmation box appears, which either asks if they want to mark the selected block as forcefully delayed sleep or if they want to mark the selected block as initiated naturally, depending on which way the flag is being toggled.

File format

SleepChart 1.0 uses a simple binary format, containing a series of 12-byte records. Each record contains the following:

  1. a 32-bit float representing the start time
  2. a 32-bit float representing the end time
  3. a one-byte flag representing whether the user’s sleep terminated naturally
  4. a one-byte flag representing whether the user went to sleep naturally
  5. two bytes which seem to be unused

This can be represented in C with a struct:

struct record {
  float start, end;
  char terminated_naturally, retired_naturally;
  char unused[2];
};

Dates are represented as the number of days since Fri 31 Dec 00:00:00 GMT 1999, so for example 1.0 represents Sat 1 Jan 00:00:00 GMT 2000.

Detecting SleepChart 1.0 files

Because SleepChart 1.0 doesn’t have a header or other identifying information, a lot of files in other formats can be detected incorrectly as being in SleepChart 1.0 format. However, some features of the SleepChart 1.0 program make it easier to reduce the rate of false positives. Here are some techniques to confirm if a file is actually in this format: