更新文档及其翻译……,另外对无法批量转换带进度条的bug做了更正……现在批量可以用进度条了

This commit is contained in:
EillesWan 2022-10-05 23:59:06 +08:00
parent 77b7344277
commit c32b94592a
4 changed files with 175 additions and 81 deletions

View File

@ -50,9 +50,18 @@ while True:
isAutoReset = input('是否自动重置计分板(1|0)') isAutoReset = input('是否自动重置计分板(1|0)')
if isAutoReset != '': if isAutoReset != '':
isAutoReset = bool(int(isAutoReset)) isAutoReset = bool(int(isAutoReset))
isProgress = input('是否开启进度条(1|0)') while True:
if isProgress != '': isProgress = input('*进度条[注]')
isProgress = bool(int(isProgress)) if isProgress != '':
if isProgress in ('1', 'True'):
isProgress = True
elif isProgress in ('0', 'False'):
isProgress = False
else:
isProgress = isProgress
else:
continue
break
sbname = input('请输入计分板名称:') sbname = input('请输入计分板名称:')
volume = input('请输入音量0-1') volume = input('请输入音量0-1')
if volume != '': if volume != '':
@ -62,9 +71,18 @@ while True:
speed = float(speed) speed = float(speed)
elif outFormat == 1: elif outFormat == 1:
author = input('请输入作者:') author = input('请输入作者:')
isProgress = input('是否开启进度条(1|0)') while True:
if isProgress != '': isProgress = input('*进度条[注]')
isProgress = bool(int(isProgress)) if isProgress != '':
if isProgress in ('1', 'True'):
isProgress = True
elif isProgress in ('0', 'False'):
isProgress = False
else:
isProgress = isProgress
else:
continue
break
maxHeight = input('请输入指令结构最大生成高度:') maxHeight = input('请输入指令结构最大生成高度:')
if maxHeight != '': if maxHeight != '':
maxHeight = int(maxHeight) maxHeight = int(maxHeight)
@ -82,6 +100,9 @@ while True:
except BaseException: except BaseException:
print('输入错误,请重新输入') print('输入错误,请重新输入')
if os.path.isdir(midipath): if os.path.isdir(midipath):
for i in os.listdir(midipath): for i in os.listdir(midipath):
if i.lower().endswith('.mid'): if i.lower().endswith('.mid'):
@ -93,9 +114,7 @@ if os.path.isdir(midipath):
isAutoReset isAutoReset
if isAutoReset != '' if isAutoReset != ''
else bool(int(input('是否自动重置计分板(1|0)'))), else bool(int(input('是否自动重置计分板(1|0)'))),
isProgress isProgress,
if isProgress != ''
else bool(int(input('是否开启进度条(1|0)'))),
sbname if sbname != '' else input('请输入计分板名称:'), sbname if sbname != '' else input('请输入计分板名称:'),
volume if volume != '' else float(input('请输入音量0-1')), volume if volume != '' else float(input('请输入音量0-1')),
speed if speed != '' else float(input('请输入速度倍率:')), speed if speed != '' else float(input('请输入速度倍率:')),
@ -104,9 +123,7 @@ if os.path.isdir(midipath):
convertion.toBDXfile( convertion.toBDXfile(
1, 1,
author if author != '' else input('请输入作者:'), author if author != '' else input('请输入作者:'),
isProgress isProgress,
if isProgress != ''
else bool(int(input('是否开启进度条(1|0)'))),
maxHeight if maxHeight != '' else int(input('请输入指令结构最大生成高度:')), maxHeight if maxHeight != '' else int(input('请输入指令结构最大生成高度:')),
sbname if sbname != '' else input('请输入计分板名称:'), sbname if sbname != '' else input('请输入计分板名称:'),
volume if volume != '' else float(input('请输入音量0-1')), volume if volume != '' else float(input('请输入音量0-1')),
@ -121,7 +138,7 @@ else:
convertion.tomcpack( convertion.tomcpack(
1, 1,
isAutoReset if isAutoReset != '' else bool(int(input('是否自动重置计分板(1|0)'))), isAutoReset if isAutoReset != '' else bool(int(input('是否自动重置计分板(1|0)'))),
isProgress if isProgress != '' else bool(int(input('是否开启进度条(1|0)'))), isProgress,
sbname if sbname != '' else input('请输入计分板名称:'), sbname if sbname != '' else input('请输入计分板名称:'),
volume if volume != '' else float(input('请输入音量0-1')), volume if volume != '' else float(input('请输入音量0-1')),
speed if speed != '' else float(input('请输入速度倍率:')), speed if speed != '' else float(input('请输入速度倍率:')),
@ -130,7 +147,7 @@ else:
convertion.toBDXfile( convertion.toBDXfile(
1, 1,
author if author != '' else input('请输入作者:'), author if author != '' else input('请输入作者:'),
isProgress if isProgress != '' else bool(int(input('是否开启进度条(1|0)'))), isProgress,
maxHeight if maxHeight != '' else int(input('请输入指令结构最大生成高度:')), maxHeight if maxHeight != '' else int(input('请输入指令结构最大生成高度:')),
sbname if sbname != '' else input('请输入计分板名称:'), sbname if sbname != '' else input('请输入计分板名称:'),
volume if volume != '' else float(input('请输入音量0-1')), volume if volume != '' else float(input('请输入音量0-1')),

View File

@ -22,8 +22,8 @@ while True:
authorname = input('请输入作者:') authorname = input('请输入作者:')
while True: while True:
isProgress = input('*进度条[注]') isProgress = input('*进度条[注]')
if isProgress != '' : if isProgress != '':
if isProgress in ('1','True'): if isProgress in ('1', 'True'):
isProgress = True isProgress = True
elif isProgress in ('0', 'False'): elif isProgress in ('0', 'False'):
isProgress = False isProgress = False
@ -49,7 +49,9 @@ while True:
print('输入错误,请重新输入') print('输入错误,请重新输入')
def operation(i,): def operation(
i,
):
print(f'正在操作{i}') print(f'正在操作{i}')
convertion.convert(midipath + '/' + i, outpath) convertion.convert(midipath + '/' + i, outpath)
convertion.toBDXfile_withDelay( convertion.toBDXfile_withDelay(
@ -65,9 +67,10 @@ def operation(i,):
if os.path.isdir(midipath): if os.path.isdir(midipath):
import threading import threading
for i in os.listdir(midipath): for i in os.listdir(midipath):
if i.lower().endswith('.mid'): if i.lower().endswith('.mid'):
threading.Thread(target=operation,args=(i,)).start() threading.Thread(target=operation, args=(i,)).start()
else: else:
convertion.convert(midipath, outpath) convertion.convert(midipath, outpath)
convertion.toBDXfile_withDelay( convertion.toBDXfile_withDelay(

View File

@ -5,47 +5,112 @@
</p> </p>
## Instructions📕 # Instructions for Using Demo(s)
> 0. Install Python 3.6+ *This is a tutorial for using the demo(s) of this library, not the Development Guide. If you want to see so, please read Below*
>
> While installing, be sure to check "add Python 3.X to path", otherwise it needs to be set manually
>
> After the installation, remember to enter in CMD: "python" to try
>
> whether the installation is successful.
>
> Python installation tutorial can be found on the Internet easily.
>
> 1. Install (download this program)
> Git, you can use the following commands:
>
> `git clone -b pkgver https://gitee.com/EillesWan/Musicreater.git`
>
> If Git is not installed, you can download the zip package from the website. Then decompress it
> and enter the directory.
>
> 2. Run (enter directory)
>
> Open CMD in the directory, enter the directory, and execute the following commands:
>
> `pip install mido`
>
> `pip install brotli`
>
> `pip install openpyxl`
>
> 3. Start using!
>
> Open CMD in the directory, enter the directory, and execute the following commands:
>
> (Choose what you need)
>
> `python example_convert_bdx.py`
>
> `python example_convert_mcpack.py`
### Instructions for **Customize Progress Bar** ## Under Windows
0. Install Python 3.6+
First of all, you need to install the runtime environment of this library, *Python*. And a Installation Pack maybe the best choice:
> [Downloading Python 64-bit](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe)
> [Downloading Python 32-bit](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe)
While installing, it's better to check `Add Python 3.X to PATH`(just as the screenshot showed below), otherwise it needs to be set manually which may cause some time wasting
<img src=https://foruda.gitee.com/images/1662736520757331846/e38efb81_9911226.png>
If you are new to Python or not very familiar to Computer Programming, and having the disk space in your PC's System Partition (usually C:) of 150 MB, you can directly choose *Install Now*.
However, if you want to do it like a pro, choosing *Customize Installation*, it's a necessary to be sure to check `pip` and `py launcher` will be installed on your computer(see screenshot below). The two options is required for the next step of installing the requirements.
<img src=https://foruda.gitee.com/images/1662736621235871190/2ac3d98f_9911226.png>
After the installation, you can enter in your terminal(CMD/PowerShell/Bash/etc): "python" to ensure whether the installation was successful. If it was, your terminal will show things like below:
<img src=https://foruda.gitee.com/images/1659972669907359295/cmd.png>
1. Installing Requirements
It's better to open your terminal(CMD/PowerShell/Bash/etc) under Administrator Mode.
For example, if you want to use CMD in Administrator Mode, you can search `cmd` in the *Start Menu*, right click it and *Run as Administrator*
<img src="https://foruda.gitee.com/images/1662736878650993886/62487dd8_9911226.png">
Okay, after that, please enter in your terminal:
`pip install mido`
`pip install brotli`
If successful you will see something like below:
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
2. Download This Package and Demo(s)
- If you using Git, you can use the following commands to clone this lib:
`git clone -b pkgver https://gitee.com/EillesWan/Musicreater.git`
- If Git is not installed, you can download the zip package from the code page(from [GitHub](https://github.com/EillesWan/Musicreater.git) or [Gitee](https://gitee.com/EillesWan/Musicreater.git)). Or you are a Chinese fan having a QQ account, you can [Join the QQ Group 861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr) and get it from our GroupFiles.
<img src=" https://foruda.gitee.com/images/1659972440341216712/下载.png" >
2. Start Using Demo(s)
Open your terminal in the directory of this, taking CMD, for example, just enter the directory and enter `cmd` in the path box:
<img src=https://foruda.gitee.com/images/1659974437388532868/输入.png>
<img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png>
And enter one of the commands below by choosing what you need:
`python demo_convert.py`
`python demo_convert_bdx_byDelay.py`
### Addition for Error(s) Using or Installing
1. Environment Error of Microsoft Visual C++ Redistributable
If you meet this condition as the screenshot shows:
<img src=https://foruda.gitee.com/images/1659972789779764953/bug.jpeg>
Your MSVC Environment may be not installed, and you can download and install
> [Here of 64-Bit VCREDIST](https://aka.ms/vs/17/release/vc_redist.x64.exe)
> [Here of 32-Bit VCREDIST](https://aka.ms/vs/17/release/vc_redist.x86.exe)
Thank our groupmate *Mono* again for helping finding this problem.
2. More Info for Parameters of Our Demo Program(s)
<img src=https://foruda.gitee.com/images/1659974810147043475/运行.png>
|Input Prompt|English Translation|Description|
|----------------|----------------|-------|
|请输入MIDI文件路径|Midi File Path|Path of a .mid file or a directory. While directory entered, our demo will convert all midi(s) in the directory|
|请输入输出路径|Output Path|Where files converted in|
|是否重置计分板|Whether Reset Scoreboard Automatically|Can only be 1 or 0(Recommanded 1)|
|*进度条[注]|Progressbar|Whether to enable Progressbar and customize progressbar style. Type 0 or False to disable, 1 or True to use default style, or type using format taught in follow the Instructions below to customize one you like|
|请输入计分板名称|Scoreboard Name|*Only not byDelay* The name of scoreboard that player using|
|请输入音量|Volume|Only decimal in [0,1],(Recommanded 1)|
|请输入速度倍率|Speed Multiplying Factor|Maybe you want to play it faster(1) or slower(0 1)?|
|请输入玩家选择器|Player Selector|Full Selector including `@x`. E.g: Play for players tagged `Holo`, enter `@a[tag=Holo]` on this parameter|
# Instructions for **Customize Progress Bar**
We have supported the function of making progress bar in *Minecraft*'s music player. And also the method of customize them. So the following instructions are about the parameters of the Progress Bar Customizition. We have supported the function of making progress bar in *Minecraft*'s music player. And also the method of customize them. So the following instructions are about the parameters of the Progress Bar Customizition.

View File

@ -1,3 +1,9 @@
<h1 align="center">音·创 Musicreater</h1>
<p align="center">
<img width="128" height="128" src="https://s1.ax1x.com/2022/05/06/Ouhghj.md.png" >
</p>
# 演示程序使用教程 # 演示程序使用教程
*由于先前的 **读我文件**(README.md) 过于冗杂,现另辟蹊径来给大家全方位的教程。* *由于先前的 **读我文件**(README.md) 过于冗杂,现另辟蹊径来给大家全方位的教程。*
@ -8,18 +14,18 @@
### 运行环境安装 ### 运行环境安装
0. 安装python3.6+ 0. 安装 Python3.6+
首先需要下载Python的安装包 首先需要下载Python的安装包
> [下载64位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe) > [下载64位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe)
> [下载32位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe) > [下载32位Python安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe)
在安装时,最好需要勾选 `Add Python 3.X to PATH` ,如下图所示,当然,如果您对自己非常自信,您也可以手动设置此项目: 在安装时,最好需要勾选 `Add Python 3.X to PATH`,如下图所示,当然,如果您对自己非常自信,您也可以手动设置此项目:
<img src=https://foruda.gitee.com/images/1662736520757331846/e38efb81_9911226.png> <img src=https://foruda.gitee.com/images/1662736520757331846/e38efb81_9911226.png>
若您对Python一知半解或者不怎么了解、并对自己的系统盘有大约150*MB*的信心的话,您可以在安装时直接选择*快速安装*(Install Now) 若您对Python一知半解或者不怎么了解、并对自己的系统盘通常是C盘有大约150*兆字节*(MB)的信心的话,您可以在安装时直接选择*快速安装*(Install Now)
若您选择了*自定义安装*(Customize Installation),请务必勾选 `pip``py launcher` 便于后续安装依赖,如下图: 若您选择了*自定义安装*(Customize Installation),请务必勾选 `pip``py launcher` 便于后续安装依赖,如下图:
@ -29,17 +35,8 @@
<img src=https://foruda.gitee.com/images/1659972669907359295/cmd.png> <img src=https://foruda.gitee.com/images/1659972669907359295/cmd.png>
1. 下载本代码库以及演示程序
- 若您使用git请直接拷贝本仓库 1. 安装依赖
`git clone -b pkgver https://gitee.com/EillesWan/Musicreater.git`
- 若您不使用git可以在*码云*(Gitee)或GitHub下载zip包或者[加入QQ群聊861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr),在群文件中获取。
<img src=" https://foruda.gitee.com/images/1659972440341216712/下载.png" >
2. 安装依赖
请以管理员模式打开您的*终端*(命令行/PowerShell/Bash/etc) 请以管理员模式打开您的*终端*(命令行/PowerShell/Bash/etc)
@ -58,17 +55,30 @@
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png"> <img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
2. 下载本代码库以及演示程序
- 若您使用git请直接克隆本仓库
`git clone -b pkgver https://gitee.com/EillesWan/Musicreater.git`
- 若您不使用git可以在[*码云*(Gitee)](https://gitee.com/EillesWan/Musicreater.git)或[*GitHub*](https://github.com/EillesWan/Musicreater.git)下载zip包或者[加入QQ群聊861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr),在群文件中获取。
<img src=" https://foruda.gitee.com/images/1659972440341216712/下载.png" >
3. 开始使用 3. 开始使用
在目录下打开终端例如打开命令行请进入到目录下在地址框内输入cmd 在目录下打开终端,例如,打开命令行,请进入到目录下,在地址框内输入`cmd`
<img src=https://foruda.gitee.com/images/1659974437388532868/输入.png> <img src=https://foruda.gitee.com/images/1659974437388532868/输入.png>
<img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png> <img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png>
执行以下命令:(选择你需要的) 执行以下命令:(选择你需要的)
`python example_convert_bdx.py` `python demo_convert.py`
`python demo_convert_bdx_byDelay.py`
`python example_convert_mcpack.py`
### 补充错误说明 ### 补充错误说明
@ -80,7 +90,7 @@
请下载最新的VCREDIST安装包可以参照[这个网页](https://docs.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist)的说明,也可以在这直接选择你需要的安装包下载: 请下载最新的VCREDIST安装包可以参照[这个网页](https://docs.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist)的说明,也可以在这直接选择你需要的安装包下载:
> [下载64位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x64.exe) > [下载64位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x64.exe)
> [下载32位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x64.exe) > [下载32位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x86.exe)
感谢群友Mono帮我们发现这个问题 感谢群友Mono帮我们发现这个问题
@ -88,26 +98,26 @@
<img src=https://foruda.gitee.com/images/1659974810147043475/运行.png> <img src=https://foruda.gitee.com/images/1659974810147043475/运行.png>
- midi路径含有mid文件路径、文件名、后缀的完整文件路径。可以使用相对或绝对路径皆可 - midi路径含有mid文件路径、文件名、后缀的完整文件路径或者一个目录demo可接受批量转换。可以使用相对或绝对路径皆可
- 输出路径:输出文件夹的路径,不需要指示文件名 - 输出路径:输出文件夹的路径,不需要指示文件名
- 是否重置计分板1或0歌曲放完是否重置推荐1 - 是否重置计分板1或0歌曲放完是否重置推荐1
- 是否启用进度条1或0看个人需要 - *进度条是否启用进度条以及自定义进度条样式。输入0或False表示不启用进度条输入1或True表示使用默认进度条其余的输入均表示使用输入的格式作为自定义的进度条样式
*进度条是否启用进度条以及自定义进度条样式。输入0或False表示不启用进度条输入1或True表示使用默认进度条其余的输入均表示使用输入的格式作为自定义的进度条样式
- 计分板名称:游戏内的计分板名称 - 计分板名称:游戏内的计分板名称
- 音量0-1之间的小数含01正常来说推荐1 - 音量0-1之间的小数含01正常来说推荐1
- 变速float数据一般写1 - 速度倍率小数数据不可为0一般写1
- 玩家选择器:包括 `@x` 在内的全部选择器即若要选择全部标签为Holo的玩家则需要如此输入`@a[tag=Holo]` - 玩家选择器:包括 `@x` 在内的全部选择器,即若要选择全部标签为`Holo`的玩家,则需要如此输入:`@a[tag=Holo]`
- 没有报错且在输出路径下找到mcpack或bdx即为生成成功 - 没有报错且在输出路径下找到mcpack或bdx即为生成成功
<img src=https://foruda.gitee.com/images/1659973655881460036/输出.png>
# 对于 进度条自定义 功能的说明 # 对于 进度条自定义 功能的说明
@ -152,4 +162,3 @@
*对了!为了避免生成错误,请尽量避免使用标识符作为定义样式字符串的其他部分* *对了!为了避免生成错误,请尽量避免使用标识符作为定义样式字符串的其他部分*
<img src=https://foruda.gitee.com/images/1659973655881460036/输出.png>