Skip to main content

键盘弹钢琴,keyboard to play piano

Project description

key_musicz

声明: 禁止将本项目代码用于ai训练 declaration: Codes of this project are not allowed to be used for AI training or any other form of machine learning processes.

许可证从之前的项目拷贝的Appache许可证,后面有空找个MIT的换下

键盘按键弹钢琴的小程序
需要以下C库或资源文件:
    fluidsynth: 读sf2音频文件(里面是各种乐器的按键音),根据指定按键生成音频数据
    FluidR3_GM.sf2: 免费的sf2音频文件,当然你也可以用其他的
    portaudio: windows下会随着pyaudio自动安装,linux需要自己安装
需要以下python库(会自动安装):
    pyfluidsynth: 在python里调用fluidsynth库的封装代码
    pyaudio: 音频数据传入声卡发音,实际调用的portaudio库
    pynput: 监听键盘按键按下和放开
    buildz: 配置文件读取

安装方式:
fluidsynth:
    ubuntu:
        apt install fluidsynth
    windows:
        https://github.com/FluidSynth/fluidsynth/releases
        windows下是压缩包,解压后要把解压路径/bin加到PATH中,注意github时不时会连不上,可以试试镜像加速之类的


pyfluidsynth:
pyaudio:
pynput:
buildz:
    安装本库的时候自动安装,其中linux下的pyaudio可能会报错,需要先手动安装portaudio
    pip install key_musicz

程序运行:
    python -m key_musicz.run sf2文件路径
    
    例:
    python -m key_musicz.run ./FluidR3Mono_GM.sf2

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

key_musicz-0.1.1.tar.gz (22.1 kB view details)

Uploaded Source

File details

Details for the file key_musicz-0.1.1.tar.gz.

File metadata

  • Download URL: key_musicz-0.1.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for key_musicz-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cb6a9c67eb4e61ae369ae290e8042a7fff9f1398f693c93b2ea70caa41a3173e
MD5 4bef914ac3e319bc6830ffe3d4c6683c
BLAKE2b-256 ae083cc188d91e2192569389611846579a2d8c93f0f2cba9e9cfbed9e70091d2

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