Sending OSC problem - another TIdal instance is already listening

Hi all,

I am on Windows 11 and when I am trying to run the basic OSC example

stream <- startStream defaultConfig oscmap

I am receiving the error:

t> [TidalCycles version 1.9.4]
Installed in C:\cabal\x86_64-windows-ghc-9.4.4\tidal-1.9.4
Listening for external controls on 127.0.0.1:6010
That port isn't available, perhaps another Tidal instance is already listening on that port?

From what I have read here previously, I assume this is because I also installed (and also tried to delete) tidal 1.9.3. Is there a way to guarantee that the previous version was uninstalled?

If this is not the cause of the problem, what else can I try?

Thanks a lot!

I get this message - along with "Can't handshake with SuperCollider without control port." I ignore these and don't have any problems with OSC.

I don't think this has anything to do with having multiple tidal versions. The 6010 localhost port is not the port OSC is sending on. If you use the port in the OSC docs, it will be 5050. I think the 6010 port is for receiving OSC connections back. And if you have already started Tidal, it will use port 6010. So that is why I think the stream <- command says the port isn't available.

1 Like

Yes that's true @HighHarmonics but you can configure multiple targets to use a single tidal instance, to remove this warning and make things easier.

If you edit your BootTidal.hs, you will see that tidal is started with a line that starts with

tidal <- startTidal ...

So by running

stream <- startStream defaultConfig oscmap

after booting tidal, you are indeed starting a second copy of tidal.

A tidy thing to do is replace that startTidal line. Following the example in the documentation, you would do replace it with:

:{
let target =
      Target {oName = "visualiser",   -- A friendly name for the target (only used in error messages)
              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),
                                     ("vowel", Just $ VS "a"),
                                     ("pan", Just $ VF 0.5),
                                     ("volume", Just $ VF 1),
                                     ("cut", Just $ VI 1),
                                     ("intensity", Just $ VI 0)
                                   ]
    intensity = pF "intensity"
    oscmap = [(target, [oscplay]), (superdirtTarget {oLatency = 0.1}, [superdirtShape])]
:}

tidal <- startStream defaultConfig oscmap

Note that a block of code longer than one line has to be surrounded with :{ and :}, which I've done above.

I also renamed the 'stream' variable to 'tidal' to match the rest of the boottidal.hs file.

Finally I added the superdirt target to the oscmap so that superdirt will get the messages too (you might not want this, in which case remove it again).

Then you can restart tidal and you should be able to pattern things with the usual d1, d2 etc, as well as receive OSC/MIDI messages to your patterns.

3 Likes

Thanks @yaxu! This explanation is clear and the code very helpful. I think we should integrate this into the OSC documentation - with a heading of "Multiple OSC targets with one Tidal instance via BootTidal.hs"

1 Like