简单,跨平台MIDI库的Python [英] Simple, Cross Platform MIDI Library for Python

查看:932
本文介绍了简单,跨平台MIDI库的Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做建立一个小的应用程序创建MIDI声音。我从来没有处理声音节目,所以我想开始与一些基本并具有良好的文档。我想与Python坚持,因为我是最舒服,不想压倒自己,开始。

I want to do build a small app that creates MIDI sounds. I've never dealt with sound in programming so I'd like to start with something that's basic and has good documentation. I want to stick with Python since I'm the most comfortable with it and don't want to overwhelm myself, initially.

我的时间在Windows和Ubuntu之间约50/50这样的东西,只是工作两个平台将是非常有益的。

My time is split about 50/50 between Windows and Ubuntu so something that "just works" on both platforms would be really helpful.

有什么建议?

推荐答案

该MIDIUtil库(托管这里在谷歌code)你想要做什么:从单纯的Python库编写MIDI文件。它(和充分披露:我的作者)曾经好处是,你不必跟踪较低级别的MID事件,如音符开和音符关的:它处理他们为你

The MIDIUtil Library (hosted here at Google Code) does what you want: write MIDI Files from a pure Python library. Once nice thing about it (and full disclosure: I'm the author) is that you don't have to keep track of lower-level MID events such as note-on and note-off: it handles them for you.

作为一个例子来写一个说明,你会做这样的事情:

As an example to write a note, you would do something like:

MyMIDI = MIDIFile(1)
track = 0
channel = 0
pitch = 60
time = 0
duration = 1
volume = 100
MyMIDI.addNote(track,channel,pitch,time,duration,volume)

希望这有助于

这篇关于简单,跨平台MIDI库的Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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