capital-G / musikinformatik-sose2021

Course materials for Musikinformatik course SoSe 2021 at RSH Düsseldorf
https://capital-g.github.io/musikinformatik-sose2021/
7 stars 2 forks source link

Exchange from python to SC #5

Open capital-G opened 3 years ago

capital-G commented 3 years ago

There are multiple ways to transfer results from python to SC - it should be discussed what to use here

Format Remarks SC support Python Support
SDIF Exchange format from IRCAM Beta version seems to exist https://github.com/gesellkammer/pysdif
CSV Standard exchange format in data science - has no types CSVReader built-in/pandas
JSON Like CSV but supports some types Quark JSON Parser built-in/pandas
MIDI Quite a linear format Quark SimpleMIDIFile music21
OSC Standard communication protocol in SC - I wrote a tutorial on this built-in pyosc
capital-G commented 3 years ago

When considering using wavesets (see #16) we could load a buffer in both languages and calculate different kind of clusterings in Python and send the sections according to the clustering of the buffer to SC via OSC which then uses LoopBuf or else to playback the proper section of the buffer. One problem we are facing is the timing and scheduling of these wavesets - either use a stack approach in SC or Python does the timing.

Or we could use https://github.com/josiah-wolf-oberholtzer/supriya

telephon commented 3 years ago

The Quark JSON Parser is not necessary, I think, we have built in support using parseYAMLFile and parseYAML.

telephon commented 3 years ago

Unless you want to write/use a UGen that deals with wavesets, the best way is to simply generate a WavesetsEvent.

And yes, we can read json fine, just have no writer yet.

telephon commented 3 years ago

If you want to work from Python without looking at sclang, then of course it is something else. Then it might be good to use a dedicated UGen.

But if we want to combine python with That, that's another thing.