Simple python module to integrate tidal and p5 (processing)

Hi everyone!

In the last few days I've been trying to communicate between tidal and p5 (processing-like python lib) and I couldn't find any python package that would do this. So I made a simple module (livecoding) where an OSC server runs in one thread and p5 drawing loop in the other one.

Here's an example code:

from livecoding import TidalSession
from p5 import *

class MyLiveCodingSession(TidalSession):

    def setup(self):
        size(640, 360)
        background(255)

    def draw(self):
        with self.lock:
            if self.parameters['s'] == 'bd':
                background(255, 50, 50)
            elif self.parameters['s'] == 'sn':
                background(50, 50, 255)

lc = MyLiveCodingSession()
lc.run()

I hope it's useful to someone. Comments and critiques are appreciated.

5 Likes