From c056eb1fcbc2f666a9eea261824c8c9236a65d0e Mon Sep 17 00:00:00 2001 From: EillesWan Date: Sun, 24 Aug 2025 00:11:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E5=A4=8D=20https://gitee.com/ElapsingDreams/?= =?UTF-8?q?MusicPreview/issues/ICUEFX=20=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Musicreater/__init__.py | 4 +++- Musicreater/experiment.py | 19 +++++++++++-------- Musicreater/subclass.py | 3 ++- README.md | 4 ++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Musicreater/__init__.py b/Musicreater/__init__.py index fea4f7f..b406933 100644 --- a/Musicreater/__init__.py +++ b/Musicreater/__init__.py @@ -22,7 +22,7 @@ The Licensor of Musicreater("this project") is Eilles, bgArray. # 若需转载或借鉴 许可声明请查看仓库目录下的 License.md -__version__ = "2.4.2" +__version__ = "2.4.2.1" __vername__ = "音符附加信息升级" __author__ = ( ("金羿", "Eilles"), @@ -62,6 +62,7 @@ __all__ = [ "MC_EILLES_RTBETA_INSTRUMENT_REPLACE_TABLE", # Midi 与 游戏 的对照表 "MM_INSTRUMENT_RANGE_TABLE", + "MM_INSTRUMENT_DEVIATION_TABLE", "MM_CLASSIC_PITCHED_INSTRUMENT_TABLE", "MM_CLASSIC_PERCUSSION_INSTRUMENT_TABLE", "MM_TOUCH_PITCHED_INSTRUMENT_TABLE", @@ -131,6 +132,7 @@ from .constants import ( MC_PITCHED_INSTRUMENT_LIST, # MIDI 到 我的世界 表 MM_INSTRUMENT_RANGE_TABLE, + MM_INSTRUMENT_DEVIATION_TABLE, MM_CLASSIC_PITCHED_INSTRUMENT_TABLE, MM_CLASSIC_PERCUSSION_INSTRUMENT_TABLE, MM_TOUCH_PITCHED_INSTRUMENT_TABLE, diff --git a/Musicreater/experiment.py b/Musicreater/experiment.py index 32b8e92..0870118 100644 --- a/Musicreater/experiment.py +++ b/Musicreater/experiment.py @@ -874,14 +874,17 @@ class FutureMidiConvertM4(MidiConvert): totalCount = int(_note.duration / _apply_time_division) - if ( - totalCount == 0 - or (_note.get_info("PITCH") > 2 and _note.sound_name != "note.bass") + if totalCount == 0 or ( + _note.get_info("PITCH") > 1.89 and _note.sound_name != "note.bass" ): - from rich import print as prt - prt("[INFO] 音符太短或音调太高,无法生成插值") - prt(_note) + # 喂喂,这是测试用的,别发版啊!!! + + # from rich import print as prt + + # prt("[INFO] 音符太短或音调太高,无法生成插值") + # prt(_note) + return [ _note, ] @@ -905,7 +908,7 @@ class FutureMidiConvertM4(MidiConvert): distance=_note.sound_distance + _i * _distance_slide, azimuth=( _note.sound_azimuth[0], - _note.sound_azimuth[1] + 5 * random.random(), + _note.sound_azimuth[1] + 10 * (random.random() - 0.5), ), extra_information=_note.extra_info, ) @@ -952,7 +955,7 @@ class FutureMidiConvertM4(MidiConvert): if not note.percussive: notes_list.extend( - self._linear_note(note, 2 * note.get_info("PITCH")) + self._linear_note(note, 2.75 / note.get_info("PITCH")) ) else: notes_list.append(note) diff --git a/Musicreater/subclass.py b/Musicreater/subclass.py index 27bdf02..87a3138 100644 --- a/Musicreater/subclass.py +++ b/Musicreater/subclass.py @@ -395,7 +395,8 @@ class MineNote: for i in range(k): self.extra_info[key[i]] = value[i] else: - raise TypeError("参数类型错误") + # 提供简单报错就行了,如果放一堆 if 语句,降低处理速度 + raise TypeError("参数类型错误;键:`{}` 值:`{}`".format(key, value)) def get_info(self, key: str) -> Any: """获取附加信息""" diff --git a/README.md b/README.md index d5f4600..2cfcd95 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ [![GitHub Repo stars](https://img.shields.io/github/stars/TriM-Organization/Musicreater?color=white&logo=GitHub&style=plastic)](https://github.com/TriM-Organization/Musicreater/stargazers) [![GitHub Repo Forks](https://img.shields.io/github/forks/TriM-Organization/Musicreater?color=white&logo=GitHub&style=plastic)](https://github.com/TriM-Organization/Musicreater/forks) -简体中文 🇨🇳 | [English🇬🇧](README_EN.md) +简体中文🇨🇳 | [English🇬🇧](README_EN.md) ## 介绍 🚀 @@ -74,7 +74,7 @@ ## 作者 ✒ -**金羿 Eilles**:我的世界基岩版指令作者,个人开发者,B 站不知名 UP 主,江西老表。 +**金羿 Eilles**:我的世界基岩版指令作者,个人开发者,B 站不知名 UP 主。 **诸葛亮与八卦阵 bgArray**:我的世界基岩版玩家,喜欢编程和音乐,深圳学生。