mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2026-04-30 21:26:00 +00:00
切换为UV进行包管理
This commit is contained in:
@@ -22,7 +22,7 @@ The Licensor of Musicreater("this project") is Eilles Wan, bgArray.
|
||||
# 若需转载或借鉴 许可声明请查看仓库目录下的 License.md
|
||||
|
||||
|
||||
__version__ = "2.3.0"
|
||||
__version__ = "2.3.0.1"
|
||||
__vername__ = "FSQ完全流式音符读写适配"
|
||||
__author__ = (
|
||||
("金羿", "Eilles"),
|
||||
|
||||
@@ -745,7 +745,7 @@ class MusicSequence:
|
||||
|
||||
return bytes_buffer
|
||||
|
||||
def set_min_volume(self, volume_value: int):
|
||||
def set_min_volume(self, volume_value: float):
|
||||
"""重新设置全曲最小音量"""
|
||||
if volume_value > 1 or volume_value <= 0:
|
||||
raise IllegalMinimumVolumeError(
|
||||
@@ -753,7 +753,7 @@ class MusicSequence:
|
||||
)
|
||||
self.minimum_volume = volume_value
|
||||
|
||||
def set_deviation(self, deviation_value: int):
|
||||
def set_deviation(self, deviation_value: float):
|
||||
"""重新设置全曲音调偏移"""
|
||||
self.music_deviation = deviation_value
|
||||
|
||||
@@ -1025,13 +1025,14 @@ class MidiConvert(MusicSequence):
|
||||
return cls.from_mido(
|
||||
mido_file=midi_obj,
|
||||
midi_music_name=midi_name,
|
||||
mismatch_error_ignorance=ignore_mismatch_error,
|
||||
speed_multiplier=playment_speed,
|
||||
default_tempo=default_tempo_value,
|
||||
pitched_note_referance_table=pitched_note_rtable,
|
||||
percussion_note_referance_table=percussion_note_rtable,
|
||||
minimum_vol=minimum_volume,
|
||||
volume_processing_function=vol_processing_function,
|
||||
default_tempo=default_tempo_value,
|
||||
mismatch_error_ignorance=ignore_mismatch_error,
|
||||
deviation=0, # 加么?感觉不加也没问题……?
|
||||
note_referance_table_replacement=note_rtable_replacement,
|
||||
)
|
||||
|
||||
@@ -1644,14 +1645,19 @@ class MidiConvert(MusicSequence):
|
||||
return command_dict, notes_list[-1].start_tick, max_multi
|
||||
|
||||
def copy_important(self):
|
||||
dst = MidiConvert.from_mido_obj(
|
||||
midi_obj=mido.MidiFile(),
|
||||
midi_name=self.music_name,
|
||||
enable_old_exe_format=self.enable_old_exe_format,
|
||||
pitched_note_rtable={},
|
||||
percussion_note_rtable={},
|
||||
vol_processing_function=lambda a: a,
|
||||
dst = MidiConvert(
|
||||
name_of_music=self.music_name,
|
||||
channels_of_notes={},
|
||||
music_note_count=0,
|
||||
note_used_per_instrument={},
|
||||
minimum_volume_of_music=self.minimum_volume,
|
||||
deviation_value=self.music_deviation,
|
||||
# enable_old_exe_format=self.enable_old_exe_format,
|
||||
# pitched_note_rtable={},
|
||||
# percussion_note_rtable={},
|
||||
# vol_processing_function=lambda a: a,
|
||||
)
|
||||
dst.enable_old_exe_format = self.enable_old_exe_format
|
||||
dst.music_command_list = [i.copy() for i in self.music_command_list]
|
||||
dst.progress_bar_command = [i.copy() for i in self.progress_bar_command]
|
||||
return dst
|
||||
|
||||
@@ -331,12 +331,14 @@ def midi_msgs_to_minenote(
|
||||
# )
|
||||
|
||||
|
||||
def is_in_diapason(note_pitch: int, instrument: str) -> bool:
|
||||
def is_in_diapason(note_pitch: float, instrument: str) -> bool:
|
||||
note_range = MM_INSTRUMENT_RANGE_TABLE.get(instrument, ((-1, 128), 0))[0]
|
||||
return note_pitch >= note_range[0] and note_pitch <= note_range[1]
|
||||
|
||||
|
||||
def is_note_in_diapason(note_: MineNote) -> bool:
|
||||
def is_note_in_diapason(
|
||||
note_: MineNote,
|
||||
) -> bool:
|
||||
note_range = MM_INSTRUMENT_RANGE_TABLE.get(note_.sound_name, ((-1, 128), 0))[0]
|
||||
return note_.note_pitch >= note_range[0] and note_.note_pitch <= note_range[1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user