diff --git a/README_en.md b/README_en.md index 73c34b9..ba811ab 100644 --- a/README_en.md +++ b/README_en.md @@ -5,7 +5,7 @@ Musicreater(音·创) is an Eilles(*W-YI*)'s app that is used for creating music Welcome to join our QQ group: 861684859 -###Author +### Author Eilles (金羿):The main author, who developed the most and especially the principal parts of Musicreater, and its predecessors, which has been called as "*Minecraft Function Music Maker*", "*Note Fun Creater*", "*Note World Creater*"(now ,they are united as ***Musicreater***!) diff --git a/bgArrayLib/bpm.py b/bgArrayLib/bpm.py index 6e1f3f4..b6fdc30 100644 --- a/bgArrayLib/bpm.py +++ b/bgArrayLib/bpm.py @@ -1,12 +1,22 @@ import mido import numpy +''' +bpm +bites per minutes +每分钟的拍数 +''' def mt2gt(mt, tpb_a, bpm_a): return round(mt / tpb_a / bpm_a * 60) -def get(mid:mido.MidiFile): +def get(mid:mido.MidiFile) -> int: + '''传入一个 MidiFile, 返回其音乐的bpm + :param mid : mido.MidFile + mido库识别的midi文件数据 + :return bpm : int + ''' # mid = mido.MidiFile(mf) long = mid.length tpb = mid.ticks_per_beat diff --git a/msctLib/data.py b/msctLib/data.py index d913fd1..f22cea4 100644 --- a/msctLib/data.py +++ b/msctLib/data.py @@ -126,6 +126,24 @@ class uniteIO: return self._data + + + + + + + + + + + + + + + + + + if __name__ == '__main__': from sys import argv diff --git a/msctLib/display.py b/msctLib/display.py index 039e3e5..266ff66 100644 --- a/msctLib/display.py +++ b/msctLib/display.py @@ -40,9 +40,11 @@ class disp: raise KeyError(f'无法定位函数{func}') def setTitle(self,title:str = '') -> None: + '''设置窗口标题''' self.root.title = title def setGeometry(self,geometry) -> None: + '''设置窗口大小''' self.root.geometry(geometry) def setIcon(self,*icon) -> None: @@ -62,8 +64,13 @@ class disp: menus.append(menu) def setWidget(self,**kwgs) -> None: + self._wordviewBar = tk.Label(self.root) pass + def setWordView(self, **kwgs) -> None: + for key,value in kwgs.items(): + self._wordviewBar[key] = value + diff --git a/msctLib/开发说明兼指南.md b/msctLib/开发说明兼指南.md index 57fb0e8..7ff22a3 100644 --- a/msctLib/开发说明兼指南.md +++ b/msctLib/开发说明兼指南.md @@ -1,16 +1,18 @@ - -# 开发说明\|指南 +开发说明\|指南 +============== 此文件旨在使后期欲参与开发之人员减轻其开发负担,同时也为了我们正在开发的人员详细说明功能与用法 掌握开发指南之后,在调用函数等的过程中将会更加方便 -## 文件结构 +文件结构 +-------- 从主文件调用display.py以实现显示,调用functions.py以使用功能 functions.py中会调取./addon/目录下的全部功能文件,这些功能文件必须先由./addon/addons.pkl来预先定义好 -## 详细说明 +详细说明 +-------- ### msctLib @@ -19,11 +21,12 @@ functions.py中会调取./addon/目录下的全部功能文件,这些功能文 #### display.py 1. class disp + - 参数 - 1. `**kwgs`对窗口的基础设定 - `{ '组件名称' : 函数自设定 }` - 例如: - ```python + + 1. `**kwgs`对窗口的基础设定 `{ '组件名称' : 函数自设定 }` 例如: + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ python { 'version': '0.0.1', # version指的是当前配置格式的版本 'title': "音·创", @@ -38,8 +41,6 @@ functions.py中会调取./addon/目录下的全部功能文件,这些功能文 'widget': { #对窗口部件又详细说明 'wordview':{ 'text':'言·论', - 'bg':'black', - 'fg':'white' }, 'settingbox':{}, #后文详细说明 'tracklist':{}, @@ -47,34 +48,60 @@ functions.py中会调取./addon/目录下的全部功能文件,这些功能文 'map':{}, }, } - ``` + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + - 函数 + 1. `setMenu`对菜单的基础设定 - ```python + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ python { 菜单名 : { 选项名 : 选项函数 } } - ``` - 注: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + 注: `菜单名` : `str` 显示在菜单上的字符串 `选项名` : `str` 显示在菜单选项上的字符串 `选项函数` : `function` 菜单调取的函数(无返回值,无入参) - 2. `setWidget`对窗口部件的放置 + 当 `选项名` 的布尔值判定为 `False` 的时候,无论 `选项函数` 为何,皆插入一段分割线 + + 2. `setWidget`对窗口部件的放置 ```python - wordview:dict = { - 'text':'言·论', - 'bg':'black', - 'fg':'white' + wordview: dict = { #言论部分显示的字样 + 'text': str = 显示内容, + # ... 即可用 tk.Label 的参数 }, - settingbox:{}, #后文详细说明 - tracklist:{}, - operation:{}, - map:{}, + settingbox: list = [ #设置部分显示的字样及其对应的设置函数 + (设置名称:str,值类型,显示内容:str,设置操作函数:function,) + ] + tracklist: int = 音轨数量 #音轨选择框 + operation: dict = { + 按钮名称 : 执行函数 + } + map: list = [ + 音符: class Note + ] ``` 注: + + 上文中,值类型可以是如下几个项 + 1. `('str',)` 字符串类型,使用文本框输入数据 + 2. `('bool',)` 布尔类型,使用复选框输入数据 + 3. `('num',最小值:int,最大值:int,步长:int = 1)` 数值类型,使用数值滑动条输入数据 + 4. `('list',列表项:list)` 单选类型,即列表中多选一,使用单选框输入数据 + 值得注意的是,在kwgs中修改的部件设置,可以在其变量中读取或热修改,对应的变量如下 + + | 参数 | 对应类中的变量 | 变量类型 | 说明 | + |------------|------------------|---------------------------|---------------------| + | wordview | wordview | str | 显示在 言·论 区域的文字 | + | settingbox | settings | list[ Any ] | 设置项目中的值 | + | tracklist | tracknum | tuple(int,int) | 当前选择到的音轨与音轨总数| + | operation | buttons | list[ tkinter.Button ] | 按钮列表 | + | map | notes | list[ class Note ] | 当前的音符列表 | @@ -82,4 +109,13 @@ functions.py中会调取./addon/目录下的全部功能文件,这些功能文 - + # 这里是全局设置 + 'name' : str, #项目名,即包名 + 'title': str, #音乐名称 + 'repeation': bool, #是否开启重复播放 + 'player_selection': str, #玩家选择器,用于选择播放的的玩家 + # 下面是音轨独立设置 + 'track_name': str, #此音轨的名字 + 'track_sbname': str, #此音轨所使用的计分板 + - 变量 + 使用类中的变量可以对类中的内容进行实时修改 diff --git a/msctspt/bugReporter.py b/msctspt/bugReporter.py index d0b4f11..d4d261b 100644 --- a/msctspt/bugReporter.py +++ b/msctspt/bugReporter.py @@ -97,7 +97,7 @@ class version: ) """当前所需库,有一些是开发用的,用户不需要安装""" - version = ('0.1.5.1', 'Delta',) + version = ('0.2.0', 'Delta',) """当前版本""" def __init__(self) -> None: diff --git a/resources/MSCT Dev Log.txt b/resources/MSCT Dev Log.txt index d212414..2a8033a 100644 --- a/resources/MSCT Dev Log.txt +++ b/resources/MSCT Dev Log.txt @@ -1,5 +1,5 @@ 音·创(Musicreater)是由金羿(W-YI)开发的一款《我的世界》基岩版音乐生成辅助软件 -本软件源代码依照Apache软件协议公开。 +本软件源代码依照Apache 2.0软件协议公开。 Copyright © W-YI 2022 @@ -19,11 +19,12 @@ Copyright © W-YI 2022 10.支持采用延时的播放器 11.支持使用bdx导出结构 12.支持采用tp的方法播放 -13.支持识别曲谱图片解析音乐 +13.支持识别曲谱(简谱)图片解析音乐 14.支持使用瀑布流的方式播放音乐 - - +15.支持读入Everyone Piano的曲谱文件(.eop) +16.支持读入Musescore的曲谱文件(.mscz、.mscx) 17.支持自动搜寻地图目录位置(网易&微软) +18.支持读入JPword曲谱文件(.jpd) =============== 2022 年度挑战 @@ -36,6 +37,9 @@ Copyright © W-YI 2022 新更新日志 + Delta 0.2.0 +2022 2 10 ~ 2022 3 + Delta 0.1.5.2 2022 2 1 农历大年初一 diff --git a/resources/myWords.txt b/resources/myWords.txt index 45d8687..16276f7 100644 --- a/resources/myWords.txt +++ b/resources/myWords.txt @@ -73,3 +73,13 @@ A man achieve with challenges. 美酒宜人,宜人的却不只是美酒。 ——原神 戏会落幕,人生却不会。 ——原神 历史越久远,土地上的每一件事物就会承载更多价值。 ——原神 +深邃的灵魂唤起久远的回忆 +求索之人 当为奉之 +无论前路为星辰亦或深渊,皆需往而为之 +除了路途中的花与枫叶,还有心中的「道」 ——原神 +只有败北,才能感悟差距,才有机会成长 ——原神 +命运的邂逅,必定有其意义 ——原神 +万商云来,千船继至。\n百货迭出,诸海历览。\n ——原神 +现状越是难以置信,我们越是不能停下脚步。 ——原神 +古老的文明孕育着最美丽的传说 ——原神 +百川奔流 雨露不休 diff --git a/查看代码数.py b/查看代码数.py index 9683985..4887557 100644 --- a/查看代码数.py +++ b/查看代码数.py @@ -12,10 +12,9 @@ for path, dir_list, file_list in os.walk(r"./"): print("得到文件名:" + str(file)) for i in open(file, 'r', encoding="utf-8"): code = i.replace(' ', '').replace('\n', '') - try: - code -= code[code.index('#'):] - except: - pass + + if code.startswith('#'): + continue if code: print("\t" + code) m += 1