# Open Stage Control + TidalCycles = ❤️

**URL:** <https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283>\
**Category:** Announcements\
**Created:** [31 May 2020 17:12 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283 "2020-05-31T17:12:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghales](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghales/32/2171_2.png) [@ghales](https://uzu.lurk.org/u/ghales)\
**Post date:** [31 May 2020 17:12 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/1 "2020-05-31T17:12:44Z")

</div>

Hi everybody, I made a quick [tutorial on setting up Open Stage Control to control TidalCycles](https://ghales.top/posts/open-stage-control-tidal) variables. It's very useful to me and I hope you may find it too

### TL;DR

#### 1. Open Stage Control Mixer

- Choose the **port** of your preference for OSC communication
- Create widgets, and set their `preArgs` to `/ctrl`

#### 2. SuperCollider Boot File

- Add the following to your `startup.scd` (you can find it by clicking on \*\*File \> \*\*)

```haskell
OSCdef(\controltidal, { arg msg; NetAddr.new("localhost", 6010).sendMsg("/ctrl", *msg); }, '/ctrl', NetAddr.localAddr );

```

- Remember to set the port (6010) according to the one you chose in step 1

#### 3. Tidalcycles Boot File

- Add the following to your boot.tidal`. In case you don't have one, you can start with the default one provided on its website.

```haskell
tidal <- startTidal (superdirtTarget { oLatency = 0.1, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig { cFrameTimespan = 1/20 , cCtrlAddr = "0.0.0.0" , cCtrlPort = 6010 })

```

- Remember to set the port (6010) according to the one you chose in step 1

**Link to full post:** [https://ghales.top/posts/open-stage-control-tidal](https://ghales.top/posts/open-stage-control-tidal)

---

<div class="post-metadata">

**Author:** ![ben](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ben/32/362_2.png) [@ben](https://uzu.lurk.org/u/ben)\
**Post date:** [31 May 2020 18:38 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/2 "2020-05-31T18:38:13Z")

</div>

Very cool thanks.

---

<div class="post-metadata">

**Author:** ![cleary](https://uzu.lurk.org/user_avatar/uzu.lurk.org/cleary/32/177_2.png) [@cleary](https://uzu.lurk.org/u/cleary)\
**Post date:** [2 June 2020 06:16 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/4 "2020-06-02T06:16:51Z")

</div>

Small point of clarification, but I think the initialism stands for Open "Sound" Control?

[http://opensoundcontrol.org/introduction-osc](http://opensoundcontrol.org/introduction-osc)

---

<div class="post-metadata">

**Author:** ![a.d.du.nord](https://uzu.lurk.org/user_avatar/uzu.lurk.org/a.d.du.nord/32/586_2.png) [@a.d.du.nord](https://uzu.lurk.org/u/a.d.du.nord)\
**Post date:** [2 June 2020 09:13 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/5 "2020-06-02T09:13:35Z")

</div>

Open Stage Control is just the name of the software, that may be a little bit confusing.

---

<div class="post-metadata">

**Author:** ![a.d.du.nord](https://uzu.lurk.org/user_avatar/uzu.lurk.org/a.d.du.nord/32/586_2.png) [@a.d.du.nord](https://uzu.lurk.org/u/a.d.du.nord)\
**Post date:** [2 June 2020 09:19 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/6 "2020-06-02T09:19:09Z")

</div>

Man, that software works so great with Tidal ! A huge thank to you for your tutorial too 🙂

Did you ever try to insert a X/Y Controller widget and feed Tidal with "rangeX" and "rangeY" values ? It would be awesome in term of possibilities I guess.

---

<div class="post-metadata">

**Author:** ![cleary](https://uzu.lurk.org/user_avatar/uzu.lurk.org/cleary/32/177_2.png) [@cleary](https://uzu.lurk.org/u/cleary)\
**Post date:** [2 June 2020 11:57 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/7 "2020-06-02T11:57:56Z")

</div>

it really is, thanks for confirming!

---

<div class="post-metadata">

**Author:** ![ghales](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghales/32/2171_2.png) [@ghales](https://uzu.lurk.org/u/ghales)\
**Post date:** [2 June 2020 17:57 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/8 "2020-06-02T17:57:36Z")

</div>

Not yet, but it's a great idea!!

---

<div class="post-metadata">

**Author:** ![a.d.du.nord](https://uzu.lurk.org/user_avatar/uzu.lurk.org/a.d.du.nord/32/586_2.png) [@a.d.du.nord](https://uzu.lurk.org/u/a.d.du.nord)\
**Post date:** [2 June 2020 18:37 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/9 "2020-06-02T18:37:18Z")

</div>

So, I've found a way to send OSC with a XY Controller in Open Stage Control.

- **Add a widget \> Pads \> xy**  
Take note of its ID (in example : xy\_1).

- Contrary to a knob or a fader, the XY widget returns 2 values : _rangeX_ and _rangeY_. However, the _"preArgs"_ field in OSC parameters doesn't seem to accept many values. So we'll have to recover each value separately.  
The trick is to create 2 new input elements. Do this twice : **Add a widget \> Basics \> Input**

- Affect each input element to a preArgs (for example : Pad\_X and Pad\_Y)

- Set this value to Pad\_X : **#{@{xy\_1}[0]}**  
It returns the abscissa value from the XY widget.

- And this value to Pad\_Y : **#{@{xy\_1}[1]}**  
= the ordinate value from the XY widget.

That's done.

An example with Tidal :

```
d1 $ sound "bev" # distort (cF 0 "pad_X") # accelerate (cF 0 "pad_Y")

```

You can now control both parameters in real time 🙂  
I let you imagine the world of awesomeness made possible with the multiXY widget !

---

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [2 June 2020 19:07 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/10 "2020-06-02T19:07:11Z")

</div>

If you have an incoming control value from 0 to 1, then you can use it to select a function from a list:

```haskell
d1 $ selectF (cF0 "pad_X") [id, fast 2, hurry 2, every 3 (iter 4)]
  $ sound "bd sn mt ht"

```

To use it as a time pattern, for example the first input to 'fast', you can use `cT`:

```haskell
d1 $ fast (range 1 4 $ cT0 "pad_Y") $ sound "bd mt ht lt"

```

By the way `cF` takes a default value, e.g. `cF 0 "foo"` to use the 'foo' pattern, or `0` if it's not yet set.

`cF_ "foo"` is the same but doesn't take a value, it just returns silence until the "foo" pattern is set.

`cF0` is the same as `cF 0`

---

<div class="post-metadata">

**Author:** ![ghales](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghales/32/2171_2.png) [@ghales](https://uzu.lurk.org/u/ghales)\
**Post date:** [2 June 2020 20:09 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/11 "2020-06-02T20:09:07Z")

</div>

I had no idea this was possible. That's brutal.  
You should also be able to pick samples / synths using it, too, right? Like:

```haskell
d1 $ n "0(3,8)"
  # (selectF (cF0 "pad_X") . map s) ["bd", "sn", "superpiano"]

```

---

<div class="post-metadata">

**Author:** ![ben](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ben/32/362_2.png) [@ben](https://uzu.lurk.org/u/ben)\
**Post date:** [2 June 2020 22:12 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/12 "2020-06-02T22:12:29Z")

</div>

> [@yaxu](#):
>
> ```haskell
> d1 $ selectF (cF0 "pad_X") [id, fast 2, hurry 2, every 3 (iter 4)]
> $ sound "bd sn mt ht"
> 
> ```

This is amazing.

It seems even more useful to send an integer over OSC so that we can pick the functions by whole number (at least this was my small discovery):

```
d1 $ pickF (cI0 "testI") [id, fast 2, hurry 2, every 3 (iter 4)]
  $ sound "bd sn mt ht"

```

PS: How is everyone getting the syntax highlighting in the forum?

---

<div class="post-metadata">

**Author:** ![ghales](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghales/32/2171_2.png) [@ghales](https://uzu.lurk.org/u/ghales)\
**Post date:** [2 June 2020 22:20 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/13 "2020-06-02T22:20:37Z")

</div>

Type "```" (unquoted) on lines above and below your actual code ✨

---

<div class="post-metadata">

**Author:** ![a.d.du.nord](https://uzu.lurk.org/user_avatar/uzu.lurk.org/a.d.du.nord/32/586_2.png) [@a.d.du.nord](https://uzu.lurk.org/u/a.d.du.nord)\
**Post date:** [3 June 2020 09:16 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/14 "2020-06-03T09:16:22Z")

</div>

If you set up a XY Controller in Open Stage Control in the way that I explained, think about bypassing the widget's OSC parameters ( **osc \> bypass \> true** ) because it will unnecessarily flood Tidal's console with "unhandled OSC values" (with many decimals).

Also, the 2 inputs which get the separate X and Y values can be settled with the number of decimals you need, and it's a seamless process for Tidal then.

I've set up a multiXY widget this morning (it's like a XY widget but with multiple points). If you're interested, I can give some further explanations to set it up (and it's a monster tool in combination of live coding ahah).

---

<div class="post-metadata">

**Author:** ![ghales](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghales/32/2171_2.png) [@ghales](https://uzu.lurk.org/u/ghales)\
**Post date:** [3 June 2020 12:45 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/15 "2020-06-03T12:45:36Z")

</div>

I'm definitely interested, please share it! I tried the XY Pad and your solution works wonders, it's amazing 🙂  
Thanks a lot for the bypass tip, my console was going nuts without that.

---

<div class="post-metadata">

**Author:** ![a.d.du.nord](https://uzu.lurk.org/user_avatar/uzu.lurk.org/a.d.du.nord/32/586_2.png) [@a.d.du.nord](https://uzu.lurk.org/u/a.d.du.nord)\
**Post date:** [3 June 2020 15:50 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/16 "2020-06-03T15:50:16Z")

</div>

Setting up a multiXY widget in Open Stage Controller :

- **add widget \> Pads \> multiXY**
- Choose the number of points as needed in the menu.
- Create a pair of inputs for each point you've chosen : **add widget \> Basics \> input**
- Affect each input element to a preArgs (e.g : "Pad\_X", "Pad\_Y", "Pad\_2\_X", "Pad\_2\_Y" ).
- Set values to each input element :  
**#{@{multixy\_1}[0]}** with "Pad\_X"  
**#{@{multixy\_1}[1]}** with "Pad\_Y"  
**#{@{multixy\_1}[2]}** with "Pad\_2\_X"  
**#{@{multixy\_1}[3]}** with "Pad\_2\_Y"  
etc... Values are increasing with additional points.
- Don't forget to bypass multiXY widget's OSC

---

<div class="post-metadata">

**Author:** ![cleary](https://uzu.lurk.org/user_avatar/uzu.lurk.org/cleary/32/177_2.png) [@cleary](https://uzu.lurk.org/u/cleary)\
**Post date:** [14 August 2020 19:34 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/17 "2020-08-14T19:34:19Z")

</div>

so after my initial faux pas in the thread and a couple of months of more intensive tidal cycles playing, I've finally come back to this and it looks awesome!

Thanks ghales, your video channel has some really useful stuff, and @a.d.du.nord, that real time control looks like it's going to solve one of the limitations I run across in tidal relatively regularly...

Post new-moon plans forming 😃

---

<div class="post-metadata">

**Author:** ![ghales](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghales/32/2171_2.png) [@ghales](https://uzu.lurk.org/u/ghales)\
**Post date:** [20 August 2020 23:47 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/18 "2020-08-20T23:47:27Z")

</div>

no problem dude! looking forward to see what you come up with 🙂

---

<div class="post-metadata">

**Author:** ![tgirod](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/t/35a633/32.png) [@tgirod](https://uzu.lurk.org/u/tgirod)\
**Post date:** [1 October 2020 19:32 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/19 "2020-10-01T19:32:36Z")

</div>

Hey! I'm playing with Open Stage Control, it's a fantastic piece of software. Looking at the possibilities, there is one thing I'd love to do with it: do some visual feedback on euclidean rythms.

The idea is to use a matrix container and make it a row of `N` leds. Then, it is possible to send messages such as `/matrix/5 1` and it will turn on the led at index 5. Now, that would come in handy to display how a rythm looks like, if it is bound to N steps.

So far, here is what I've got:

First, I followed the Custom OSC tutorial so I can send messages to Open Stage.

```haskell
:{
let osTarget = Target {oName = "openstage",
                       oAddress = "127.0.0.1",
                       oPort = 8080,
                       oLatency = 0.2,
                       oSchedule = Live,
                       oWindow = Nothing}
    osFormats = [OSC "/matrix/{index}" $ ArgList [("led", Nothing)]]
    index = pI "index"
    led = pI "led"
    oscmap = [(osTarget, osFormats),
                   (superdirtTarget, [superdirtShape])]

:}

tidal <- startStream defaultConfig oscmap

```

My Open Stage interface looks like this (the important part here is the row of leds, obviously):

![control](https://club.tidalcycles.org/uploads/default/original/2X/0/0cda36ad4fe7a9d534ff6df1807440ee571e4988.png)

Now, to control that row of leds, I can do this:

```haskell
d1 $ index (run 16) # led "1 0 0 1" -- your sequence of 1 and 0 goes here

```

Now, if I use an euclidean rythm:

```haskell
d1 $ index (run 16) # led "1(3,16)"

```

This will turn on led `[0,5,10]` as expected, but it won't affect the other steps, so it won't "clean" them. Snooping around I found there are a bunch of euclid functions, such as `euclidInv`, which led me to this:

```haskell
d1 $ index (run 16) # (euclid 3 16 $ led 1)
d2 $ index (run 16) # (euclidInv 3 16 $ led 0)

```

That one will do the cleaning trick, but I'm sure there is a clean one-liner somewhere and I can't see it...

---

<div class="post-metadata">

**Author:** ![tgirod](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/t/35a633/32.png) [@tgirod](https://uzu.lurk.org/u/tgirod)\
**Post date:** [1 October 2020 19:49 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/20 "2020-10-01T19:49:02Z")

</div>

Awwwwww yisssssss

```haskell
d1 $ index (run 16) # (euclidFull beats 16 (led 1) (led 0))

```

As usual, just after posting a question, I find the answer 😃 I guess writing it down helps to reframe the problem...

EDIT: ok so the final version is this:

```haskell
let beats = cI 0 "beats"
    shift = cI 0 "shift"
in d1 $ index (run 16) # (rot (-shift) $ euclidFull beats 16 (led 1 # s "bd") (led 0))

```

With this, I can control the number of beats and the offset from the Open Stage interface, and have the led pattern update in realtime. It would be even better if the whole led pattern could update at once, but I guess the progressive refresh is good enough!

---

<div class="post-metadata">

**Author:** ![ghales](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghales/32/2171_2.png) [@ghales](https://uzu.lurk.org/u/ghales)\
**Post date:** [20 November 2020 20:45 UTC](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283/21 "2020-11-20T20:45:56Z")

</div>

I need your Open Stage Control CSS really bad :~~  
that print looks friggin awesome. how'd you do it?

[Next page](https://uzu.lurk.org/t/open-stage-control-tidalcycles/1283.md?page=2)
