Messaging with CSound and Python

I'm currently working on a project specializing in modeling guitar effects using Evolutionary Algorithms and want to use Python and CSound for this.

The idea is to generate effect parameters in my algorithm in Python, send them to CSound and apply a filter to the audio file, and then send the new audio file back to Python to perform frequency analysis to compare with the target audio file (this will be done in a loop before as long as the audio file is not sufficiently similar to the target audio file, so sending / receiving between CSound and Python will be a lot).

Briefly stated, how do I get Python to send data to a CSound (.csd file), how can I read data in a .csd file, and how do I send a WAV file from CSound to Python? It is also preferred that this can work dynamically on its own until the criteria for the audio file are met.

Thank you in advance

+4
source share
2 answers

passing parameter values ​​from python to csound can be done using the osc protocol

audio transmission from csound to python can be done using channel routing channels between two applications

+1
source

You can use the Csound python API, so you can run Csound within python and pass values ​​via the software bus. See Csound.h. You can also use the csPerfThread shell class, which can schedule messages in and from Csound when it starts. All functions are available from python.

+1
source

Source: https://habr.com/ru/post/1382304/


All Articles