Multi target OSC messages

Hi all !

I was trying to set tidal for sending osc messages to both supercollider and max msp ! I used the documentation model OSC | Tidal Cycles
for just testing if max msp is receiving messages but i doesn't work this is my code :

let target = Target {oName = "oscMAX", -- target name in error msg
oAddress = "localhost", -- The target's network address, normally "localhost"
oPort = 5050, -- The network port the target is listening on
oLatency = 0.2, -- Additional delay, to smooth out network jitter/get things in sync
oSchedule = Live, -- The scheduling method - see below
oWindow = Nothing, -- Not yet used
oHandshake = False, -- SuperDirt specific
oBusPort = Nothing -- Also SuperDirt specific

oscplay = OSC "/play" $ ArgList [
("s", Nothing), -- without "s" no OSC sent - this is for sound
("parameter1", Just $ VF 0.35),
("parameter2", Just $ VF 0.5),
("parameter3", Just $ VF 0.8)

let param1 = pF "parameter1"
param2 = pF "parameter2"
param3 = pF "parameter3"

oscmap = [(target, [oscplay]), (superdirtTarget, [superdirtShape])]

stream <- startStream defaultConfig oscmap

d = streamReplace stream

d1 $ s "bd" # param1 0.5
and then I have this error message in tidal :

t> [TidalCycles version 1.9.4] Installed in /Users/marioganau/.local/state/cabal/store/ghc-9.8.1/tdl-1.9.4-dd53c228/share Listening for external controls on That port isn't available, perhaps another Tidal instance is already listening on that port?

t> Can't handshake with SuperCollider without control port.

could you help me please ? Someone has experimented same issues ? I am using the default BootTidal.hs .

I've just came here to ask the same question. I want to send messages to both SuperDirt via default 57120 port and to a custom one (to Max or whatever). I'm trying to modify this file from @Francesco_Corvi's HackYourDaw to be able to use both Max device as an audio effect device with SuperDirt at the same time but I didn't succeed yet. Do someone have a solution?

File with a single osc target that needed to be modified with multiple targets: BootTidal.hs

@wehrk Have you reviewed the OSC page in the Tidal user docs?

There is a section on Multiple Targets and messages.

I regularly use Tidal with Max, sometimes routing SuperCollider audio output to Max for processing with VST plugins, sometimes routing OSC messages so that patterns & parameters in Tidal route directly to Max for synthesis, and sometimes I use Tidal to control both SuperDirt and Max. I posted details on one project here: Troubleshooting custom OSC - #7 by HighHarmonics It contains a link to a GH repo I with the tidal and Max files.

1 Like

Yes, I've seen this text. The problem is that there's different approach in this tutorial and the file I provided (also in the default BootTidal.hs file).

stream <- startStream defaultConfig oscmap

Is different from

tidal <- startTidal (customTarget { oLatency = 0.2, oAddress = "", oPort = 2020 }) (defaultConfig { cFrameTimespan = 1/20 })

Is it possible to modify this file to have two or more targets? What is defaultConfig? What are startStream and startTidal?

Can't it be composed that way?

tidal <- startTidal (defaultConfig { cFrameTimespan = 1/20 }) [ 
    (superdirtTarget {oLatency = 0.05, oAddress = "", oPort = 57120}, [superdirtShape]), 
    (customTarget { oLatency = 0.2, oAddress = "", oPort = 2020 }) 

But now it stopped working and introduced with errors like:

Warning: GHCi | 
Warning: GHCi | <interactive>:211:1: error: [GHC-88464]
Warning: GHCi |     Variable not in scope: d2 :: ControlPattern -> b
Warning: GHCi |     Suggested fix: Perhaps use ‘dt’ (imported from Sound.Tidal.Context)