Skip to content

Commit

Permalink
chore: update pyyaml to 6.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulMelody committed Aug 7, 2024
1 parent 085a201 commit 6a1a6de
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 196 deletions.
24 changes: 12 additions & 12 deletions libresvip/plugins/svp/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,39 +228,39 @@ def _get_transition_offset(self) -> float:
def _set_transition_offset(self, value: float) -> None:
self.t_f0_offset = value

transition_offset = property(_get_transition_offset, _set_transition_offset) # type: ignore [pydantic-field]
transition_offset = property(_get_transition_offset, _set_transition_offset)

def _get_portamento_left(self) -> float:
return constants.DEFAULT_PITCH_PORTAMENTO if self.t_f0_left is None else self.t_f0_left

def _set_portamento_left(self, value: float) -> None:
self.t_f0_left = value

portamento_left = property(_get_portamento_left, _set_portamento_left) # type: ignore [pydantic-field]
portamento_left = property(_get_portamento_left, _set_portamento_left)

def _get_portamento_right(self) -> float:
return constants.DEFAULT_PITCH_PORTAMENTO if self.t_f0_right is None else self.t_f0_right

def _set_portamento_right(self, value: float) -> None:
self.t_f0_right = value

portamento_right = property(_get_portamento_right, _set_portamento_right) # type: ignore [pydantic-field]
portamento_right = property(_get_portamento_right, _set_portamento_right)

def _get_depth_left(self) -> float:
return constants.DEFAULT_PITCH_DEPTH if self.d_f0_left is None else self.d_f0_left

def _set_depth_left(self, value: float) -> None:
self.d_f0_left = value

depth_left = property(_get_depth_left, _set_depth_left) # type: ignore [pydantic-field]
depth_left = property(_get_depth_left, _set_depth_left)

def _get_depth_right(self) -> float:
return constants.DEFAULT_PITCH_DEPTH if self.d_f0_right is None else self.d_f0_right

def _set_depth_right(self, value: float) -> None:
self.d_f0_right = value

depth_right = property(_get_depth_right, _set_depth_right) # type: ignore [pydantic-field]
depth_right = property(_get_depth_right, _set_depth_right)

def _get_vibrato_start(self) -> float:
return (
Expand All @@ -270,15 +270,15 @@ def _get_vibrato_start(self) -> float:
def _set_vibrato_start(self, value: float) -> None:
self.t_f0_vbr_start = value

vibrato_start = property(_get_vibrato_start, _set_vibrato_start) # type: ignore [pydantic-field]
vibrato_start = property(_get_vibrato_start, _set_vibrato_start)

def _get_vibrato_left(self) -> float:
return constants.DEFAULT_VIBRATO_FADE if self.t_f0_vbr_left is None else self.t_f0_vbr_left

def _set_vibrato_left(self, value: float) -> None:
self.t_f0_vbr_left = value

vibrato_left = property(_get_vibrato_left, _set_vibrato_left) # type: ignore [pydantic-field]
vibrato_left = property(_get_vibrato_left, _set_vibrato_left)

def _get_vibrato_right(self) -> float:
return (
Expand All @@ -288,39 +288,39 @@ def _get_vibrato_right(self) -> float:
def _set_vibrato_right(self, value: float) -> None:
self.t_f0_vbr_right = value

vibrato_right = property(_get_vibrato_right, _set_vibrato_right) # type: ignore [pydantic-field]
vibrato_right = property(_get_vibrato_right, _set_vibrato_right)

def _get_vibrato_depth(self) -> float:
return constants.DEFAULT_VIBRATO_DEPTH if self.d_f0_vbr is None else self.d_f0_vbr

def _set_vibrato_depth(self, value: float) -> None:
self.d_f0_vbr = value

vibrato_depth = property(_get_vibrato_depth, _set_vibrato_depth) # type: ignore [pydantic-field]
vibrato_depth = property(_get_vibrato_depth, _set_vibrato_depth)

def _get_vibrato_frequency(self) -> float:
return constants.DEFAULT_VIBRATO_FREQUENCY if self.f_f0_vbr is None else self.f_f0_vbr

def _set_vibrato_frequency(self, value: float) -> None:
self.f_f0_vbr = value

vibrato_frequency = property(_get_vibrato_frequency, _set_vibrato_frequency) # type: ignore [pydantic-field]
vibrato_frequency = property(_get_vibrato_frequency, _set_vibrato_frequency)

def _get_vibrato_phase(self) -> float:
return constants.DEFAULT_VIBRATO_PHASE if self.p_f0_vbr is None else self.p_f0_vbr

def _set_vibrato_phase(self, value: float) -> None:
self.p_f0_vbr = value

vibrato_phase = property(_get_vibrato_phase, _set_vibrato_phase) # type: ignore [pydantic-field]
vibrato_phase = property(_get_vibrato_phase, _set_vibrato_phase)

def _get_vibrato_jitter(self) -> float:
return constants.DEFAULT_VIBRATO_JITTER if self.d_f0_jitter is None else self.d_f0_jitter

def _set_vibrato_jitter(self, value: float) -> None:
self.d_f0_jitter = value

vibrato_jitter = property(_get_vibrato_jitter, _set_vibrato_jitter) # type: ignore [pydantic-field]
vibrato_jitter = property(_get_vibrato_jitter, _set_vibrato_jitter)

def set_phone_duration(self, index: int, duration: float) -> None:
if self.dur is None:
Expand Down
4 changes: 2 additions & 2 deletions libresvip/plugins/vsqx/vsqx_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def parse_project(self, vsqx_project: Vsqx) -> Project:
wav_units: VsqxWavUnitList = []
if vsqx_project.mono_track is not None:
wav_parts += vsqx_project.mono_track.wav_part
wav_units += [vsqx_project.mixer.mono_unit] * len(vsqx_project.mono_track.wav_part) # type: ignore[list-item]
wav_units += [vsqx_project.mixer.mono_unit] * len(vsqx_project.mono_track.wav_part)
if vsqx_project.stereo_track is not None:
wav_parts += vsqx_project.stereo_track.wav_part
wav_units += [vsqx_project.mixer.stereo_unit] * len(vsqx_project.stereo_track.wav_part) # type: ignore[list-item]
wav_units += [vsqx_project.mixer.stereo_unit] * len(vsqx_project.stereo_track.wav_part)
instrumental_tracks = self.parse_instrumental_tracks(wav_parts, wav_units, tick_prefix)
return Project(
song_tempo_list=tempos,
Expand Down
7 changes: 2 additions & 5 deletions libresvip/utils/music_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def clamp(
def _transform_interpolation_args(
func: Callable[[float], float],
) -> Callable[[float, tuple[float, float], tuple[float, float]], float]:
@functools.wraps(func)
@functools.wraps(func, assigned=["__module__", "__name__", "__qualname__", "__doc__"])
def inner(
x: float, start: tuple[float, float], end: tuple[float, float], *args: Any, **kwargs: Any
) -> float:
Expand Down Expand Up @@ -145,7 +145,4 @@ def ratio_to_db(ratio: float, val2: Optional[float] = None, using_amplitude: boo
if ratio == 0:
return -float("inf")

if using_amplitude:
return 20 * math.log10(ratio)
else: # using power
return 10 * math.log10(ratio)
return 20 * math.log10(ratio) if using_amplitude else 10 * math.log10(ratio)
Loading

0 comments on commit 6a1a6de

Please sign in to comment.