From de830262a7d2b4320ec08bbcd1269e63784549dc Mon Sep 17 00:00:00 2001 From: Eilles Date: Tue, 7 Apr 2026 18:17:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E4=BF=AE=E5=B0=8F=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Musicreater/_plugin_abc.py | 2 +- Musicreater/_utils.py | 2 +- Musicreater/data.py | 10 ++++++++-- TO-DO.md | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Musicreater/_plugin_abc.py b/Musicreater/_plugin_abc.py index 9f34325..5b86d76 100644 --- a/Musicreater/_plugin_abc.py +++ b/Musicreater/_plugin_abc.py @@ -631,4 +631,4 @@ class LibraryPluginBase(TopPluginBase, ABC): ) # 怎么? - # 插件的彼此依赖就不需要什么调用了吧 + # 插件的依赖项就不需要什么调用了吧 diff --git a/Musicreater/_utils.py b/Musicreater/_utils.py index 2acb3ae..317f1dc 100644 --- a/Musicreater/_utils.py +++ b/Musicreater/_utils.py @@ -25,7 +25,7 @@ def enumerated_stuffcopy_dictionary( enumeration_times: int = 17, staff: T = {} ) -> Dict[int, T]: """ - 生成一个字典,其中键从0到enumeration_times-1,值是staff的拷贝 + 生成一个字典,其中键从 `0` 到 `enumeration_times-1`,值是 `staff` 的拷贝 """ # 这告诉我们,你不能忽略任何一个复制的序列,因为它真的,我哭死,折磨我一整天,全在这个bug上了 # 上面的这指的是 copy.deepcopy —— 金羿 来自 20260210 diff --git a/Musicreater/data.py b/Musicreater/data.py index e9a9e18..37b4ff8 100644 --- a/Musicreater/data.py +++ b/Musicreater/data.py @@ -126,6 +126,11 @@ class SoundAtmos: dk1 * round(cos(radians(self.sound_azimuth[0])), 8), ) + def __repr__(self) -> str: + return "SoundAtmos(d={}, rV={}, rH={})".format( + self.sound_distance, *self.sound_azimuth + ) + @dataclass(init=False) class SingleNote: @@ -445,7 +450,7 @@ class SingleTrack(List[SingleNote]): track_instrument: str = "", precise_time: bool = True, percussion: bool = False, - sound_direction: SoundAtmos = SoundAtmos(), + sound_direction: Optional[SoundAtmos] = None, extra_information: Dict[str, Any] = {}, ): self.name = track_name @@ -460,7 +465,8 @@ class SingleTrack(List[SingleNote]): self.is_percussive = percussion """是否为打击乐器""" - self.sound_position = sound_direction + # 如果不这样的话,所有的新的 SingleTrack 类都会有一个共同的声像方位 + self.sound_position = sound_direction if sound_direction else SoundAtmos() """声像方位""" self.extra_info = extra_information if extra_information else {} diff --git a/TO-DO.md b/TO-DO.md index 291d5db..3fd9036 100644 --- a/TO-DO.md +++ b/TO-DO.md @@ -16,7 +16,7 @@ 目前 v2 的功能有很多,都要移植到 v3。 1. [x] 导入 Midi 文件到全曲 2. [] 导入 Midi 文件到指定轨道 - 3. [] 导出到延迟播放器的结构文件(MCSTRUCTURE、BDX) + 3. [x] 导出到延迟播放器的结构文件(MCSTRUCTURE、BDX) 4. [] 导出到延迟播放器的附加包 5. [] 导出到积分板播放器的以上两种形式 6. [] 导出到中继器播放器的以上两种形式