在python中播放MIDI文件? [英] play MIDI files in python?

查看:545
本文介绍了在python中播放MIDI文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种在python中播放midi文件的方法. 似乎python在其标准库中不支持MIDI. 搜索之后,我发现了一些python midi库,例如 pythonmidi . 但是,它们中的大多数只能创建和读取MIDI文件,而没有播放功能. 我想找到一个包含play方法的python midi库. 有什么建议吗?谢谢!

I'm looking for a method to play midi files in python. It seems python does not support MIDI in its standard library. After I searched, I found some python midi librarys such as pythonmidi. However, most of them can only create and read MIDI file without playing function. I would like to find a python midi library including playing method. Any recommendations? Thanks!

推荐答案

pygame模块可用于播放midi文件.

The pygame module can be used to play midi files.

http://www.pygame.org/docs/ref/music.html

在此处查看示例:

http://www.daniweb.com/software-development/python/代码/216979

可在以下位置找到大量选项:

a whole bunch of options available at:

http://wiki.python.org/moin/PythonInMusic

,也可以在此处进行修改以适合您的目的: http://xenon.stanford.edu/~geksiong/code/playmus/playmus .py

and also here which you can modify to suit your purpose: http://xenon.stanford.edu/~geksiong/code/playmus/playmus.py

这篇关于在python中播放MIDI文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