修复部分bug,准备合并

This commit is contained in:
EillesWan 2023-02-01 18:48:30 +08:00
parent 6aa557dcd2
commit 53fda9c986
14 changed files with 186 additions and 1210 deletions

View File

@ -1,7 +1,5 @@
<h1 align="center">· Musicreater</h1>
<h2 align="center">库版 Package Version</h2>
<p align="center">
<img width="128" height="128" src="https://s1.ax1x.com/2022/05/06/Ouhghj.md.png" >
</p>
@ -21,24 +19,16 @@
## 介绍🚀
· Musicreater 是一款免费开源的 **我的世界基岩版** 音乐制作软件
· 库版 (Musicreater Package Version) 是一款免费开源的针对 **我的世界基岩版** 的midi音乐转换库
· 是一个免费开源的针对 **我的世界基岩版** 的midi音乐转换库
欢迎加群[861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)
**此分支为音·创的包版本即便于其他软件使用的可被import版本**
### **如果希望直接使用演示程序转换MIDI音乐[看这看这!看这看这!看这看这!](./docs/%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)**
## 软件作者✒
## 作者✒
金羿 Eilles我的世界基岩版指令师个人开发者B站不知名UP主江西在校高中生
诸葛亮与八卦阵 bgArray我的世界基岩版玩家喜欢编程和音乐深圳初二学生
## 致谢🙏
本致谢列表排名无顺序
@ -56,7 +46,7 @@
>
> 若您对我们有所贡献但您的名字没有显示在此列表中请联系我们
## 联系我们📞
## 联系📞
若遇到库中的问题欢迎在[](https://gitee.com/TriM-Organization/Musicreater/issues/new)提出你的issue

View File

@ -1,83 +0,0 @@
<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>
# Instructions for Using Demo(s)
*This is a tutorial for using the demo(s) of this library, not the Development Guide.*
*Developing Documentation is now not translated yet, you can see here for the [Chinese Orignal Version](%E5%BA%93%E7%9A%84%E7%94%9F%E6%88%90%E4%B8%8E%E5%8A%9F%E8%83%BD%E6%96%87%E6%A1%A3.md) if you understand Chinese*
## Instructions of Downloading and Starting using Demo
### [Windows OS](./download%26start_EN/Windows.md)
### [Linux OS](./download%26start_EN/Linux.md)
### [Android OS](./download%26start_EN/Android.md)
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.
A Progress Bar, of course, is composed of **changeless** parts and **changable** parts. And the changable parts include texts or *images*(these images are made up of texts, or we can say, character paintings 😁). That is, for *Minecraft*, a changable image in a progress bar is just the "bar" part(which is like a stripe).
We use a string to describe the style of progress bar you need, and it includes many **identifier**s to replace the changable parts.
There are the identifiers:
| Identifier | Changable Part |
|--------------|------------------------------------------------------|
| `%%N` | Music name(file name which is imported into program) |
| `%%s` | Value of scoreboard of now |
| `%^s` | Max value of scoreboard |
| `%%t` | Current playback time |
| `%^t` | Total music time |
| `%%%` | Current playback progress |
| `_` | To be replaced by the *Bar* part of the progress bar |
The `_` is a placeholder to identifying the *bar* part, yeah, just the changable image.
This is an example of **style description string**, and this is also the default style of *Musicreater*'s progress bar.
` %%N [ %%s/%^s %%% __________ %%t|%^t]`
This is a progress bar with only one line, but it is possible if you want to give a multiline parameter into the style description string.
But the string above is only for style identification, but we also need to identifying the changable image's image(just what the bar's look).
A "bar", simply, included 2 parts: *Have Been Played* & *Not Been Played*. So we use a tuple to pass the parameter. It's under a simple format: `(str: played, str: not)`. For example, the default parameter is below:
`('§e=§r', '§7=§r')`
So it's time to combine what I said in one parameter now!
This is a default definder parameter:
`('%%N [ %%s/%^s %%% __________ %%t|%^t]',('§e=§r', '§7=§r'))`
*Tip: To avoid errors, please not to use the identifiers as the other part of your style.*

View File

