From eea29996b61152a45795aaeb12637e3bdae67f91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=A2=81=E9=87=8E=20=28Yuan=20Ye=29?=
 <yuanyelele@tutanota.com>
Date: Tue, 19 Sep 2023 15:55:50 +0800
Subject: [PATCH 1/2] Add context property `jianpuBeaming`
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This property enables Jianpu (numbered musical notation) beaming
behavior. Stems point downward and beams always cover their
corrosponding group of note heads.

Signed-off-by: 袁野 (Yuan Ye) <yuanyelele@tutanota.com>
---
 lily/beaming-pattern.cc           | 1 +
 lily/include/beaming-pattern.hh   | 1 +
 scm/define-context-properties.scm | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/lily/beaming-pattern.cc b/lily/beaming-pattern.cc
index 641b860408..73f84a7d17 100644
--- a/lily/beaming-pattern.cc
+++ b/lily/beaming-pattern.cc
@@ -570,6 +570,7 @@ Beaming_options::from_context (Context const *context)
     = from_scm<bool> (get_property (context, "strictBeatBeaming"));
   respect_incomplete_beams_
     = from_scm<bool> (get_property (context, "respectIncompleteBeams"));
+  jianpu_beaming_ = from_scm<bool> (get_property (context, "jianpuBeaming"));
 
   beat_structure_ = get_property (context, "beatStructure");
   base_moment_
diff --git a/lily/include/beaming-pattern.hh b/lily/include/beaming-pattern.hh
index e40c83e762..8307f5b7fe 100644
--- a/lily/include/beaming-pattern.hh
+++ b/lily/include/beaming-pattern.hh
@@ -38,6 +38,7 @@ struct Beaming_options
   bool subdivide_beams_;
   bool strict_beat_beaming_;
   bool respect_incomplete_beams_;
+  bool jianpu_beaming_;
 
   SCM beat_structure_;
   Rational base_moment_;
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm
index 36932f1bfb..a09919ac80 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -468,6 +468,9 @@ and @code{\\quote}s.")
 This property is used for internal timekeeping, among others by the
 @code{Accidental_engraver}.")
 
+     (jianpuBeaming ,boolean? "Enable Jianpu (numbered musical notation)
+beaming behavior. Stems point downward and beams always cover their
+corrosponding group of note heads.")
 
      (keepAliveInterfaces ,list? "A list of symbols, signifying grob
 interfaces that are worth keeping a staff with @code{remove-empty} set
-- 
2.42.0

