Code Monkey home page Code Monkey logo

Comments (4)

fkxxyz avatar fkxxyz commented on June 2, 2024

另外,同为音乐爱好者,我最近也开发了个类似的程序,可以相互参考和交流奥 https://github.com/fkxxyz/simp-score

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024

play函数在linux下,会报错

In [8]: play(note('A',5))                                                                
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-8-e5677dd3da72> in <module>
----> 1 play(note('A',5))

~/.pyenv/versions/3.8.0/lib/python3.8/site-packages/musicpy/musicpy.py in play(chord1, tempo, track, channel, time1, track_num, name, modes)
    198                  track_num=1,
    199                  mode=modes)
--> 200     os.startfile(f'{name}.mid')
    201 
    202 

AttributeError: module 'os' has no attribute 'startfile'

但是在当前目录生成了个 temp.mid 能够播放。目测是 linux下的python没有 os.startfile 这个函数,仅仅windows才有,希望跨平台适配。

好的,会去增加一下跨平台的支持。

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024

另外,同为音乐爱好者,我最近也开发了个类似的程序,可以相互参考和交流奥 https://github.com/fkxxyz/simp-score

好的,我会关注这个项目,另外关于和弦的部分,我这个musicpy的库值得一提的是有一个智能判断任意一组音是什么和弦的算法,以及智能分离一首钢琴曲的主旋律和和弦部分的算法。这两个算法分别在detect函数和split_melody函数里,在musicpy.py文件里可以看到代码。

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024

目前已经把musicpy里的play函数的跨平台支持写完了,目前支持windows/Linux/MacOS这几个系统。已经更新到github了,可以直接下载,我待会上传到PYPI。如果在Linux播放还有出现问题,请看README的注意事项。

from musicpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.