@ -1,166 +0,0 @@
## 使用前的准备工作
### 安装终端工具
这里我们选用 **Termux** 作为我们的终端工具来安装这是一个强大的终端模拟器旨在安卓环境下模拟Linux的软件包环境
1. 下载
下载可以通过 [GitHub源](https://github.com/termux/termux-app/releases) 或者 [F-Droid源](https://f-droid.org/en/packages/com.termux/) 个人建议选择 F-Droid 因为在国内可以访问得到 GitHub 源就看运气
2. 安装
下载*APK*包后直接安装安装后打开可以看到一个类似这样的界面
<img height="512" src="https://foruda.gitee.com/images/1665933025120627254/a0479618_9911226.jpeg">
3. 完成
恭喜你你已经获得了一个极客般流畅地操作你手机的终端工具
### 安装运行环境
1. 换源
接下来我们就要来准备安装一下 **Python** 运行环境了这是运行 **Python** 源代码必要的
首先我估计你等不了多久急得要死所以我们要让下载速度稍微快一点先来换个源 **Termux** 输入以下指令
```bash
echo "deb https://mirror.mwt.me/termux/main stable main" > /data/data/com.termux/files/usr/etc/apt/sources.list
```
*感谢 天如<QQ 3291691454>为我们带来的简单换源方法*
- *非必要步骤*手动编辑换源
如果你闲着没事非要要手动编辑个文档来换源那用啥用普通的编辑器肯定可以于是我们就让他更普通一点**nano**
**Termux** 输入以下指令
```bash
export EDITOR=nano
apt edit-sources
```
那么请把看到的如左下图的界面变为右下图吧
<table><tr>
<td><img src="https://foruda.gitee.com/images/1665933104313107707/41108f03_9911226.jpeg"> </td>
<td><img src="https://foruda.gitee.com/images/1665933122534781330/3887a901_9911226.jpeg"></td>
</tr></table>
- 图片中的文件最后应该加入的两行为
```bash
deb https://mirrors.ustc.edu.cn/termux/apt/termux-main/ stable main
deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main/ stable main
```
然后键入 `Ctrl`+`S`再键入 `Ctrl`+`X`退出`nano`
在换源之后你可能会见到类似的提示
```bash
Your '/data/data/com.termux/files/usr/etc/apt/sources.list' file changed. Please run 'apt-get update'.
```
那就遵循它的指引输入
```bash
apt-get update
```
Alright.
2. 安装 **Python**
```bash
apt-get install python3
```
如果遇到提示问是否继续那就输入`Y`表示是如左下图安装成功后图若右下
<table><tr>
<td><img src="https://foruda.gitee.com/images/1665933181440420034/7f0fb5fd_9911226.jpeg"></td>
<td><img src="https://foruda.gitee.com/images/1665933238339972260/a9f06f4f_9911226.jpeg"></td>
</tr></table>
接下来我们来试一试 **Python** 是不是安装成了吧输入
```bash
python3 -V
```
如果输出了形如 `Python 3.X.X` 的提示则完成
3. 安装依赖库
```bash
# 首先换源
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
# 然后安装
pip install mido
pip install brotli
```
- 如果出现以下情况真是死了鬼的我们要来再搞个设置
<img height="512" src="https://foruda.gitee.com/images/1665933289612919459/b87b7804_9911226.jpeg">
我们来修改收信任的源设置
```bash
pip config set global.trusted-host mirrors.aliyun.com/
```
之后再来安装即可
```bash
pip install mido
pip install brotli
```
安装成功后您可能会见到类似下图的提示
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
### 安装下载工具
既然已经有了运行环境那么我们就需要下载下我们的**·创库版示例代码**工具我非常推崇**Git**这种方便快捷好用还能下载仓库的代码管理器这个世界上你也找不到第二个所以我们来安装一下
```bash
pkg install git
```
安装完成后记得测试一下
<img height="512" src="https://foruda.gitee.com/images/1665933331269483373/9374c85d_9911226.jpeg">
## 本代码库的下载与演示程序的使用
1. 使用Git下载本库及其示例代码
```bash
git clone -b pkgver https://gitee.com/EillesWan/Musicreater.git MSCTpkgver
```
当上述命令执行成功你会在执行此命令的所在位置发现一个名为 `MSCTpkgver` 的文件夹其中包含的正是我们心心念念下载的本程序和示例代码
而我们要运行的也正是示例代码因此赶快进入下载到的文件夹
```bash
cd MSCTpkgver
```
1. 开始使用演示程序
依照你的需要执行以下命令以运行库的演示程序
```bash
python magicDemo.py
```
运行成功了哦耶
<img height="512" src="https://foruda.gitee.com/images/1665933366784631363/db9f80f6_9911226.jpeg">

View File

@ -1,103 +0,0 @@
## 运行环境安装
### 检验Python运行环境
0. 一般的Linux发行版都有安装Python环境我们只需要保证其版本即可理论上 Python3.6 都可以运行我们的库
我们可以使用
```bash
python -V
```
来查看 Python 版本如下
<img src=https://foruda.gitee.com/images/1665120915821957090/429561fd_9911226.png>
1. *非必要环节*回退版本
如果你跟作者一样觉得 Python 3.10+ 太难用很烦人的话那真是皆大欢喜让我们一起来回退版本吧
- pacman 包管理器多用于Arch Linux上
1. 让我们先来把 python3 加入忽略升级的列表中使用`vim`修改`/etc/pacman.conf``IgnorePkg`后加上`python3`
```bash
sudo vim /etc/pacman.conf
```
<img src=https://foruda.gitee.com/images/1665124611490335193/5e99ca26_9911226.png>
2. 然后我们开始从[Arch Achieve](https://archive.archlinux.org/packages/)上找Python的版本列表*这里说明一下在Arch中Python默认指的是Python3而与其他某些Linux发行版中Python默认指代Python2不同所以在Arch Achieve中也是如此*我这里找到的是[Python3.8.6](https://archive.archlinux.org/packages/p/python/python-3.8.6-1-x86_64.pkg.tar.zst)于是我们用`pacman`把她下载下来并安装
```bash
sudo pacman -U https://archive.archlinux.org/packages/p/python/python-3.8.6-1-x86_64.pkg.tar.zst
```
<img src=https://foruda.gitee.com/images/1665126362769399903/ea4b9598_9911226.png>
3. 完美
- 其他包管理器
暂无
### 检查并安装pip包管理器依赖
1. 我们在安装依赖库之前应该确认一下Python自带的包管理器pip是否安装到位
```bash
python -m pip # 确认pip是否安装
# 当这个命令输入后有长段提示出现则为已经安装
# 如果返回如下那么则pip尚未安装
/usr/bin/python: No module named pip
# 可以使用如下命令来安装pip
sudo pacman -S python-pip
# 安装完成后记得验证
python -m pip
# 如果还是失败那么就需要用其他工具安装pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
# 安装完成后一定要验证!!!
python -m pip
```
2. 确认完成之后我们来安装一下依赖库
```bash
pip install mido -i https://mirrors.aliyun.com/pypi/simple/
pip install brotli -i https://mirrors.aliyun.com/pypi/simple/
```
3. 安装成功后可能会见到类似下图的提示
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
## 本代码库的下载与使用
1. 使用Git下载本库及其示例代码
```bash
git clone -b pkgver https://gitee.com/EillesWan/Musicreater.git MSCTpkgver
```
当上述命令执行成功你会在执行此命令的所在位置发现一个名为 `MSCTpkgver` 的文件夹其中包含的正是我们心心念念下载的本程序和示例代码
而我们要运行的也正是示例代码因此赶快进入下载到的文件夹
```bash
cd MSCTpkgver
```
1. 开始使用
在目录下打开终端执行以下命令以运行演示程序
```bash
python magicDemo.py
```

View File

@ -1,90 +0,0 @@
## 一、运行环境安装
### (一)安装 Python3.6+
1. 首先需要下载Python的安装包最好是 *Python3.8*因为作者就用的是这个版本
> [下载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)
2. 在安装时最好需要勾选 `Add Python 3.X to PATH`如下图所示当然如果您对自己非常自信您也可以手动设置此项目
<img src=https://foruda.gitee.com/images/1662736520757331846/e38efb81_9911226.png>
- 若您对Python一知半解或者不怎么了解并对自己的系统盘通常是C盘有大约150*兆字节*(MB)的信心的话您可以在安装时直接选择*快速安装*(Install Now)
3. 若您选择了*自定义安装*(Customize Installation)请务必勾选 `pip` `py launcher` 便于后续安装依赖如下图
<img src=https://foruda.gitee.com/images/1662736621235871190/2ac3d98f_9911226.png>
4. 安装结束之后可以在*终端*(命令行/PowerShell/Bash/etc)中输入`python` 试试是否安装成功成功安装之后在终端中输入python会显示诸如如下图片的提示
<img src=https://foruda.gitee.com/images/1659972669907359295/cmd.png>
### (二)安装依赖
1. 请以管理员模式打开您的*终端*(命令行/PowerShell/Bash/etc)
例如命令行可以如此打开*视窗开始菜单*(Windows开始)中搜索 `cmd`, 并以管理员身份运行
<img src="https://foruda.gitee.com/images/1662736878650993886/62487dd8_9911226.png">
2. 打开了终端之后请在终端中输入以下指令
```bash
pip install mido -i https://mirrors.aliyun.com/pypi/simple/
pip install brotli -i https://mirrors.aliyun.com/pypi/simple/
```
3. 安装成功后您可能会见到类似下图的提示
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
## 二、本工具的下载与使用
0. 下载本代码库以及演示程序
- 若您使用git请直接克隆本仓库
```bash
git clone -b pkgver https://gitee.com/TriM-Organization/Musicreater.git
```
- 若您不使用git可以在[*码云*(Gitee)](https://gitee.com/TriM-Organization/Musicreater.git)[*GitHub*](https://github.com/TriM-Organization/Musicreater.git)下载zip包或者[加入QQ群聊861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)在群文件中获取
<img src="https://foruda.gitee.com/images/1669540786443169766/fabf0acd_9911226.png">
值得注意的是这张图上有12两个数字虽然是手写的但确实是数字表示着要进行的步骤希望眼尖得能找出我的口头禅的你们能够发现这两个用鼠标手写的数字并在安装时认真地执行我认为这并不算十分的难移动鼠标并单击大约消耗不了多少卡路里不过我没有进行精确的计算我也不是十分的清楚这个活动对于一个常人来讲有多难但我怀疑它不难
1. 开始使用
您可以直接双击 `magicDemo.py` 以运行演示程序或者按照以下步骤使用终端应用运行
在目录下打开终端
例如打开命令行请进入到目录下在文件资源管理器的地址框内输入`cmd`
<img src=https://foruda.gitee.com/images/1659974437388532868/输入.png>
<img src=https://foruda.gitee.com/images/1659974754378201859/输入c.png>
使用以下指令
```bash
python ./magicDemo.py
```
## 三、安装时错误的补充说明
1. Microsoft Visual C++ Redistributable 环境出错
如果你遇到了类似以下这种情况
<img src=https://foruda.gitee.com/images/1659972789779764953/bug.jpeg>
请下载最新的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)
> [下载32位VCREDIST安装包](https://aka.ms/vs/17/release/vc_redist.x86.exe)
感谢群友*Mono*帮我们发现这个问题

View File

@ -1,97 +0,0 @@
## Before we Use
### Installing Terminal APP
We choose **Termux** as the Terminal APP as it is the powerful Linux simulator.
1. Dowloading
From both [GitHub](https://github.com/termux/termux-app/releases) or [F-Droid](https://f-droid.org/en/packages/com.termux/) to download is OK.
2. Installing
*APK* file is easy to install and you must know it without my instruments, you can see something like below after opening this app.
<img height="512" src="https://foruda.gitee.com/images/1665933025120627254/a0479618_9911226.jpeg">
3. Finish
OK, congratulations for ok installing *Termux*.
### Installing Runtime Environment
1. Installing **Python**
```bash
apt-get install python3
```
The picture left below is while you may enter `Y` to continue.
Aftering succeed in installing you will see as right bicture below.
<table><tr>
<td><img src="https://foruda.gitee.com/images/1665933181440420034/7f0fb5fd_9911226.jpeg"></td>
<td><img src="https://foruda.gitee.com/images/1665933238339972260/a9f06f4f_9911226.jpeg"></td>
</tr></table>
OK, let try whether success installing **Python** via
```bash
python3 -V
```
Sth. like `Python 3.X.X` will occur if so.
3. Installing dependences
```bash
pip install mido
pip install brotli
```
Sth. like below will occur if successful.
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
### Install Downloading Tool
Tired to translate, QwQ.....
Sleep for a while and this can be a TO-DO.
既然已经有了运行环境那么我们就需要下载下我们的**·创库版示例代码**工具我非常推崇**Git**这种方便快捷好用还能下载仓库的代码管理器这个世界上你也找不到第二个所以我们来安装一下
```bash
pkg install git
```
安装完成后记得测试一下
<img height="512" src="https://foruda.gitee.com/images/1665933331269483373/9374c85d_9911226.jpeg">
## 本代码库的下载与演示程序的使用
1. 使用Git下载本库及其示例代码
```bash
git clone -b pkgver https://gitee.com/EillesWan/Musicreater.git MSCTpkgver
```
当上述命令执行成功你会在执行此命令的所在位置发现一个名为 `MSCTpkgver` 的文件夹其中包含的正是我们心心念念下载的本程序和示例代码
而我们要运行的也正是示例代码因此赶快进入下载到的文件夹
```bash
cd MSCTpkgver
```
1. 开始使用演示程序
依照你的需要执行以下命令以运行库的演示程序
```bash
python magicDemo.py
```
运行成功了哦耶
<img height="512" src="https://foruda.gitee.com/images/1665933366784631363/db9f80f6_9911226.jpeg">

View File

@ -1,102 +0,0 @@
## Install Runtime Environment
### Install and Verify Python Runtime
0. Common Linux Distributions do include a Python Runtime Environment, what we should do is only to check whether it is a satisfied version to our program. If the version Python3.6, theoretically our program can be run.
We can type:
```bash
python -V
```
To check the Python version, as the follows
<img src=https://foruda.gitee.com/images/1665120915821957090/429561fd_9911226.png>
1. **Not Necessary**
If you want to change a Python version just as what I want to do, it is such a great fantastic action! Let do as the follows:
- pacman Package ManagerIn Arch Linux Mostly
1. Let's write python3 into the ingore list of updating. Via `vim` to edit `/etc/pacman.conf`, add `python3` after `IgnorePkg`.
```bash
sudo vim /etc/pacman.conf
```
<img src=https://foruda.gitee.com/images/1665124611490335193/5e99ca26_9911226.png>
2. Then we can search for python releases in [Arch Achieve](https://archive.archlinux.org/packages/).*HERE, under Arch, Python refers to Python3 defaultly, while some other Linux releases using Python2 as default. So dose Arch Achieve.*What I find here is [Python3.8.6](https://archive.archlinux.org/packages/p/python/python-3.8.6-1-x86_64.pkg.tar.zst), so let's download she via `pacman`:
```bash
sudo pacman -U https://archive.archlinux.org/packages/p/python/python-3.8.6-1-x86_64.pkg.tar.zst
```
<img src=https://foruda.gitee.com/images/1665126362769399903/ea4b9598_9911226.png>
3. Perfect!
- Other Package Manager
None yet.
### Install and Verify pip Package Manager
1. Before installing, it is to be checked, wheather Python's pip is OK:
```bash
python -m pip # To check is pip installed
# If a long tip occured, it is OK
# If returned as this, then not.
/usr/bin/python: No module named pip
# We can install pip via:
sudo pacman -S python-pip
# Verfy, remember.
python -m pip
# If you did but failed, we should use other methods to install pip:
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
# Verfy, must.
python -m pip
```
2. After checking, let's install the dependences.
```bash
pip install mido -i
pip install brotli -i
```
3. See the tips below as successfully installed
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
## Download this lib's sources code and Using its demos.
1. Download via Git
```bash
git clone -b pkgver https://github.com/TriM-Organization/Musicreater.git MSCTpkgver
```
If succeed, a directory named `MSCTpkgver` well be found in the path you run this command, and inside it is the source code and demo(s) we wantted to download.
What we want to use is the demo(s) so enter the folder via:
```bash
cd MSCTpkgver
```
1. Starting Using Demo(s)
Via
```bash
python magicDemo.py
```

View File

@ -1,92 +0,0 @@
## Install Runtime Environment
### Install Python 3.6+
1. 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)
2. While installing, it's best 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*.
3. However, if you want to do it like a pro, choosing *Customize Installation*, it's 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>
4. 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>
### Installing Requirements
1. 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">
2. Okay, after that, please enter in your Terminal:
```bash
pip install mido
pip install brotli
```
3. If successful you will see something like below:
<img src="https://foruda.gitee.com/images/1662737676719454287/f61a70f7_9911226.png">
## Downloading & Using of this tool
1. Download This Package and Demo(s)
- If you use Git, you can clone this lib via the following commands:
```bash
git clone -b pkgver https://github.com/TriM-Organization/Musicreater.git
```
- If Git is not installed, you can download the zip package from the code page(from [GitHub](https://github.com/TriM-Organization/Musicreater.git) or [Gitee](https://gitee.com/TriM-Organization/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/1669540786443169766/fabf0acd_9911226.png">
But it should be noticed that you're clear instructed to choose the branch "pkgver" first instead of downloading it directly from the "master" branch, the master branch is now under developing and has no practical use.
2. Start Using Demo(s)
You can directly double click `magicDemo.py` to run the demo, or follow instructions below using Terminal APP to run it.
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 the commands below:
```bash
python ./magicDemo.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)
or follow [this page](https://learn.microsoft.com/en-gb/cpp/windows/latest-supported-vc-redist)'s instructions.
Thanks to our groupmate *Mono* for helping us finding this problem.

View File

@ -1,74 +0,0 @@
<h1 align="center">· Musicreater</h1>
<h2 align="center">库版 Package Version</h2>
<p align="center">
<img width="128" height="128" src="https://s1.ax1x.com/2022/05/06/Ouhghj.md.png" >
</p>
# 演示程序使用教程
*由于先前的 **读我文件**(README.md) 过于冗杂现另辟蹊径来给大家全方位的教程*
*这是演示程序demo的使用教程将在这里提供演示程序的相应的使用教程*
## 下载与启动教程
### [视窗(Windows)操作系统](./download%26start/Windows.md)
### [里纽克斯(Linux)与其衍生操作系统](./download%26start/Linux.md)
### [安卓(Android)与其衍生操作系统](./download%26start/Android.md)
## 演示程序使用教程
1. 参数说明
<img src=https://foruda.gitee.com/images/1674146209644269990/26b53aa7_9911226.png>
- midi路径含有mid文件路径文件名后缀的完整文件路径或者一个目录magicDemo可接受批量转换可以使用相对或绝对路径皆可
- 输出路径输出文件夹的路径不需要指示文件名
- 转换算法新算法编号为2旧算法编号为1新算法在某些方面转换效果更好但是如果新算法转换有误的话请使用旧算法
- 输出格式目前的演示程序仅支持`BDX`结构和`MCPACK`
- 播放方式目前的转换库仅支持**计分板****延迟**的两种播放方式具体地关于这些播放方式如何使用的问题详见[生成文件的使用说明](./%E7%94%9F%E6%88%90%E6%96%87%E4%BB%B6%E7%9A%84%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)
- 音量小数数据在0~1包含首尾的范围之内用以表示播放音量大小
- 速度倍率小数数据其值不可为0用以表示游戏中播放此音乐的速度倍数
- 进度条是否启用进度条目前的转换库已经支持自定义进度条但是当前的演示程序并不能做到这一点具体的有关进度条自定义的内容可以看[功能文档](./%E5%BA%93%E7%9A%84%E7%94%9F%E6%88%90%E4%B8%8E%E5%8A%9F%E8%83%BD%E6%96%87%E6%A1%A3.md#%E8%BF%9B%E5%BA%A6%E6%9D%A1%E8%87%AA%E5%AE%9A%E4%B9%89)中的相关部分自行修改参数。
- 计分板名称仅计分板播放器游戏内的计分板名称
- 是否重置计分板仅计分板播放器歌曲放完是否重置推荐选择自动重置
- 玩家选择器仅延迟播放器包括 `@x` 在内的全部选择器若要选择全部标签为`Holo`的玩家则需要如此输入`@a[tag=Holo]`
- 作者仅BDX结构音乐结构的生成作者
- 指令结构最大高度仅结构输出生成音乐结构的最大堆叠高度可以查看相关[结构部分的开发文档](./%E5%BA%93%E7%9A%84%E7%94%9F%E6%88%90%E4%B8%8E%E5%8A%9F%E8%83%BD%E6%96%87%E6%A1%A3.md#%E7%94%9F%E6%88%90%E6%96%87%E4%BB%B6%E7%BB%93%E6%9E%84##%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F)了解详细知识。
- 没有报错且在输出路径下找到对应的文件即为生成成功
<img src=https://foruda.gitee.com/images/1659973655881460036/输出.png>
# 其他说明
## 对于 延迟播放器 的说明
问1什么是延迟播放器
答1播放音乐不同的音符之间存在间隔可以用不同的方式实现音符间空白的时间其一是计分板通过给计分板加分对应分数播放对应的音符就可以间隔到还有就是命令方块自带的延迟这样也可以实现音符间空白延迟播放器即后者但是因为只能对命令方块写入这样的延迟数据所以仅可以使用包含NBT的结构导出或者直接输出至世界
问2可不可以不要积分板
答2详见问1切换你所需要的播放器即可
## 查看开发文档
目前仅仅提供了部分文档不过相关函数的参数都是很清晰的应该不难理解
文档中介绍了关于生成结构和自定义进度条功能的内容详见[此处](./%E5%BA%93%E7%9A%84%E7%94%9F%E6%88%90%E4%B8%8E%E5%8A%9F%E8%83%BD%E6%96%87%E6%A1%A3.md)

View File

@ -1,189 +0,0 @@
<h1 align="center">· Musicreater</h1>
<h2 align="center">库版 Package Version</h2>
<p align="center">
<img width="128" height="128" src="https://s1.ax1x.com/2022/05/06/Ouhghj.md.png" >
</p>
# 新手答疑指南
**考虑到某些用户电脑技术不是特别先进且对这个项目充满了好奇心但是又了解的不是很充分为此我特别在这里写一份新手指南以满足各位的好奇心放心本文件全程中文**
## 第一部分 关于音·创的作用
### 1.1 音·创简介
· Musicreater 是一款免费开源的 **我的世界基岩版** 音乐制作软件
· 库版 (Musicreater Package Version) 是一款免费开源的针对 **我的世界基岩版** 的midi音乐转换库
而能够与人交互以达到转换功能的 · 库版 的演示程序因此各位所使用来转换音乐的工具实际上仅仅是一个功能的演示
·创库版 的演示程序目前已经具备较为完善的[**教程**](./%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)其中包括了下载安装一类使你能够方便地进行转换
· 以及其库版本都是免费开源的采用**带有特殊条款的Apache2.0**开源协议授权详情请见[协议](../LICENSE.md)
另外的·创的库版本并不是音·创的正式版本其功能也并非是音·创本体所提供的主要功能**·创的开发其目的是为了方便我的世界基岩版的音乐作者进行我的世界相关音乐的开发与创作**而并不是转换MIDI文件·创库板的实现是在音·创主版本之前试行一定的技术探索以更好地开发音·
### 1.2 音·创库版本到底目前有什么功能?
* - [x] 支持导入`.mid`文件
* - [x] 支持写入`.mcpack`文件
* - [x] 支持写入`.bdx`文件
* 不支持导入.mp3 .mp4 .wav等音频流文件
## 第二部分 关于格式的问题
### 2.1 关于.mid格式
其实对于经常玩音乐电子制作的朋友们来说`MIDI`格式并不陌生这里我简单介绍一下
**MIDI文件的本质是电子乐谱而不是记录声音波形文件的.mp3/.wav/.m4a等等文件**
因此我们将MIDI转换到我的世界播放器的过程实际上就是把一类乐谱变为另一类乐谱的过程而真正的演奏是在游戏内实现的
> mid格式是由MIDI继承而来MID文件并不是一段录制好的声音而是记录声音的信息然后再告诉声卡如何再现音乐的一组指令
> 这样一个MIDI文件每存1分钟的音乐只用大约510KB今天MID文件主要用于原始乐器作品流行歌曲的业余表演游戏音轨以及电子贺卡等
>
> 百度百科
>
> MIDI 音乐保存在电脑上就是 *.mid 类型的文件和一般意义上的音乐不同mid 类型的音乐通常并不是可直接发行供大众欣赏的音乐
> 它更像是一种音乐创作者使用的工程文件它没有歌词不含有人类语言如果说五线谱是给人类阅读的乐谱
> MIDI音乐文件便是给计算机或其他电子设备使用的乐谱对于音乐这个世界来说它微不足道却又是现代数字音乐的基石虽不为大众所知
> 但在 MIDI 音乐爱好者眼中它却是非常有意思的东西有了 MIDI 音乐技术和一台电脑基本就等于拥有了一个乐队加上相关的音乐知识
> 就可以自己指挥这个乐队创作音乐作品了
> 同时MIDI 技术由于数据结构简单又与音乐有关也成为了部分技术极客的爱好有人使用MIDI技术+Arduino开源硬件制作了架子鼓
> 有人通过分析大量MIDI乐曲结构设计了人工智能作曲软件还有更酷的人使用MIDI音乐制作了随节奏变幻的特斯拉线圈
> 在MIDI 音乐的世界里汇聚了一批喜欢音乐又热爱技术的人我们有理由相信玩MIDI音乐的你定是多才多艺的
>
> midishow.com
### 2.2 关于.mid格式的获取
通过刚刚的介绍你可能已经发现`.MID`文件因为受众并不多而并没有被广泛熟知因而你之前可能完全没见过这个文件更何况要弄一首自己心仪的歌了
这里介绍几个获取.mid格式的方法
0. 最简单的方法是向你心仪的作编曲人投递一份申请请求TA将其作编曲过程中的相关工程文件给你这样你就可以获得一首乐曲的电子曲谱从而获得其MIDI文件
1. 如果无法向作曲人申请相关文件的话成为一个作编曲人也许是一个不错的选择当然很多人做不到这一点但是有必要提到这一点当你在下面的渠道中都无法获得想要的文件时你应该考虑是不是需要自己创作内容或者请别人帮你创作内容
2. 当你没有这样的文件时问问别人或者从群里下载公开的文件也是个思路不过这个办法通常使用次数有限且能找到的文件不多不过值得注意的是**[·创开发交流群](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)的群文件中所含的MIDI文件均为网友分享学习交流使用请在下载后一个小时内删除**
3. 自己找MIDI现在我将给你提供一个完整的找mid的方法请认真学习
**1.** 首先你需要在[MidiShow](www.midishow.com)网站中注册一个账号并不复杂你可能只需要一个QQ号便可以授权登录
**2.** 登录你的账号主界面应该如下图所示
<img src="https://foruda.gitee.com/images/1672644995747340749/36c9c143_10062986.png">
**3.** 在显眼的搜索框中输入你想要的歌曲名称接下来的教程我以`夜空中最亮的星`这首歌及它的mid来演示下载流程点击搜索框完成这一步
<img src="https://foruda.gitee.com/images/1672645340943813483/44d0db69_10062986.png">
**4.** 接下来看到搜索结果如下你可以点进去一个听听决定你是否要下载也有可能你什么都没搜到那你就得换首歌或者换个途径了
<img src="https://foruda.gitee.com/images/1672645574402099694/6b7e18e5_10062986.png">
**5.** 点击播放按钮试听网站上的效果可能一般但是会听音乐的人应该很快就能决定你是否需要下载这个音乐如果需要下载你可以进行到下一步
如果不行那你可以退回刚刚的页面换一个
<img src="https://foruda.gitee.com/images/1672645752246438160/47cead78_10062986.png">
**6.** 翻到最下面如图你可以对这首歌进行打分打分可以使积分+1如果你喜欢这首乐曲的话建议打5分你可以对这首歌进行评论一次有意义的评论可以+3而下载一首歌需要-3积分如果你先完成了这两项操作再下载那你还会再赚1积分所以推荐这样做
<img src="https://foruda.gitee.com/images/1672646433045265565/26ea29b2_10062986.png">
**完成后会像这样**
<img src="https://foruda.gitee.com/images/1672646242419857480/5e8809b8_10062986.png">
**7.** 接下来下载往上翻网页找到这个标识然后单击
<img src="https://foruda.gitee.com/images/1672646275215822535/63b402db_10062986.png">
**8.** 确认完毕后点击下载
<img src="https://foruda.gitee.com/images/1672646309787744490/f459adac_10062986.png">
**9.** 完成下载如图
<img src="https://foruda.gitee.com/images/1672646335942429563/2449ed0b_10062986.png">
4. 使用音频波形转换MIDI的工具也是一个选择不得不说科技的进步带来了许多便利让这样困难的事情也变得简单如果上述方法仍然没有解决你的问题那么你可以在下一章节中找到有关这个途径的说明
### 2.3 波形格式转换为.mid格式
**注意使用这个技术有一定难度酌情使用**
文件转换此技术是将记录声音波形文件的.mp3/.wav/.m4a等等文件转换为.mid数字乐谱文件的
概述波形转mid需要把**模拟的波形频谱信号转为数字乐谱信号**这个过程**一定有损失**而且损失非常大
请各位以后不要在答疑群中问类似于我这个转换效果为什么不好这样的问题谢谢
如果直接用**widi**的话相当于对声音进行了[**傅里叶变换**](https://baike.baidu.com/item/%E5%82%85%E9%87%8C%E5%8F%B6%E5%8F%98%E6%8D%A2/7119029)你确实可以分离出其中的音高但是效果在不同情况下差异较大尤其是有架子鼓啊啥的玩也的时候比较****
[widi工具链接](https://pan.baidu.com/s/1j_Jui0piQ6rMOXM0GJtqTg) 提取码b0lw
如果**只有钢琴**的谱子需要分离有一个完美的选择[Giant MIDI-Piano](https://zhuanlan.zhihu.com/p/270999354)
如果不然有其他的乐器也需要分离那么可能就有点困难**cakewalk**就确实也可以把音频变成mid但是可能要
**先把原MP3分离成人声音轨贝斯音轨等再傅里叶变换**
当然我也可能了解的不全没准现在已经有船新的技术可以分离的更好了那就太棒了('')
另外我们开发者也象征性的找了一些相关的网站我们没使用过不担保效果
[serocs.cn](https://www.serocs.cn/transcription/)
同时midishow论坛里有一些大佬也提供了解决方案看看他们的发言也是一个不错的选择我就只给个论坛链接了经常有人问这种问题你可以去那里随便找到一篇帖子看看[MidiShow论坛](https://www.midishow.com/question)
### 2.4 输出格式的问题
在前面说到输出主要有`.mcpack``.bdx`文件的输出接下来我会围绕这两个文件进行简单的说明
#### 2.4.1 .mcpack是什么
输出.mcpack文件其实对于一个**资深我的世界基岩版玩家**应该并不陌生
`.mcpack`文件其实就是我的世界基岩版的附加包文件里面一般分为行为包和材质包
我们生成的命令组属于**行为包** (下图就是一个例子)
<img src="https://foruda.gitee.com/images/1672647779755793187/884abaa9_10062986.png">
如果你是使用桌面平台游玩基岩版像我一样是可以直接打开这个文件并将这个包导入我的世界的当然移动平台也很简单在游戏资源包界面有导入本地资源包的选项便可将其导入
资源包导入世界之后的使用方法我们也制作了[**简单的教程**](./%E7%94%9F%E6%88%90%E6%96%87%E4%BB%B6%E7%9A%84%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)如果你对使用导入后的文件有所疑问可以看看
#### 2.4.2 .bdx是什么
.bdx 文件其实是一个新型结构文件利用一些标识符对结构进行标记可以使用相关软件导入到我的世界中国版
由于这不属于官方文件且我并不是很熟悉这个结构所以请对这个格式有问题的好兄弟加一下[QQ群](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)问问群里有导入经验的大佬
## 第三部分 关于其他问题
如果你在仔细阅读以上内容之后仍然感觉有所困惑可以加我们的[QQ群](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)来提问但是请注意**由于开发者们都很忙群友们的耐心也都有限所以恳请大家提出有意义的问题**
如果您在使用过程中遇到报错希望你能够把完整的报错内容复制给我们而不是截一半的屏幕或者在群内大呼小叫以下两张图给了你很好的解释说明
<table><tr><td><img src=https://foruda.gitee.com/images/1673053210913625261/37197693_9911226.png></td><td><img src=https://foruda.gitee.com/images/1673052430511255221/6a279fae_9911226.png></td></tr></table>
这里附一个关于[智慧地提问](https://github.com/tvvocold/How-To-Ask-Questions-The-Smart-Way)的文章大家可以看看
希望不要我把这个文件在聊天中甩给你那说明我可能已经没有耐心了
看完这份说明如果你打算开始使用我们的工具的话请移步至[演示程序使用教程](./%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)
## 第三部分 结尾
### 作者\<*金羿*\>(Eilles)联系方式
1. QQ 2647547478
2. 电邮 EillesWan2006@163.com W-YI_DoctorYI@outlook.com EillesWan@outlook.com
3. Telegram [@EillesWan](https://t.me/EillesWan)
### 作者\<*诸葛亮与八卦阵*\>(bgArray)联系方式
1. QQ 4740437765
-------------------------
**欢迎加群[861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)**
**欢迎加群[861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)**
**欢迎加群[861684859](https://jq.qq.com/?_wv=1027&k=hpeRxrYr)**
**如果遇到问题仔细地再次[阅读教程](./%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)很重要**
**如果遇到问题仔细地再次[阅读教程](./%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)很重要**
**如果遇到问题仔细地再次[阅读教程](./%E5%8A%9F%E8%83%BD%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)很重要**
重要的事情说三遍
**(有能力的同志麻烦给仓库star一下)**
**(有能力的同志麻烦给仓库star一下)**
**(有能力的同志麻烦给仓库star一下)**

View File

@ -142,7 +142,7 @@ else:
"[#121110 on #F0F2F4]{}".format(
random.choice(
requests.get(
"https://gitee.com/EillesWan/Musicreater/raw/master/resources/myWords.txt"
"https://gitee.com/TriM-Organization/LinglunStudio/raw/master/resources/myWords.txt"
)
.text.strip("\r\n")
.split("\r\n")

View File

@ -1,179 +1,179 @@
with_pitch = {
0: ("note.harp", 6),
1: ("note.harp", 6),
2: ("note.pling", 6),
3: ("note.harp", 6),
4: ("note.pling", 6),
5: ("note.pling", 6),
6: ("note.harp", 6),
7: ("note.harp", 6),
8: ("note.share", 7), # 打击乐器无音域
9: ("note.harp", 6),
10: ("note.didgeridoo", 8),
11: ("note.harp", 6),
12: ("note.xylophone", 4),
13: ("note.chime", 4),
14: ("note.harp", 6),
15: ("note.harp", 6),
16: ("note.bass", 8),
17: ("note.harp", 6),
18: ("note.harp", 6),
19: ("note.harp", 6),
20: ("note.harp", 6),
21: ("note.harp", 6),
22: ("note.harp", 6),
23: ("note.guitar", 7),
24: ("note.guitar", 7),
25: ("note.guitar", 7),
26: ("note.guitar", 7),
27: ("note.guitar", 7),
28: ("note.guitar", 7),
29: ("note.guitar", 7),
30: ("note.guitar", 7),
31: ("note.bass", 8),
32: ("note.bass", 8),
33: ("note.bass", 8),
34: ("note.bass", 8),
35: ("note.bass", 8),
36: ("note.bass", 8),
37: ("note.bass", 8),
38: ("note.bass", 8),
39: ("note.bass", 8),
40: ("note.harp", 6),
41: ("note.harp", 6),
42: ("note.harp", 6),
43: ("note.harp", 6),
44: ("note.iron_xylophone", 6),
45: ("note.guitar", 7),
46: ("note.harp", 6),
47: ("note.harp", 6),
48: ("note.guitar", 7),
49: ("note.guitar", 7),
50: ("note.bit", 6),
51: ("note.bit", 6),
52: ("note.harp", 6),
53: ("note.harp", 6),
54: ("note.bit", 6),
55: ("note.flute", 5),
56: ("note.flute", 5),
57: ("note.flute", 5),
58: ("note.flute", 5),
59: ("note.flute", 5),
60: ("note.flute", 5),
61: ("note.flute", 5),
62: ("note.flute", 5),
63: ("note.flute", 5),
64: ("note.bit", 6),
65: ("note.bit", 6),
66: ("note.bit", 6),
67: ("note.bit", 6),
68: ("note.flute", 5),
69: ("note.harp", 6),
70: ("note.harp", 6),
71: ("note.flute", 5),
72: ("note.flute", 5),
73: ("note.flute", 5),
74: ("note.harp", 6),
75: ("note.flute", 5),
76: ("note.harp", 6),
77: ("note.harp", 6),
78: ("note.harp", 6),
79: ("note.harp", 6),
80: ("note.bit", 6),
81: ("note.bit", 6),
82: ("note.bit", 6),
83: ("note.bit", 6),
84: ("note.bit", 6),
85: ("note.bit", 6),
86: ("note.bit", 6),
87: ("note.bit", 6),
88: ("note.bit", 6),
89: ("note.bit", 6),
90: ("note.bit", 6),
91: ("note.bit", 6),
92: ("note.bit", 6),
93: ("note.bit", 6),
94: ("note.bit", 6),
95: ("note.bit", 6),
96: ("note.bit", 6),
97: ("note.bit", 6),
98: ("note.bit", 6),
99: ("note.bit", 6),
100: ("note.bit", 6),
101: ("note.bit", 6),
102: ("note.bit", 6),
103: ("note.bit", 6),
104: ("note.harp", 6),
105: ("note.banjo", 6),
106: ("note.harp", 6),
107: ("note.harp", 6),
108: ("note.harp", 6),
109: ("note.harp", 6),
110: ("note.harp", 6),
111: ("note.guitar", 7),
112: ("note.harp", 6),
113: ("note.bell", 4),
114: ("note.harp", 6),
115: ("note.cow_bell", 5),
116: ("note.bd", 7), # 打击乐器无音域
117: ("note.bass", 8),
118: ("note.bit", 6),
119: ("note.bd", 7), # 打击乐器无音域
120: ("note.guitar", 7),
121: ("note.harp", 6),
122: ("note.harp", 6),
123: ("note.harp", 6),
124: ("note.harp", 6),
125: ("note.hat", 7), # 打击乐器无音域
126: ("note.bd", 7), # 打击乐器无音域
127: ("note.snare", 7), # 打击乐器无音域
}
without_pitch = {
34: ("note.bd", 7),
35: ("note.bd", 7),
36: ("note.hat", 7),
37: ("note.snare", 7),
38: ("note.snare", 7),
39: ("note.snare", 7),
40: ("note.hat", 7),
41: ("note.snare", 7),
42: ("note.hat", 7),
43: ("note.snare", 7),
44: ("note.snare", 7),
45: ("note.bell", 4),
46: ("note.snare", 7),
47: ("note.snare", 7),
48: ("note.bell", 4),
49: ("note.hat", 7),
50: ("note.bell", 4),
51: ("note.bell", 4),
52: ("note.bell", 4),
53: ("note.bell", 4),
54: ("note.bell", 4),
55: ("note.bell", 4),
56: ("note.snare", 7),
57: ("note.hat", 7),
58: ("note.chime", 4),
59: ("note.iron_xylophone", 6),
60: ("note.bd", 7),
61: ("note.bd", 7),
62: ("note.xylophone", 4),
63: ("note.xylophone", 4),
64: ("note.xylophone", 4),
65: ("note.hat", 7),
66: ("note.bell", 4),
67: ("note.bell", 4),
68: ("note.hat", 7),
69: ("note.hat", 7),
70: ("note.flute", 5),
71: ("note.flute", 5),
72: ("note.hat", 7),
73: ("note.hat", 7),
74: ("note.xylophone", 4),
75: ("note.hat", 7),
76: ("note.hat", 7),
77: ("note.xylophone", 4),
78: ("note.xylophone", 4),
79: ("note.bell", 4),
80: ("note.bell", 4), }
pitched_instrument_list = {
0: ("note.harp", 6),
1: ("note.harp", 6),
2: ("note.pling", 6),
3: ("note.harp", 6),
4: ("note.pling", 6),
5: ("note.pling", 6),
6: ("note.harp", 6),
7: ("note.harp", 6),
8: ("note.share", 7), # 打击乐器无音域
9: ("note.harp", 6),
10: ("note.didgeridoo", 8),
11: ("note.harp", 6),
12: ("note.xylophone", 4),
13: ("note.chime", 4),
14: ("note.harp", 6),
15: ("note.harp", 6),
16: ("note.bass", 8),
17: ("note.harp", 6),
18: ("note.harp", 6),
19: ("note.harp", 6),
20: ("note.harp", 6),
21: ("note.harp", 6),
22: ("note.harp", 6),
23: ("note.guitar", 7),
24: ("note.guitar", 7),
25: ("note.guitar", 7),
26: ("note.guitar", 7),
27: ("note.guitar", 7),
28: ("note.guitar", 7),
29: ("note.guitar", 7),
30: ("note.guitar", 7),
31: ("note.bass", 8),
32: ("note.bass", 8),
33: ("note.bass", 8),
34: ("note.bass", 8),
35: ("note.bass", 8),
36: ("note.bass", 8),
37: ("note.bass", 8),
38: ("note.bass", 8),
39: ("note.bass", 8),
40: ("note.harp", 6),
41: ("note.harp", 6),
42: ("note.harp", 6),
43: ("note.harp", 6),
44: ("note.iron_xylophone", 6),
45: ("note.guitar", 7),
46: ("note.harp", 6),
47: ("note.harp", 6),
48: ("note.guitar", 7),
49: ("note.guitar", 7),
50: ("note.bit", 6),
51: ("note.bit", 6),
52: ("note.harp", 6),
53: ("note.harp", 6),
54: ("note.bit", 6),
55: ("note.flute", 5),
56: ("note.flute", 5),
57: ("note.flute", 5),
58: ("note.flute", 5),
59: ("note.flute", 5),
60: ("note.flute", 5),
61: ("note.flute", 5),
62: ("note.flute", 5),
63: ("note.flute", 5),
64: ("note.bit", 6),
65: ("note.bit", 6),
66: ("note.bit", 6),
67: ("note.bit", 6),
68: ("note.flute", 5),
69: ("note.harp", 6),
70: ("note.harp", 6),
71: ("note.flute", 5),
72: ("note.flute", 5),
73: ("note.flute", 5),
74: ("note.harp", 6),
75: ("note.flute", 5),
76: ("note.harp", 6),
77: ("note.harp", 6),
78: ("note.harp", 6),
79: ("note.harp", 6),
80: ("note.bit", 6),
81: ("note.bit", 6),
82: ("note.bit", 6),
83: ("note.bit", 6),
84: ("note.bit", 6),
85: ("note.bit", 6),
86: ("note.bit", 6),
87: ("note.bit", 6),
88: ("note.bit", 6),
89: ("note.bit", 6),
90: ("note.bit", 6),
91: ("note.bit", 6),
92: ("note.bit", 6),
93: ("note.bit", 6),
94: ("note.bit", 6),
95: ("note.bit", 6),
96: ("note.bit", 6),
97: ("note.bit", 6),
98: ("note.bit", 6),
99: ("note.bit", 6),
100: ("note.bit", 6),
101: ("note.bit", 6),
102: ("note.bit", 6),
103: ("note.bit", 6),
104: ("note.harp", 6),
105: ("note.banjo", 6),
106: ("note.harp", 6),
107: ("note.harp", 6),
108: ("note.harp", 6),
109: ("note.harp", 6),
110: ("note.harp", 6),
111: ("note.guitar", 7),
112: ("note.harp", 6),
113: ("note.bell", 4),
114: ("note.harp", 6),
115: ("note.cow_bell", 5),
116: ("note.bd", 7), # 打击乐器无音域
117: ("note.bass", 8),
118: ("note.bit", 6),
119: ("note.bd", 7), # 打击乐器无音域
120: ("note.guitar", 7),
121: ("note.harp", 6),
122: ("note.harp", 6),
123: ("note.harp", 6),
124: ("note.harp", 6),
125: ("note.hat", 7), # 打击乐器无音域
126: ("note.bd", 7), # 打击乐器无音域
127: ("note.snare", 7), # 打击乐器无音域
}
percussion_instrument_list = {
34: ("note.bd", 7),
35: ("note.bd", 7),
36: ("note.hat", 7),
37: ("note.snare", 7),
38: ("note.snare", 7),
39: ("note.snare", 7),
40: ("note.hat", 7),
41: ("note.snare", 7),
42: ("note.hat", 7),
43: ("note.snare", 7),
44: ("note.snare", 7),
45: ("note.bell", 4),
46: ("note.snare", 7),
47: ("note.snare", 7),
48: ("note.bell", 4),
49: ("note.hat", 7),
50: ("note.bell", 4),
51: ("note.bell", 4),
52: ("note.bell", 4),
53: ("note.bell", 4),
54: ("note.bell", 4),
55: ("note.bell", 4),
56: ("note.snare", 7),
57: ("note.hat", 7),
58: ("note.chime", 4),
59: ("note.iron_xylophone", 6),
60: ("note.bd", 7),
61: ("note.bd", 7),
62: ("note.xylophone", 4),
63: ("note.xylophone", 4),
64: ("note.xylophone", 4),
65: ("note.hat", 7),
66: ("note.bell", 4),
67: ("note.bell", 4),
68: ("note.hat", 7),
69: ("note.hat", 7),
70: ("note.flute", 5),
71: ("note.flute", 5),
72: ("note.hat", 7),
73: ("note.hat", 7),
74: ("note.xylophone", 4),
75: ("note.hat", 7),
76: ("note.hat", 7),
77: ("note.xylophone", 4),
78: ("note.xylophone", 4),
79: ("note.bell", 4),
80: ("note.bell", 4), }

View File

@ -28,7 +28,7 @@ import shutil
from .utils import *
from .exceptions import *
import instC
from .instConstants import *
from typing import TypeVar, Union
@ -204,17 +204,14 @@ class midiConvert:
default: 如果instrumentID不在范围内返回的默认我的世界乐器名称
:return: (str我的世界乐器名, int转换算法中的X)"""
try:
return instC.with_pitch[instrumentID]
return pitched_instrument_list[instrumentID]
except KeyError:
return "note.flute", 5
@staticmethod
def __bitInst2ID_withX(instrumentID):
try:
try:
return instC.without_pitch[instrumentID]
except KeyError:
return "note.bd", 7
return percussion_instrument_list[instrumentID]
except KeyError:
print("WARN", "无法使用打击乐器列表库可能是不支持当前环境打击乐器使用Dislink算法代替。")
if instrumentID == 55:

View File

@ -1,15 +0,0 @@
rm -rf ./MusictraterPkgver
git clone https://gitee.com/TriM-Organization/Musicreater -b pkgver MusictraterPkgver
cd ./MusictraterPkgver
python3 -O -m compileall -b .
find . -name "*.py"|xargs rm -rf
find . -name "__pycache__" |xargs rm -rf
rm -rf ./.git
rm ./.gitignore