简体   繁体   English

如何从 python 运行 SuperCollider 代码

[英]How can I run SuperCollider code from python

I am trying to create an auto-FoxDot installer which is a tool for making music with foxdot.我正在尝试创建一个自动 FoxDot 安装程序,它是一个使用 Foxdot 制作音乐的工具。

In order to install FoxDot you need to run Quarks.install("FoxDot") and FoxDot.start to run it.为了安装 FoxDot,您需要运行Quarks.install("FoxDot")FoxDot.start来运行它。

I want these to be run automatically by the python script rather than having the user run these themselves.我希望这些由 python 脚本自动运行,而不是让用户自己运行这些。

Any ideas would be appreciated, thank you.任何想法将不胜感激,谢谢。

Currently the user is just entering the code and running it themselves.目前用户只是输入代码并自己运行它。

For SuperCollider incremental builds/tests, we use a Python wrapper qpm (the qpm-unit branch) to set-up and launch SC.对于 SuperCollider 增量构建/测试,我们使用 Python 包装器qpmqpm-unit分支)来设置和启动 SC。 It is capable of both installing Quarks by itself, and running arbitrary code snippets in SuperCollider from the command line:它既可以自己安装 Quarks,也可以从命令行在 SuperCollider 中运行任意代码片段:

https://github.com/scztt/qpm/tree/qpm-unit https://github.com/scztt/qpm/tree/qpm-unit

pip2 install git+https://github.com/scztt/qpm.git@qpm-unit
mkdir /tmp/quarks
qpm quark list
qpm quark checkout FoxDot -l /tmp/quarks
qpm execute "FoxDot.postln" -i /tmp/quarks -p /Applications/SuperCollider

It is not a formally supported tool, as it is currently only used for a very narrow case of running unit tests in SC, but you should be able to either use it to get what you're looking for, or re-purpose some of the code for your FoxDot installer.它不是一个正式支持的工具,因为它目前仅用于在 SC 中运行单元测试的非常狭窄的情况,但是您应该能够使用它来获得您正在寻找的东西,或者重新利用一些FoxDot 安装程序的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM