Skip to main content

A powerful music style converter

Project description

MusicConverter

一个简洁易用的MIDI音乐音色转换工具,原生Python开发,支持MIDI全流程自动化处理。

功能特性

  • 读取本地MIDI文件,解析完整音符与轨道信息
  • 一键分离多轨音轨,支持单轨道单独编辑
  • 自由替换任意音轨乐器音色,适配GM标准音色库
  • 独立单轨音频合成,分轨导出音频文件
  • 多轨音频合并,内置可调参数混响效果
  • 最终合成并输出标准WAV无损音频

快速开始

  1. 克隆项目 git clone https://github.com/jianfei1234/MusicConverter.git

  2. 安装依赖 pip install mido numpy sounddevice soundfile matplotlib pygame

  3. 运行示例 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】 本库仅限个人学习使用,商业用途请购买授权。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

musicconverter-1.0.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

musicconverter-1.0.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file musicconverter-1.0.0.tar.gz.

File metadata

  • Download URL: musicconverter-1.0.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for musicconverter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 992ab6ef332f18a8b15bdec425af0990f959478eb09a092f387587d5be4d4599
MD5 14c99228390af4e577c546ee3ad853e7
BLAKE2b-256 9e936541b427a4fa863a44d30a1f19c062355ce365594a53a8ac875fc21cc102

See more details on using hashes here.

File details

Details for the file musicconverter-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: musicconverter-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for musicconverter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c08b28f484be2eab0c3e64d9d95095f2bd57c8768a581b39a353f595e204c3a
MD5 cbf79b00228e091004662130d383d9d4
BLAKE2b-256 50a7b032961fb6b31dbf7631cdf84e21133cb0e0ded43ab411a322a7a53ac1b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page