Get Tidal code from Atom plugin

Hi everyone,
I'm involved in a project that uses the Processing language for the video part.
My task is to provide the executed Tidal code to the Processing app in such a way as to be shown over the visual.

Basically, I have to send the code to Processing in some way but I don't know how.
Maybe through an OSC message that embeds the entire code? Or, using a specific "get" function in Haskell?

I have no idea, and any words of advise would be good.
I apologize for the trivial question, I’m a novice with Haskell :grinning:

1 Like

I would start at tidal-vis, it dynamically renders a color pattern for the OSC messages and can generates svg or pdf files. I used it to make a svg but haven't looked inside. It should have clues to catching osc messages and sending them to processing.

1 Like

If you need to send all the code (evaluated?), that could be done modifying the atom plugin:
The normal behavior is that the code is sent to a ghci instance, but it could also be sent through osc...
Maybe we can implement it as a feature of the plugin, feel free to open a issue and a pr on the repository


Thanks a lot :slight_smile: I will try this now!
One question: from the OSC
-- Send pattern as osc both to SC and to tidal-vis
tidal <- startMulti [musicTarget, patternTarget] config
I can retrieve the SuperCollider code right (not the Tidal one), and set it to Processing through the patternTarget OSC message, right?

Thanks man :wink: I will try this solution but it will take time for me, since I’m not very experienced in the field :upside_down_face: but, if you have information about the new version let us know anyway.

Hi, I have a related desire so I'm hijacking the thread a bit.

In my case I'd like to capture the output of drawLine; my purpose is to be able to visualise euclidean patterns, so I can compose more complex structures while getting a clear view of the outcome. I know there's cleaner ways to go about it -- my first shot was to try tidal-vis but I can't install it.

In the end I'd like to set up a minimal web app with a simple UI to put in mininotation and show the output of drawLine. But I have no idea how to 1. send a command to tidal from another process and 2. capture the Tidal output.

[let me know if this is unrelated to the thread, we can probably break this out into a separate discussion]

Hi @luluganeta :wink: Yaaa it'll be beautiful!
So, for now, I was able to send the Tidal code from the atom plugin to Processing adding just a few lines in the repl.js file of the Atom plugin. The plugin uses the osc.js library, so I opted for using that.
But up to now, it is not well-scripted (are not very experienced in programming :wink: ).

I these days I found also this. Maybe it can help you.
Let me know :wink:

That can be unreleated to the thread, could be cool to integrate some visualizations based on the drawLine function

In the atom plugin there's a process that launches a ghci instance and loads the BootTidal.hs file, so tidal is loaded over there. To eval tidal expression the code is sent to that process as it if were a REPL (ghci IS a repl after all :slight_smile: )
So, if you use tidal from the atom plugin the only way to send commands to that tidal instance is to do that inside the atom plugin.
I know that there's a work in progress project called tidal-listener that will permit to communicate with tidal via OSC, but it's still not complete enough I think

As before, in the plugin the output of that process is the tidal output, it can be catched and shown into the plugin.

Thinking about it in a "new atom plugin feature" it could be that, every code evaluation, the plugin could try to evaluate all the patterns in the block with drawLine and shown them in the console. Don't know how this thing could work, but it maybe worth a try.


Another example of using ocs from TidalCycles to Processing for inspiration.
Atsushi Tadokoro has published his Tidalcycles to Processing code on his github

video of Processing output and Tidalcycles input.

Atsushi Tadokoro's github for tidal processing interface, and generous Tidal code