没有做任何更改,上传一下做备份。

This commit is contained in:
EillesWan 2022-03-06 23:46:35 +08:00
parent 320114533d
commit 53c17f0328
6 changed files with 88 additions and 30 deletions

View File

@ -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***!)

View File

@ -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

View File

@ -62,8 +62,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

View File

@ -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, #此音轨所使用的计分板
- 变量
使用类中的变量可以对类中的内容进行实时修改

View File

@ -73,3 +73,11 @@ A man achieve with challenges.
美酒宜人,宜人的却不只是美酒。 ——原神
戏会落幕,人生却不会。 ——原神
历史越久远,土地上的每一件事物就会承载更多价值。 ——原神
深邃的灵魂唤起久远的回忆
求索之人 当为奉之
无论前路为星辰亦或深渊,皆需往而为之
除了路途中的花与枫叶,还有心中的「道」 ——原神
只有败北,才能感悟差距,才有机会成长 ——原神
命运的邂逅,必定有其意义 ——原神
万商云来,千船继至。\n百货迭出诸海历览。\n ——原神
现状越是难以置信,我们越是不能停下脚步。 ——原神

View File

@ -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