Help with Custom OSC

Hi Everyone, I'm trying to get Tidal set up to send OSC messages to Open Lighting Architecture (OLA). I've looked through the Custom OSC tutorial but I'm confused on how to adjust the code to do what I want and also where the code goes. Where is the BootTidal.hs file located?

Basically, I'd like to write something like o1 $ index 1 # val "0 255 0 255" and have tidal send an OSC message like this to OLA "/dmx/universe/1/1", "0" and then /dmx/universe/1/1", "255" on the next beat.

Is the following correct at all?

                       oAddress = "127.0.0.1",
                       oPort = 7770,
                       oLatency = 0.2,
                       oSchedule = Live,
                       oWindow = Nothing}
    osFormats   = [OSC "/dmx/universe/1/{index}" $ ArgList [("val", Nothing)]]
    index       = pI "index"
    val         = pI "val"
    oscmap      = [(osTarget, osFormats),
                   (superdirtTarget, [superdirtShape])]

tidal <- startStream defaultConfig oscmap

d1 $ index 1 # val "255 0 0 255"

It depends on what editor you're using for running Tidal. If you're using Atom, there's a setting in the Atom Tidal plugin to specify a location for this file. The default one is in the Tidal GitHub repo. It basically defines a set of aliases that translate between Tidal-the-library and Tidal-the-interface-that-most-people-experience. If you're setting up a combined audio+lighting setup, you'll probably want to incorporate more of the default boot code. If you just want to use Tidal for lighting, then basically the code you've pasted here is what your BootTidal.hs file would be.

Yes, I think so (though it looks like you're missing the first line or more of your code). The one next step is defining functions you'll use for actually controlling patterns (d1 etc).

The default BootTidal defines a generic p function like so:

p = streamReplace tidal

Which would allow you to do this:

p 1 $ index 1 # val "255 0 0 255"

You can extend that by defining functions for different patterns, which would allow the usage that you mentioned:

d1 = p 1
...
d16 = p 16

That said, if you've got a semi-permanent lighting setup, you can also specify functions like this:

o1 = p 1 . (|< index 1)
...
o16 = p 16 . (|< index 16)

This would then always send patterns on o1 to index 1, which means you could do:

o1 $ val "255 0 0 255"

At this point, it becomes highly individualized to your setup and personal code aesthetics, but BootTidal.hs is generally where you'd want to put any other functions/aliases that you come up with that make it easier for you to work with while live-coding. Let me know if you have questions, or run into issues actually running the code!