Skip to content
/ new_clock Public

Re-implementation of my Javascript chiming clocks in Perl

License

Notifications You must be signed in to change notification settings

acli/new_clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This script sounds English-style chimes (Westminster, Whittington and others) every quarter hour. Between sundown and sunrise, it also sounds chimes every 1/5 of a Chinese night watch (0.2 proportional decimal hours) using traditional chiming patterns for night watches and according to the old rule of one night watch equalling one decimal hour.

(I’ve tried to make some effort to prevent the two kinds of chimes from clashing with each other. Unfortunately this is not working.)

Certain runtime parameters can be configured through a per-user config file, currently hard-coded to be $HOME/.chimerrc

Aims

This was hacked together to replace my two Javascript chiming clocks, with the aims of avoiding using Firefox for clock chimes and reducing sound distortion issues caused by RTP broadcasts.

Status

As of 2024, only carillon mode¹ with pre-generated synthesized audio files² is guaranteed to work, and the only two melodies guaranteed to work is the 8-bell Whittington chimes and a modified version of the new (11-bell) Whittington chimes³ (composed by Charles Villiers Stanford in 1905, as transcribed by Starmers, 1907, p. 5); this is my own setup, so if any showstopping bugs show up I’ll have to fix them.

In earlier versions of the code, quarter chimes and hourly strikes are separate events; in the current code the two are still technically separate events but grouped together (as an Event_List) to prevent their clashing together when latency prediction goes wrong.⁴

The code itself is a big mess. I tried to do it right, but I’m a terrible coder.

At some point it should ultimately serve as the back-end of my genmon plugin that shows Chinese (and Hebrew) dates.

Running

The script currently only runs on either PulseAudio- or JACK-based Linux system. (My own setup, as of May 2024, uses PulseAudio on one host and JACK on the other, so both setups should work.) You also must have mpv and ffmpeg installed (see Dependencies below).

If you’re not running directly from a git clone, you only need the script itself.

The best way to get sound working is to use Fluidsynth with a copy of Timbres Of Heaven installed. You also must have a data directory created to hold cached audio files. Please see the sample config file.

Dependencies

If using samples method:

If using synth method:

Please place the wav files in the “raw” directory and run make to generate the mp3 files. (mpv must be installed.)

One of these sound files is licensed through Creative Commons (CC-by-sa). For details please see the CREDITS file.

Notes

  1. mode = carillon
  2. method = synth
  3. melody = whittington11study; note that this is not the same Whittington chimes you’ll find on most clocks
  4. Which is all the time. I literally failed stats; I don’t know what I’m doing with these predictions.

About

Re-implementation of my Javascript chiming clocks in Perl

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages