new_clock

Re-implementation of my Javascript chiming clocks in Perl

https://github.com/acli/new_clock

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary

Keywords

audio-interface chime clocks
Last synced: 6 months ago · JSON representation ·

Repository

Re-implementation of my Javascript chiming clocks in Perl

Basic Info
  • Host: GitHub
  • Owner: acli
  • License: mit
  • Language: Perl
  • Default Branch: master
  • Homepage:
  • Size: 4.65 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
audio-interface chime clocks
Created over 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

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: - Sound files listed in the CREDITS file

If using synth method: - Fluidsynth - Expect::Simple - File::Format::RIFF - The Timbres of Heaven soundfont by Don Allen

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.

Owner

  • Name: Ambrose Li
  • Login: acli
  • Kind: user
  • Location: Toronto, Ontario, Canada
  • Company: OCAD University

The W3C has become a toxic culture that only cares about GUI’s and search engines, taking on things they don’t understand (e.g., audio) and wrecking them.

Citation (CITATION.cff)

title:              "chimer: A Chiming Clock in Perl"
repository-code:    https://github.com/acli/new_clock
authors:
- family-names:   Li
  given-names:    Ambrose
  orcid:          https://orcid.org/0000-0002-9996-7486

abstract: This script was designed to replace two Javascript-based
          chiming clocks that deliver time information from two
          different time systems, one that announces the passing
          of Western time by striking Westminster-style quarterly
          chimes, and another that announces the passing of Eastern
          time by calling out night watches (as used c. 7–2c BC in
          ancient China) using documented sonic patterns that identify
          each watch.  The new script takes care in preventing the two
          kinds of sonic notifications from interfering with each other.
          Future work includes making resource use more predictable.

message:  The title and abstract of this code and my ORCid are the
  only things not listed elsewhere.  These references are generated;
  files in the doc directory should be considered more definitive.

cff-version: 1.2.0
version: n/a
# note: dummy version number injected for GitHub compatibility

references:

- authors:
  - family-names: Allen
    given-names: Don
  title: Timbres of Heaven
  type: sound-recording
  url: http://midkar.com/soundfonts/

- title: Astro::Sunrise
  type: software
  url: https://metacpan.org/pod/Astro::Sunrise

- authors:
  - name: Benboncan.
  year: 2009
  title: "Various Birds: Cuckoo.wav"
  type: sound-recording
  repository: https://freesound.org/people/Benboncan/sounds/72699/
  license: CC-BY-3.0

- term: 打更 [Calling out the hour]
  year: 2021
  title: Wikipedia
  type: encyclopedia
  date-accessed: 2021-08-17
  url: https://zh.wikipedia.org/w/index.php?title=%E6%89%93%E6%9B%B4&oldid=65321028

- title: DateTime::Astro::Sunrise
  type: software
  url: https://metacpan.org/release/RKHILL/DateTime-Astro-Sunrise-0.01_01

- title: DateTime::Event::Sunrise
  type: software
  url: https://metacpan.org/pod/DateTime::Event::Sunrise

- title: Expect::Simple
  type: software
  url: https://metacpan.org/pod/Expect::Simple

- title: ffmpeg
  type: software
  url: https://ffmpeg.org/

- title: File::Format::RIFF
  type: software
  url: https://metacpan.org/dist/File-Format-RIFF

- title: Fluidsynth
  type: software
  url: https://www.fluidsynth.org/

- title: General MIDI instrument codes
  date-accessed: 2021-08-20
  url: http://www.ccarh.org/courses/253/handout/gminstruments/

- authors:
  - family-names: George
    given-names: Chet
  year: 2014
  month: 3
  day: 2
  title: Seth Thomas 8 Bell Sonora Clock
  date-accessed: 2024-05-21
  url: https://www.youtube.com/watch?v=XJJHVLjVd2I

- authors:
  - family-names: Gossner
    given-names: Samuel
    url: http://sgossner.versilstudios.com/
  year: 2019
  title: Versilian Community Sample Library
  type: sound-recording
  repository-code: https://github.com/sgossner/VCSL
  license: CC0-1.0

- authors:
  - family-names: Harrison
    given-names: Daniel
  year: 2000
  month: 10
  title: Tolling Time
  type: article
  journal: Music Theory Online
  volume: 6
  issue: 4
  start: 6.4.1
  end: 6.4.1
  date-accessed: 2021-09-10
  url: https://www.mtosmt.org/issues/mto.00.6.4/mto.00.6.4.harrison.html

