基础版本-δ-0.1.0,本地0.5.1

This commit is contained in:
bgArray 2022-01-28 17:07:29 +08:00
parent 79a2dfb5b1
commit d3e0f78d2c
30 changed files with 192 additions and 20 deletions

3
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

12
.idea/Musicreater.iml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
</module>

View File

@ -0,0 +1,46 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="LongLine" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyArgumentEqualDefaultInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyAugmentAssignmentInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyClassicStyleClassInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="false" level="WARNING" enabled_by_default="false">
<option name="ourVersions">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="3.10" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyMandatoryEncodingInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyMissingTypeHintsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E501" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N803" />
<option value="N806" />
<option value="N813" />
<option value="N801" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="list.__getitem__" />
<option value="list.split" />
</list>
</option>
</inspection_tool>
</profile>
</component>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Musicreater.iml" filepath="$PROJECT_DIR$/.idea/Musicreater.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

BIN
1.pkl

Binary file not shown.

View File

@ -225,15 +225,15 @@ def __main__():
print('加载菜单命令...') print('加载菜单命令...')
def exitapp(): def exitapp():
if os.path.isfile("1.pkl"):
# os.remove("1.pkl")
pass
global is_save global is_save
if is_save is not True: if is_save is not True:
if tkinter.messagebox.askyesno(title=READABLETEXT[1], message=READABLETEXT[106]): if tkinter.messagebox.askyesno(title=READABLETEXT[1], message=READABLETEXT[106]):
SaveProject() SaveProject()
log('程序正常退出') log('程序正常退出')
if os.path.isfile("1.pkl"):
os.remove("1.pkl")
try: try:
global dataset global dataset
del dataset del dataset
@ -294,8 +294,14 @@ def __main__():
SaveAsNewProject() SaveAsNewProject()
return return
else: else:
save_list = [dataset]
try:
with open("1.pkl", 'rb') as r:
save_list.append(pickle.load(r))
except FileNotFoundError:
pass
with open(ProjectName, 'wb') as f: with open(ProjectName, 'wb') as f:
pickle.dump(dataset, f) pickle.dump(save_list, f)
tkinter.messagebox.showinfo(title=READABLETEXT[4], message=READABLETEXT[107].format(ProjectName)) tkinter.messagebox.showinfo(title=READABLETEXT[4], message=READABLETEXT[107].format(ProjectName))
global is_save global is_save
is_save = True is_save = True
@ -330,8 +336,15 @@ def __main__():
if fn is None or fn == '': if fn is None or fn == '':
return return
Project_Name = fn Project_Name = fn
save_list = [dataset]
try:
with open("1.pkl", 'rb') as r:
save_list.append(pickle.load(r))
except FileNotFoundError:
pass
print(save_list)
with open(Project_Name, 'wb') as f: with open(Project_Name, 'wb') as f:
pickle.dump(dataset[0], f) pickle.dump(save_list, f)
tkinter.messagebox.showinfo(title=READABLETEXT[4], message=READABLETEXT[107].format(Project_Name)) tkinter.messagebox.showinfo(title=READABLETEXT[4], message=READABLETEXT[107].format(Project_Name))
global is_save global is_save
is_save = True is_save = True
@ -398,15 +411,28 @@ def __main__():
if fn is None or fn == '': if fn is None or fn == '':
return return
else: else:
# print(fn)
fn = fn[0] fn = fn[0]
# print(fn)
log("尝试打开:" + fn)
try: try:
try: try:
with open(fn, 'rb') as C: with open(fn, 'rb') as C:
dataset[0] = pickle.load(C) global dataset
except IndexError: # print(pickle.load(C))
read = pickle.load(C) # 重要的事情说三遍pickle.load只能load一次所以多load几次就有bug要一次读完
# 重要的事情说三遍pickle.load只能load一次所以多load几次就有bug要一次读完
# 重要的事情说三遍pickle.load只能load一次所以多load几次就有bug要一次读完
# print(read)
dataset = read[0]
pkl1 = read[1]
log("读取新文件成功")
with open("1.pkl", 'wb') as w:
pickle.dump(pkl1, w)
except KeyError:
with open(fn, 'rb') as C: with open(fn, 'rb') as C:
dataset[0] = pickle.load(C)[0] dataset[0] = pickle.load(C)
log("读取新文件成功")
except pickle.UnpicklingError: # 程序规范修改根据新的语法标准except后面不能没有错误类型测试后改为 except pickle.UnpicklingError: # 程序规范修改根据新的语法标准except后面不能没有错误类型测试后改为
# pickle.UnpicklingError # pickle.UnpicklingError
print(READABLETEXT[8].format(fn)) print(READABLETEXT[8].format(fn))
@ -721,8 +747,17 @@ def __main__():
if file is None or file == '': if file is None or file == '':
log('取消') log('取消')
return return
from bgArrayLib.sy_resourcesPacker import scatteredPack from bgArrayLib.sy_resourcesPacker import resources_pathSetting
scatteredPack(file) result = resources_pathSetting(file)
print(result)
if result[0] is False:
if result[1] == 1:
tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[157])
if result[1] == 2:
tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[158])
else:
from bgArrayLib.sy_resourcesPacker import scatteredPack
scatteredPack(file)
import zipfile import zipfile
from msctspt.funcOpera import makeNewFunDir from msctspt.funcOpera import makeNewFunDir
@ -745,6 +780,21 @@ def __main__():
shutil.move('./manifest.json', './temp/') shutil.move('./manifest.json', './temp/')
shutil.rmtree('./temp/') shutil.rmtree('./temp/')
def changeResourcesPath():
file = tkinter.filedialog.askdirectory(title=READABLETEXT[27], initialdir=r'./')
if file is None or file == '':
log('取消')
return
from bgArrayLib.sy_resourcesPacker import resources_pathSetting
result = resources_pathSetting(file)
print(result)
if result[0] is False:
if result[1] == 1:
tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[157])
if result[1] == 2:
tkinter.messagebox.showerror(title=READABLETEXT[0], message=READABLETEXT[158])
else:
tkinter.messagebox.showinfo(title=READABLETEXT[1], message=READABLETEXT[159])
# 转为空方块世界 # 转为空方块世界
def ToBlockWorldEpt(): def ToBlockWorldEpt():
@ -1178,8 +1228,9 @@ def __main__():
# 窗口部分 # 窗口部分
print('增加窗口元素...') print('增加窗口元素...')
global root global root
global __version__
root.title(READABLETEXT[41].format(VER[1] + VER[0])) root.title(READABLETEXT[41].format(__version__))
root.geometry('900x900') # 像素 root.geometry('900x900') # 像素
print('完成!') print('完成!')
@ -1432,6 +1483,7 @@ def __main__():
helpmenu.add_command(label=READABLETEXT[85], command=ClearLog) helpmenu.add_command(label=READABLETEXT[85], command=ClearLog)
helpmenu.add_command(label=READABLETEXT[86], command=resetver) helpmenu.add_command(label=READABLETEXT[86], command=resetver)
helpmenu.add_command(label=READABLETEXT[152], command=end) helpmenu.add_command(label=READABLETEXT[152], command=end)
helpmenu.add_command(label=READABLETEXT[156], command=changeResourcesPath)
helpmenu.add_separator() # 分隔符 helpmenu.add_separator() # 分隔符

