mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2024-11-14 11:27:42 +08:00
没改
This commit is contained in:
parent
73854be7be
commit
abb53a7499
@ -36,6 +36,7 @@ import brotli
|
|||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
import shutil
|
import shutil
|
||||||
|
import math
|
||||||
|
|
||||||
|
|
||||||
def makeZip(sourceDir, outFilename, compression=8, exceptFile=None):
|
def makeZip(sourceDir, outFilename, compression=8, exceptFile=None):
|
||||||
@ -91,8 +92,8 @@ class midiConvert:
|
|||||||
:param instrumentID: midi的乐器ID
|
:param instrumentID: midi的乐器ID
|
||||||
:param default: 如果instrumentID不在范围内,返回的默认我的世界乐器名称
|
:param default: 如果instrumentID不在范围内,返回的默认我的世界乐器名称
|
||||||
:return: (str我的世界乐器名, int转换算法中的X)"""
|
:return: (str我的世界乐器名, int转换算法中的X)"""
|
||||||
|
try:
|
||||||
return {
|
a = {
|
||||||
0: ("note.harp", 6),
|
0: ("note.harp", 6),
|
||||||
1: ("note.harp", 6),
|
1: ("note.harp", 6),
|
||||||
2: ("note.pling", 6),
|
2: ("note.pling", 6),
|
||||||
@ -222,6 +223,9 @@ class midiConvert:
|
|||||||
126: ("note.basedrum", 7), # 打击乐器无音域
|
126: ("note.basedrum", 7), # 打击乐器无音域
|
||||||
127: ("note.snare", 7), # 打击乐器无音域
|
127: ("note.snare", 7), # 打击乐器无音域
|
||||||
}[instrumentID]
|
}[instrumentID]
|
||||||
|
except:
|
||||||
|
a = ("note.harp", 6)
|
||||||
|
return a
|
||||||
|
|
||||||
def __score2time(self, score: int):
|
def __score2time(self, score: int):
|
||||||
return str(int(int(score / 20) / 60)) + ":" + str(int(int(score / 20) % 60))
|
return str(int(int(score / 20) / 60)) + ":" + str(int(int(score / 20) % 60))
|
||||||
@ -628,8 +632,6 @@ class midiConvert:
|
|||||||
:param total: 总方块数量
|
:param total: 总方块数量
|
||||||
:param maxHeight: 最大高度
|
:param maxHeight: 最大高度
|
||||||
:return: 外切正方形的边长 int"""
|
:return: 外切正方形的边长 int"""
|
||||||
import math
|
|
||||||
|
|
||||||
return math.ceil(math.sqrt(math.ceil(total / maxHeight)))
|
return math.ceil(math.sqrt(math.ceil(total / maxHeight)))
|
||||||
|
|
||||||
def tomcpack(
|
def tomcpack(
|
||||||
|
Loading…
Reference in New Issue
Block a user