Skip to main content

musicpipeline

仓库:https://gitee.com/siwpan/mp | 许可:MIT(见 LICENSE) 注:文中 <PATH> 为路径占位符,请替换为你本机实际的目录 / 可执行文件路径。

随机音乐生成器 + WMP 风格可视化,纯 Python 标准库实现(tkinter 图形界面)。 独立仓 siwpan/mp(本地 <PATH>)。

类型

代码项目(Python)

目录要点

  • musicpipeline/:Python 包,拆分为多模块:
    • core.py:合成引擎(音符/音阶/音色/ADSR/混响/滤波/旋律·低音·铺底·鼓轨生成/generate_music)
    • analysis.py:频谱分析(Goertzel 算法 + 帧能量)
    • visualizer.py:tkinter GUI 与 7 种可视化效果
    • __init__.py:公开接口与 __version__
    • __main__.py:python -m musicpipeline 命令行入口
  • *.wav / *.mp3:生成的音频产物(已 gitignore,不入库)
  • mumu/:本地采样/素材目录(音频产物,已 gitignore)

用途

随机生成音乐并做可视化演示,导出 WAV 文件,无外部依赖。

测试状态

包通过 py_compile 语法检查;import musicpipeline 与 generate_music(return_samples=True) 可生成有效 WAV(非 GUI 冒烟通过);GUI 未运行。

运行

python -m musicpipeline            # 启动图形界面(默认)
python -m musicpipeline --random   # 直接随机生成一首 wav(写入当前目录)
python -m musicpipeline --batch 5  # 批量生成 5 首

安装后也可用 console_script:

pip install musicpipeline
musicpipeline --random

作为库调用:

from musicpipeline import generate_music
path, params = generate_music(bpm=120, n_bars=8, scale_name="大调")

向后兼容(已废弃)

历史代码 import orc 仍可工作:分发包顶层附带 orc.py 兼容垫片,重新导出全部公开接口。 导入时会发出 DeprecationWarning,请尽快迁移到 import musicpipeline(垫片将在未来主版本移除)。

import orc                       # DeprecationWarning:请改用 import musicpipeline
path, params = orc.generate_music()

发布面与许可

  • gitee:siwpan/mp,release v2.0.1(便携源码 zip)。
  • PyPI:musicpipeline 2.0.1。
  • 许可:MIT · Copyright (c) 2026 siwpan

Metadata

Release files for musicpipeline 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for musicpipeline 2.0.1
File Size Uploaded Provenance Actions
musicpipeline-2.0.1.tar.gz 19.1 kB Without provenance Details for musicpipeline-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for musicpipeline 2.0.1
File Interpreter ABI Platform Actions
musicpipeline-2.0.1-py3-none-any.whl Python 3 none any Details for musicpipeline-2.0.1-py3-none-any.whl

Total release size: 39.1 kB

Release files / musicpipeline-2.0.1.tar.gz

Download URL musicpipeline-2.0.1.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4273c2b3abebb7f8ed2ab338b1ae41c33f6728a43cc4627de6db5b406defbcea
BLAKE2b-256 checksum
How to use checksums
122759547ae59cf7a0292ec6dc9463571824ea6cdf126f5bbf57cb730e6ddbfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / musicpipeline-2.0.1-py3-none-any.whl

Download URL musicpipeline-2.0.1-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25925cd0d9baa64475e539478b3777d7a893eed29d2912785cde9dd6e26b5177
BLAKE2b-256 checksum
How to use checksums
6f5b626a8c6e6ec11c6b05a2f8dea168c877575151d919e473fb74fef544dbe8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for musicpipeline 2.0.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page