- authors:
  - family-names: Heath
    given-names: Graham
  year: 2011
  month: 6
  day: 26
  title: St Mary Le Bow, London's Bow Bells - Clock chimes
  date-accessed: 2024-05-21
  url: https://www.youtube.com/watch?v=rk5NvXNPUPs

- title: hebcal
  type: software
  repository-code: https://github.com/hebcal/hebcal

- title: JACK
  type: software
  url: https://jackaudio.org/

- authors:
  - family-names: Li
    given-names: Ambrose
  year: 2018
  month: 1
  day: 8
  title: sysline beeps are music, or the multisensory Unix text mode interface
  type: blog
  url: http://incd.ambroseli.ca/node/308

- authors:
  - family-names: Li
    given-names: M.-N.
  - family-names: Jiang
    given-names: Z.-Z.
  year: 2018
  title: 時光奧秘 [The mystery of time]
  type: book
  date-accessed: 2021-09-10
  url: https://books.google.ca/books?id=QG-BDwAAQBAJ&pg=PT135&lpg=PT135

- authors:
  - family-names: Lin
    given-names: Tsung-Yi
  year: 2007
  title: 午時三刻⸺古中國的時間制度 [“Three after seven”? Systems for timekeeping in ancient China]
  type: article
  journal: Science Development
  issue: 420
  start: 58
  end: 63
  url: https://ejournal.stpi.narl.org.tw/sd/view?vlId=E8E36F2F-73CB-4924-8F5F-D18489D89422

- title: mpv
  type: software
  repository-code: https://github.com/mpv-player/mpv

- authors:
  - name: mrbumpy409.
  year: 2012
  month: 12
  day: 19
  title: The fluidsynth reverb, while not as good as the old Live!/Audigy hardware reverbs (which were quite good), can still sound decent
  url: https://forums.scummvm.org/viewtopic.php?t=11632

- title: MuseScore_General.sf2
  type: sound-recording
  url: ftp://ftp.osuosl.org/pub/musescore/soundfont/MuseScore_General/MuseScore_General.sf2

- authors:
  - family-names: Oliver
    given-names: Richard
  title: "Clock Chime Tunes: History and Examples You Can Hear"
  date-accessed: 2021-09-10
  url: https://www.clockguy.com/SiteRelated/SiteReferencePages/ClockChimeTunes.html

- year: 2020
  section: Page:Gujin Tushu Jicheng, Volume 024 (1700-1725).djvu/54
  title: Wikisource
  type: book
  date-accessed: 2021-09-10
  url: https://zh.wikisource.org/w/index.php?title=Page:Gujin_Tushu_Jicheng,_Volume_024_(1700-1725).djvu/54&oldid=1817171

- authors:
  - family-names: Pearce
    given-names: Charles W.
  year: 1903
  month: 12
  day: 1
  title: Occasional notes [Letter to the editor]
  type: article
  journal: Musical Times
  volume: 44
  issue: 730
  start: 790
  end: 790
  url: https://ia600708.us.archive.org/view_archive.php?archive=/22/items/crossref-pre-1909-scholarly-works/10.2307%252F903901.zip&file=10.2307%252F904253.pdf

- section: Percussion notes
  title: LilyPond — Notation Reference v2.22.1 (stable-branch)
  type: book
  date-accessed: 2021-08-20
  url: http://lilypond.org/doc/v2.22/Documentation/notation/percussion-notes

- title: Perl 5
  version: 5.14
  type: software
  url: https://www.perl.org/

- title: Pulseaudio
  type: software
  url: https://www.freedesktop.org/wiki/Software/PulseAudio/

- section: Relative Octave Entry
  title: LilyPond — Notation Reference v2.22.1 (stable-branch)
  type: book
  date-accessed: 2021-08-18
  url: http://lilypond.org/doc/v2.22/Documentation/notation/writing-pitches#relative-octave-entry

- authors:
  - family-names: Starmer
    given-names: William Wooding
  year: 1907
  month: 11
  day: 19
  title: Chimes
  type: article
  journal: Proceedings of the Musical Association
  issue: 34
  start: 1
  end: 24
  url: https://ia800708.us.archive.org/view_archive.php?archive=/22/items/crossref-pre-1909-scholarly-works/10.1093%252Fjhered%252Fos-3.1.263.zip&file=10.1093%252Fjrma%252F34.1.1.pdf

