From bde2b4e37826f5d6f3e8fe4f43e8d382dbe2362f Mon Sep 17 00:00:00 2001 From: bgArray <474037765@qq.com> Date: Thu, 29 Dec 2022 11:52:10 +0000 Subject: [PATCH] update msctPkgver/main.py. Signed-off-by: bgArray <474037765@qq.com> --- msctPkgver/main.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/msctPkgver/main.py b/msctPkgver/main.py index 42484c0..1788381 100644 --- a/msctPkgver/main.py +++ b/msctPkgver/main.py @@ -523,23 +523,23 @@ class midiConvert: # /playsound [player: target] [position: x y z] # [volume: float] [pitch: float] [minimumVolume: float] - volume_d = 1 / volume - 1 - if volume_d == 0.0: - volume_d = "" - command_now = "playsound {0} @a[scores={{{1}}}] ~ ~{2} ~ {3} {4}" \ - .format(soundID, "{}={}".format(scoreboardname, - nowscore), volume_d, - msg.velocity, 2 ** ((msg.note - 60 - _X) / 12)) - singleTrack.append(command_now) - # singleTrack.append( - # "execute @a[scores={" - # + str(scoreboardname) - # + "=" - # + str(nowscore) - # + "}" - # + f"] ~ ~ ~ playsound {soundID} @s ~ ~{1 / volume - 1} ~ " - # f"{msg.velocity * (0.7 if msg.channel == 0 else 0.9)} {2 ** ((msg.note - 60 - _X) / 12)}" - # ) + # volume_d = 1 / volume - 1 + # if volume_d == 0.0: + # volume_d = "" + # command_now = "playsound {0} @a[scores={{{1}}}] ~ ~{2} ~ {3} {4}" \ + # .format(soundID, "{}={}".format(scoreboardname, + # nowscore), volume_d, + # msg.velocity, 2 ** ((msg.note - 60 - _X) / 12)) + # singleTrack.append(command_now) + singleTrack.append( + "execute @a[scores={" + + str(scoreboardname) + + "=" + + str(nowscore) + + "}" + + f"] ~ ~ ~ playsound {soundID} @s ~ ~{1 / volume - 1} ~ " + f"{msg.velocity * (0.7 if msg.channel == 0 else 0.9)} {2 ** ((msg.note - 60 - _X) / 12)}" + ) commands += 1 if len(singleTrack) != 0: tracks.append(singleTrack)