Csound Csound-dev Csound-tekno Search About

[Csnd-dev] ctcsound and virtualenvs

Date2023-04-03 15:57
FromEduardo Moguillansky
Subject[Csnd-dev] ctcsound and virtualenvs
The current strategy for installing the python bindings to csound is 
that the file ctcsound.py will be copied at installation time to either 
some hardcoded paths where python is supposed to look for packages (this 
seams to be the case in macos) or to whatever the python binary says 
that its site directory is (in linux). A problem that arises is that 
when using python from a virtual environment or any python version 
different than the one being aliased by the "python" binary, these 
bindings are invisible or broken, or both.

One way forward is one ctcsound compatible with all versions, tracking 
any changes in the API in this one file. One such approach can be seen 
here:

https://github.com/csound-plugins/ctcsound7

It is a minimal wrapper around ctcsound and it is a drop-in replacement 
for it. It is compatible with csound >= 6.18 and csound 7. This version 
can be installed via pip and should remain compatible with future 
releases as long as the changes to ctcsound and the API are clearly 
tracked and documented.

To make it clear, this is not meant to replace ctcsound.py. It is a way 
of installing ctcsound in any virtual environment and also a way to 
include ctcsound as a dependency within other python packages.

cheers,

Eduardo Moguillansky