- authors:
  - family-names: Starmer
    given-names: W. W.
  year: 1910
  month: 4
  day: 19
  title: Continental chimes and chime tunes
  type: article
  journal: Proceedings of the Musical Association
  volume: 36
  issue: 1
  start: 93
  end: 107
  url: https://ia800708.us.archive.org/view_archive.php?archive=/22/items/crossref-pre-1909-scholarly-works/10.1093%252Fjhered%252Fos-3.1.263.zip&file=10.1093%252Fjrma%252F36.1.93.pdf

- authors:
  - family-names: Stevenson
    given-names: J.
  title: “God Save The King!” The National Anthem of England, with an additional stanza for our gracious Queen; arranged for one, two, or three voices (and chorus) with an accompanyment for the piano forte. In <cite>Collection of sheet music from the late 18th and 19th centuries</cite>, 27–34
  url: https://archive.org/details/hartley00535542

- authors:
  - name: strangehorizon
    url: https://soundcloud.com/sonic_kitchen
  year: 2021
  title: Tuned Chau Gongs
  type: sound-recording
  repository: https://freesound.org/people/strangehorizon/packs/32761/
  license: CC0-1.0

- authors:
  - family-names: Vandenneucker
    given-names: Dominique
  year: 2012
  title: MIDI tutorial
  date-accessed: 2021-09-05
  url: http://www.music-software-development.com/midi-tutorial.html

- authors:
  - family-names: Weir
    given-names: R. S.
  - family-names: Lavallée
    given-names: C.
  - family-names: Schaeffer
    given-names: G. A. G.
  year: 1914
  title: O Canada! The national song of the Dominion
  url: https://archive.org/details/CSM_01142/

- term: Westminster Quarters
  year: 2021
  title: Wikipedia
  type: encyclopedia
  date-accessed: 2021-08-18
  url: https://en.wikipedia.org/w/index.php?title=Westminster_Quarters&oldid=1038660380

- term: Whittington chimes
  year: 2021
  title: Wikipedia
  type: encyclopedia
  date-accessed: 2021-08-18
  url: https://en.wikipedia.org/w/index.php?title=Whittington_chimes&oldid=1039122189

- authors:
  - family-names: Wilson
    given-names: Steve
    alias: SrWilson
  year: 2005
  month: 2
  day: 12
  title: The actual melody which became later known as the whittington chimes is much older than the westminster chimes
  date-accessed: 2021-09-01
  url: https://mb.nawcc.org/threads/when-did-the-whittington-chime-get-developed.17426/

- authors:
  - family-names: Wilson
    given-names: Steve
    alias: SrWilson
  year: 2006
  month: 8
  day: 9
  title: I think I know what your clock does
  date-accessed: 2021-09-01
  url: https://mb.nawcc.org/threads/jauch-grandfather-movement-with-11-note-chime.27915/

- authors:
  - name: Yamaha.
  section: Everything You've Ever Wanted to Know About Using MIDI with a Disklavier
  title: Yamaha Disklavier Education Network
  type: website
  date-accessed: 2021-08-19
  url: https://www.yamahaden.com/easyblog/entry/everything-you-ve-ever-wanted-to-know-about-using-midi-with-a-disklavier

- authors:
  - family-names: Zahnke
    given-names: Tyler
  year: 2020
  month: 1
  day: 25
  title: Hello, I am a totally blind composer, and I'v tweaked LilyPond so it's accessible for me
  date-accessed: 2021-09-10
  url: https://www.facebook.com/groups/gnulilypond/permalink/10157912670783529/

- authors:
  - family-names: Zimmerman
    given-names: Carl Scott
  title: Great Bells of the British Isles
  date-accessed: 2021-09-28
  url: http://www.towerbells.org/data/GBGreatBells.html

# This file was generated from config/CITATION.cff.in, README.md, chimer, doc/2023_REFACCTORING.md, doc/CHIMES.md, doc/CREDITS.md, doc/Night_watches.md, doc/ffmpeg.md, doc/latency.md, and doc/sysline.md

GitHub Events

Total
  • Push event: 2
Last Year
  • Push event: 2