MusicConverter
一个简洁易用的MIDI音乐音色转换工具,原生Python开发,支持MIDI全流程自动化处理。
功能特性
- 读取本地MIDI文件,解析完整音符与轨道信息
- 一键分离多轨音轨,支持单轨道单独编辑
- 自由替换任意音轨乐器音色,适配GM标准音色库
- 独立单轨音频合成,分轨导出音频文件
- 多轨音频合并,内置可调参数混响效果
- 最终合成并输出标准WAV无损音频
快速开始
-
克隆项目 git clone https://github.com/jianfei1234/MusicConverter.git
-
安装依赖 pip install mido numpy sounddevice soundfile matplotlib pygame
-
运行示例 python example.py
使用示例
安装包
pip install MusicConverter
初始化
from MusicConverter import MusicStyleConverter
converter = MusicStyleConverter()
读取midi文件
midi_file_path = "火红的萨日朗 (1).mid"
converter.load_midi(midi_file_path)
分离音轨
converter.separate_tracks()
随机转换风格
multitrack3 = converter.synthesize_multitrack()
converter.save_audio(multitrack3, "random_retro.wav")
转换指定风格
instrument_map_8bit = {
0: '8bit_bass', # 主旋律 - 明亮穿透
1: '8bit_lead', # 贝斯 - 低音支撑
2: '8bit_arp', # 琶音 - 填充和声
3: '8bit_pulse', # 副旋律 - 对位
4: '8bit_drum', # 打击乐 - 节奏
}
# 生成复古游戏音乐
multitrack = converter.synthesize_multitrack(instrument_map_8bit)
converter.save_audio(multitrack, "retro_game_music.wav")
版权说明
Copyright © 2026 【Ma Jianfei】 本库仅限个人学习使用,商业用途请购买授权。
Metadata
Release files for MusicConverter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| musicconverter-1.0.0.tar.gz | 11.1 kB | Without provenance | Details for musicconverter-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| musicconverter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for musicconverter-1.0.0-py3-none-any.whl |
Total release size: 22.7 kB
Release files / musicconverter-1.0.0.tar.gz
| Download URL | musicconverter-1.0.0.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
992ab6ef332f18a8b15bdec425af0990f959478eb09a092f387587d5be4d4599
|
|
BLAKE2b-256 checksum How to use checksums |
9e936541b427a4fa863a44d30a1f19c062355ce365594a53a8ac875fc21cc102
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / musicconverter-1.0.0-py3-none-any.whl
| Download URL | musicconverter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c08b28f484be2eab0c3e64d9d95095f2bd57c8768a581b39a353f595e204c3a
|
|
BLAKE2b-256 checksum How to use checksums |
50a7b032961fb6b31dbf7631cdf84e21133cb0e0ded43ab411a322a7a53ac1b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for MusicConverter 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.