View File

@ -9,7 +9,7 @@
金羿 (Eilles):主要作者,开发了音·创主体机器前身“函数音乐生成器”、“世界音创”。 金羿 (Eilles):主要作者,开发了音·创主体机器前身“函数音乐生成器”、“世界音创”。
bgArray “诸葛亮与八卦阵”修复bug改进代码美观度等。 bgArray “诸葛亮与八卦阵”修复bug改进代码美观度,增加新功能,更改数据格式等。
### 软件架构 ### 软件架构
@ -64,13 +64,31 @@ python3 Musicreater.py
2. 看得懂简体中文字的不一定全会用 2. 看得懂简体中文字的不一定全会用
3. 最好要懂一点点英文 3. 最好要懂一点点英文
### 诸葛亮与八卦阵的说明(不必要)
1. 首先!这里的提示是给想使用多音色资源包的人的,如果你想请下载 神羽资源包神羽自己的链接https://pan.baidu.com/s/11uoq5zwN7c3rX-98DqVpJg
提取码:ek3t
2. 下载到你自己电脑上某个位置,注意并不需要放置于本项目下。音色资源包较大,可以选取只下载:
`神羽资源包_乐器、音源的资源包\羽音缭绕-midiout_25.0` 这个文件夹。
3. 也可以只下载其中的:
`神羽资源包_乐器\音源的资源包\羽音缭绕-midiout_25.0\mcpack(国际版推荐)格式_25.0` 或者:
`神羽资源包_乐器\音源的资源包\羽音缭绕-midiout_25.0\zip格式_25.0`
4. 接下来就是关键了:在音创中绑定资源包
5. 首先,先打开音创->帮助与疑问->[神羽资源包位置选择]:选择文件夹... 这时候,
会跳出选择框,关键来了,选择:***你的mcpack(国际版推荐)_25.0文件夹或zip格式_25.0文件夹,外面的!文件夹!注意是外面的文件夹!!***
举个例子:我的文件路径是这样的:
`L:\shenyu\音源的资源包\羽音缭绕-midiout_25.0`这里面有:`神羽资源包_25.0_使用方法.xls`、
`mcpack(国际版推荐)格式_25.0`、`zip格式_25.0`两个文件夹和一个.xls文件而你在音创中
也应该选择这个文件夹:**L:\shenyu\音源的资源包\羽音缭绕-midiout_25.0**
### 致谢 ### 致谢
1. 感谢由 [Fuckcraft](https://github.com/fuckcraft) “鸣凤鸽子”等 带来的我的世界websocket服务器功能 1. 感谢由 [Fuckcraft](https://github.com/fuckcraft) “鸣凤鸽子”等 带来的我的世界websocket服务器功能
2. 感谢 昀梦\<QQ1515399885\> 找出指令生成错误bug并指正 2. 感谢 昀梦\<QQ1515399885\> 找出指令生成错误bug并指正
3. 感谢由 Charlie_Ping “查理平” 带来的bdx转换功能 3. 感谢由 Charlie_Ping “查理平” 带来的bdx转换功能
4. 感谢由 CMA_2401PT 带来的 BDXWorkShop 供本程序对于bdx操作的指导 4. 感谢由 CMA_2401PT 带来的 BDXWorkShop 供本程序对于bdx操作的指导
5. 5. 感谢由 Miracle Plume “神羽” \<QQshenyu40403\>带来的基岩版资源包
6. 感谢广大群友为此程序提供的测试等支持 6. 感谢广大群友为此程序提供的测试等支持
7. 若您对我们有所贡献但您的名字没有显示在此列表中,请联系我! 7. 若您对我们有所贡献但您的名字没有显示在此列表中,请联系我!
@ -79,4 +97,8 @@ python3 Musicreater.py
1. QQ 2647547478 1. QQ 2647547478
2. 电邮 EillesWan2006@163.com W-YI_DoctorYI@outlook.com EillesWan@outlook.com 2. 电邮 EillesWan2006@163.com W-YI_DoctorYI@outlook.com EillesWan@outlook.com
3. 微信 WYI_DoctorYI 3. 微信 WYI_DoctorYI
### 作者 诸葛亮与八卦阵 联系方式
1. QQ 4740437765

View File

@ -0,0 +1 @@
L:/shenyu/音源的资源包/羽音缭绕-midiout_25.0

View File

@ -30,10 +30,11 @@ manifest = {
def resources_pathSetting(newPath: str = ""): def resources_pathSetting(newPath: str = ""):
if not os.path.isfile("./bgArrayLib/resourcesPath.rpposi") and newPath == "": if not os.path.isfile("./bgArrayLib/resourcesPath.rpposi") and newPath == "":
return [False, 1] # 1:没有路径文件 return [False, 1] # 1:没有路径文件
elif not os.path.isfile("./bgArrayLib/resourcesPath.rpposi") and newPath != "": elif newPath != "": # not os.path.isfile("./bgArrayLib/resourcesPath.rpposi") and
path = newPath path = newPath
print(path)
with open("./bgArrayLib/resourcesPath.rpposi", 'w') as w: with open("./bgArrayLib/resourcesPath.rpposi", 'w') as w:
path = w.write(path) w.write(path)
if "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" in os.listdir(path): if "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" in os.listdir(path):
return [True, path, 1] # 1:都有 return [True, path, 1] # 1:都有
elif "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" not in os.listdir(path): elif "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" not in os.listdir(path):
@ -42,7 +43,7 @@ def resources_pathSetting(newPath: str = ""):
return [True, path, 3] # 3:有zip return [True, path, 3] # 3:有zip
else: else:
return [False, 2] # 2:路径文件指示错误 return [False, 2] # 2:路径文件指示错误
if os.path.isfile("./bgArrayLib/resourcesPath.rpposi"): if os.path.isfile("./bgArrayLib/resourcesPath.rpposi" and newPath == ""):
with open("./bgArrayLib/resourcesPath.rpposi", 'r') as f: with open("./bgArrayLib/resourcesPath.rpposi", 'r') as f:
path = f.read() path = f.read()
if "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" in os.listdir(path): if "mcpack(国际版推荐)格式_25.0" in os.listdir(path) and "zip格式_25.0" in os.listdir(path):

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -168,5 +168,9 @@ READABLETEXT = {
153: "生成新函数包至...", 153: "生成新函数包至...",
154: "生成新函数附加包文件至...", 154: "生成新函数附加包文件至...",
155: "生成新函数附加包文件,并将神羽资源包以散包形式放置至...", 155: "生成新函数附加包文件,并将神羽资源包以散包形式放置至...",
156: "[神羽资源包位置选择]:选择文件夹...",
157: "没有路径文件(.rpposi文件)请仔细阅读Readme或先试用帮助与疑问->[神羽资源包位置选择]:选择文件夹... 方法添加路径文件吧!",
158: "有路径文件(.rpposi文件)但路径指示错误请仔细阅读Readme或先用帮助与疑问->[神羽资源包位置选择]:选择文件夹... 更改路径!",
159: "更改路径文件(.rpposi文件)成功!!"
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -97,7 +97,7 @@ class version:
) )
"""当前所需库,有一些是开发用的,用户不需要安装""" """当前所需库,有一些是开发用的,用户不需要安装"""
version = ('0.0.1', 'Delta',) version = ('0.1.0', 'Delta',)
"""当前版本""" """当前版本"""
def __init__(self) -> None: def __init__(self) -> None:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -30,9 +30,16 @@ Copyright © W-YI 2022
新更新日志 新更新日志
Delta 0.1.0
2022 1 27
1.完成了多音色的支持,但仍需修改
Delta 0.0.2
2022 1 19
1.纠正几乎所有语法
Delta 0.0.1 Delta 0.0.1
2021 1 3 2022 1 3
1.新增对翻译字符串的支持 1.新增对翻译字符串的支持
2.把所有需要翻译的字符串用双引号字符串表示,其余全是单引号字符串 2.把所有需要翻译的字符串用双引号字符串表示,其余全是单引号字符串
2.2.累死我了,我错了我错了,饶了我吧,以后一定遵守代码规范 2.2.累死我了,我错了我错了,饶了我吧,以后一定遵守代码规范