tidal-listener icon indicating copy to clipboard operation
tidal-listener copied to clipboard

Define basic protocol

Open yaxu opened this issue 4 years ago • 7 comments

What's the basic api?

On going design ideas moved here: https://github.com/tidalcycles/tidal-listener/wiki

yaxu avatar Jul 06 '20 12:07 yaxu

Would be great to have queryArc as part of this API!

jarmitage avatar Nov 16 '20 00:11 jarmitage

As in ? [out] queryArc "some pattern" arcsize [in] [((1,1),(2,1)),((1,1),(2,1))|"a",[((1,1),(2,1)),((3,1),(4,1))]0-(½>1)|"b"]

lwlsn avatar Nov 17 '20 13:11 lwlsn

@lwlsn yeah, or even in a form like getEvents start end p:

[out] getEvents 4 8 (`s "bd ~ cp/4"`)

jarmitage avatar Nov 17 '20 15:11 jarmitage

One thing I've noticed is that while you can use multiple streams you won't get highlight nor code/ok|err messages back with stream name.

Ok|err responses are easy fix but highlight looks way more complex due to the stack used by Tidal at https://github.com/tidalcycles/Tidal/blob/9e16e1f15659a2e78748a4accac84fd1fd58b902/src/Sound/Tidal/Stream.hs#L441.

The information is there but it gets discarded (stacked), so it would need a bit different handling for OSCStream messages.

sorki avatar Apr 30 '21 08:04 sorki

@sorki @ndr-brt This should add the pattern id/stream name to the start of highlight osc messages: https://github.com/tidalcycles/Tidal/commit/d15a87e1f6fea699ab5e3dc819ea216094356852

yaxu avatar Jul 15 '21 13:07 yaxu

@sorki It looks like the stream id is sent with /code/ok and /code/err messages to me https://github.com/tidalcycles/tidal-listener/blame/master/src/Sound/Tidal/Listener.hs#L81

To fix it for highlights I added the id to pattern controlmaps before they are stacked, as the string parameter 'id'. This means that this is accessible also to be sent out over the OSC messages, which might be useful for e.g. visualisation.

yaxu avatar Jul 16 '21 14:07 yaxu

Lovely, thank you @yaxu!

sorki avatar Jul 17 '21 10:07 sorki