小编Pat*_*t B的帖子

用Python合成音符(带钢琴音色)

我想有一个乐器库的python实现(例如,钢琴对象),我可以使用它来将音符列表和持续时间转换为声音.例如,类似于:

import Piano

pn = Piano()
pn.play([note, note, ..., note], duration)
Run Code Online (Sandbox Code Playgroud)

python 2.7是否存在类似的内容?如果没有,我想实施它.我目前有一些使用audiere的东西,但它只是正弦波,所以听起来很可怕.有没有办法挂进midi钢琴或类似的东西 - 我正在使用Windows 7?是否有任何我可能不期望的实施步骤?

python audio midi

15
推荐指数
2
解决办法
2万
查看次数

需要帮助在mac os x上安装python包autopy - libpng和png.h的难度

我想知道是否有人能帮助我解决这个问题.当我尝试python setup.py build(或pip install,或easy_install)时,会发生这种情况

要点是

src/png_io.c:3:17: error: png.h: No such file or directory
src/png_io.c: In function ‘newMMBitmapFromPNG’:
src/png_io.c:34: error: ‘png_struct’ undeclared (first use in this function)
src/png_io.c:34: error: (Each undeclared identifier is reported only once
Run Code Online (Sandbox Code Playgroud)

......一堆错误......

src/png_io.c:332: error: ‘PNG_TRANSFORM_IDENTITY’ undeclared (first use in this function)
lipo: can't figure out the architecture type of:  /var/folders/kt/d8t29zkx7kd_7c_mr17ntv6m0000gn/T//ccubs4CM.out

error: command 'gcc-4.2' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

libpng位于Library/Frameworks中,它位于<> includes(我用cpp -v检查)的搜索路径上,但它在那里作为libpng.framework,然后标题位于名为headers的子目录中.libpng.framework文件中还有几个版本的libpng.我也在运行64位python.任何想法如何进行?

谢谢,帕特

c python macos gcc libpng

7
推荐指数
1
解决办法
1543
查看次数

需要帮助在os x 10.7上安装lxml

我一直在努力做到from lxml import etree(import lxml顺便说一下工作正常)错误是:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-            packages/lxml/etree.so, 2): Symbol not found: _htmlParseChunk
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
Run Code Online (Sandbox Code Playgroud)

我使用pip来安装lxml,并使用正确的架构重新安装libxml2(或者我认为)...有没有人有关于如何修复/诊断这个的想法?我是64位python

python homebrew lxml pip libxml2

5
推荐指数
1
解决办法
7255
查看次数

标签 统计

python ×3

audio ×1

c ×1

gcc ×1

homebrew ×1

libpng ×1

libxml2 ×1

lxml ×1

macos ×1

midi ×1

pip ×1