# Playing Tidal live with absolutely no GUI

**URL:** <https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553>\
**Category:** Uncategorized\
**Created:** [9 October 2021 22:11 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553 "2021-10-09T22:11:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![geikha](https://uzu.lurk.org/user_avatar/uzu.lurk.org/geikha/32/2701_2.png) [@geikha](https://uzu.lurk.org/u/geikha)\
**Post date:** [9 October 2021 22:11 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/1 "2021-10-09T22:11:21Z")

</div>

### This is a picture of the algorave held here in the Recoleta Cultural Center of Buenos Aires, the 1st of October:

The event was organized by @irisS.

* * *

 ![Playing with No GUI](https://club.tidalcycles.org/uploads/default/original/2X/1/109a0be575ff32276d5d5c9ccf6732bd489b3aa7.jpeg)

- Me, playing with no GUI, live.

* * *

## Why

I didn't have a functional laptop or notebook until recently. I always had to borrow other livecoders' computers while on live events. While moving out of my previous house into my grandpa's house, I ended up finding an old HP laptop (HP Pavilon Dv4) he used to work with. Problem was this 2007? computer has merely: 250GB storage, 2GB RAM, Dual-core 2GHz processor... so yeah, you get the gist of it. I installed lubuntu and SCIDE + VSCode worked ok, but not as smooth as I wanted it to be. So while thinking about the lightest setup possible, I thought about learning vim. At first I wanted to simply avoid VSCode given its pseudo-IDE capabilities were taking various resources. But I ended up going all in, completely deleting the GUI and coding on CLI mode.

* * *

## How

### O.S. & Terminal

I'm using Ubuntu and its TTY1-6 terminals (if you're on any Ubuntu flavour rn and don't know what I'm talking about, press `Ctrl+Alt+F1`, then `Alt+F7` to go back to the GUI).  
You could still do everything here with a single terminal and tmux tho. Note that you can go into these TTYs without even logging in inside the startup screen, saving even more resources. _No log-in tidal!_

### Code Editor

I decided to use neovim, and installing [vim-tidal](https://github.com/tidalcycles/vim-tidal) on terminal mode.

### Launching Jack

I launch jack from a terminal, instead of letting SuperCollider do it. This way I can set my own sample rate and bit depth, lowering the resource demand. SuperCollider's defaults are 48 kHz and 32 bits. I lowered this to 44.1 kHz and 16 bits with the following launch:

```bash
$ jackd -d alsa -r 44100 -S

```

### Launching SuperCollider

You could use [scvim](https://github.com/supercollider/scvim), but I decided not to. I don't really need livecoding supercollider and I didn't want to install ruby just to get it to work. So I wrote my own custom SC boot file and launched it with the following command:

```bash
$ QT_QPA_PLATFORM=offscreen sclang ~/Documents/tidal/CCR/CCR-boot.scd 

```

I'm not sure why, but you need to add the QT option for it to work on a TTY. Although from some other reason SuperCollider (at least version 3.11.2) runs the file and doesn't let you use the interpreter afterwards. I came across [this issue](https://github.com/supercollider/supercollider/issues/3297).

**EDIT:** The reason for this is that the SCDoc system relies on generating GUIs when separated from the IDE. The same goes for the plotting functions. So SCLang always tries to load a GUI system.

### Zoom-in and zoom out (sort of)

You may want to higher the font size in your terminal. Here's the command you need:

```bash
$ sudo dpkg-reconfigure console-setup

```

### Volume config

I also like to have the alsa audio mixer open in a terminal:

```bash
$ alsamixer

```

### Other percs of using neovim for Tidal

#### Snippets

It's super useful and time saving having snippets for the code you know you'll end up writing. Or maybe even some patterns. I used [UltiSnips](https://github.com/SirVer/ultisnips) as recommended to me by @munshkr (creator of vim-tidal!).

Some examples:

```haskell
snippet dohush
do
        hush
        all $ id
        setbpm ${1: 130}
endsnippet

snippet dstruct
d0 ${5} $ struct "t" $ note "${3: 0}" # octave ${2: 5} # s "${1}" # legato 1
endsnippet

snippet ukdrums
d1 $ ukswing $ drumM "ukg" [
        "bd ~ [~bd] ~"
        ,"[~sd]*2"
        --,"[~hh oh:1 ~]*4"
        ] ${1}
endsnippet

```

(See my [post about tidal-drum-machines](https://club.tidalcycles.org/t/a-huge-drum-machine-library-for-tidal-71-drum-machines/3408) to see what `drumM` is)

#### Setting up automatic indentation on Vim

Add this to your load file:

```vim
set autoindent
set cindent

```

#### Changing surrounding mini-notation

I installed the [vim-surround](https://github.com/tpope/vim-surround) plugin to be able to change stuff like `[bd sd]` to `<bd sd>`. I also always get confused in the moment and may end up writing stuff like `bd("3 5",8)` instead of `bd([3 5],8)`, and this allows me to correct myself easily.

#### Using multiple tabs

You can load neovim with multiple tabs doing:

```bash
$ nvim -p file.tidal file2.tidal

```

And this config can allow you to change tabs doing `Shift-H` or `Shift-L`

```vim
nnoremap H gT
nnoremap L gt

```

* * *

> Have fun and happy resource saving !

---

<div class="post-metadata">

**Author:** ![geikha](https://uzu.lurk.org/user_avatar/uzu.lurk.org/geikha/32/2701_2.png) [@geikha](https://uzu.lurk.org/u/geikha)\
**Post date:** [10 October 2021 21:48 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/2 "2021-10-10T21:48:22Z")

</div>

### Update

#### Loading files in CLI SuperCollider

A workaround to the interpreter disappearing when loading a file to sclang from bash can be the next one:

1. Open sclang with no file. Remember to use the qt config described above when on a tty.
2. Load the file you want from inside SC with the following:

```supercollider
"/home/username/Documents/whatever/supercolliderfile.scd".load

```

* * *

_Thanks to [alln4tural](https://github.com/alln4tural) who showed me this method after I had totally ignored it and used an unnecesary complex approach, heh_

---

<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:** [13 October 2021 01:01 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/3 "2021-10-13T01:01:22Z")

</div>

Nice one!

The QT env arg is handy, that might simplify some of my ansible install process, bookmarking 🙂

Those vim snippet examples are handy too - I briefly delved into that setup a while ago but didn't get anywhere, I can revisit with specific examples now 🙂

You probably want to check out [Superdirt Lazy Samples Loading](https://club.tidalcycles.org/t/superdirt-lazy-samples-loading/3148) - ie you can still specify many gbs of sample dirs, but superdirt only loads the samples you are using (much memory saving!)

---

<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 February 2022 19:25 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/4 "2022-02-02T19:25:53Z")

</div>

> [@geikha](#):
>
> ### Launching SuperCollider
> 
> ... So I wrote my own custom SC boot file...

I'm having a bit of a dig into this now with auto-launching supercollider from neovim via the vim-tidal plugin, any chance you could share your custom startup file?  
At the moment, just running from the standard terminal I'm getting a core dump almost immediately, but I'm not finding a lot of information to work around it.

I suspect it has to do with the `SC_QT=ON` compile time flags on my default supercollider install (ubuntu) - did you build supercollider from source?

---

<div class="post-metadata">

**Author:** ![geikha](https://uzu.lurk.org/user_avatar/uzu.lurk.org/geikha/32/2701_2.png) [@geikha](https://uzu.lurk.org/u/geikha)\
**Post date:** [2 February 2022 23:44 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/5 "2022-02-02T23:44:52Z")

</div>

i have the original file on my laptop and i'm on my desktop but it's basically the same as the [tidal drum machines boot](https://github.com/ritchse/tidal-drum-machines/blob/main/tdm-sc-boot.scd)  
that and a couple of synthdefs, nothing special

```haskell
(
s = s ? Server.default;

s.waitForBoot {

	~dirt.free;
	~dirt = SuperDirt.new(2, s);
	~numberOfOrbits = 12;

	//~dirt.loadSoundFiles();

	~drumMachinesDir = PathName.new("C:\\Users\\username\\Documents\\Tidal\\tidal-drum-machines\\machines");
	~machines = ~drumMachinesDir.folders; //All drum machines
	/*~machines = ['Linn9000','RolandTR909']; //Selected drum machines
	~machines.do { arg m,i; ~machines[i]=(~drumMachinesDir+/+m) }*/

	(
		~machines.do({
			arg machine;
			var folders = machine.folders;
			postln("LOADING DRUM MACHINE: "++machine.folderName);
			folders.do({
				arg folder;
				~dirt.loadSoundFiles(folder.fullPath,namingFunction: { |x| x.basename.replace("-","")});
			});
		});
	);

	s.sync;
	~dirt.start(57120, 0!~numberOfOrbits);
};
);

```

---

<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:** [3 February 2022 03:34 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/6 "2022-02-03T03:34:21Z")

</div>

I'm still getting my core dump - did you build sc from source?

---

<div class="post-metadata">

**Author:** ![jwaldmann](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jwaldmann](https://uzu.lurk.org/u/jwaldmann)\
**Post date:** [3 February 2022 16:54 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/7 "2022-02-03T16:54:04Z")

</div>

> [@geikha](#):
>
> ... deleting the GUI and coding on CLI mode

[I know it's risky to be ironic in text-only communication. Still, let me try.]

Programming without a graphical editor .. kids these days! What will they discover next? That ABBA made albums prior to 2021?

Anyway the real "CLI mode" for Tidal is `ghci`. Editor is for the weak. See also [xkcd: Real Programmers](https://xkcd.com/378/)

[sarcasm off]

For building an actual non-GUI supercollider, I use `cmake -DSC_QT=OFF` (full build script: [https://gitlab.imn.htwk-leipzig.de/waldmann/computer-mu/-/blob/master/etc/sc/build.sh#L23](https://gitlab.imn.htwk-leipzig.de/waldmann/computer-mu/-/blob/master/etc/sc/build.sh#L23)) See also [Enable running sclang without Qt. · Issue #5420 · supercollider/supercollider · GitHub](https://github.com/supercollider/supercollider/issues/5420).

And yes, running on "weak" hardware is one of the strong points of GNU/Linux (where GNU: tools like bash, emacs, gcc; Linux: the OS kernel). Good for sustainability (don't throw away computer), but, apparently, bad for (parts of) the economy: don't buy new computer. Which you'd only need for running new bloatware. That includes VSCode ..

---

<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:** [3 February 2022 19:44 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/8 "2022-02-03T19:44:48Z")

</div>

> [@jwaldmann](#):
>
> I use `cmake -DSC_QT=OFF`

I rebuilt the debian packages with this flag off yesterday, I've encountered a strange issue where sclang starts fine, I see all my usual mesages with midi detection, and sample registration in superdirt, the JACK ports are configured - ie everything looks "normal"  
However, when I try and play any sample, superdirt is unable to "find" it for playback (despite having registered it moments ago) - which it displays as an error log in the sc output

Have you encountered anything like this?

---

<div class="post-metadata">

**Author:** ![jwaldmann](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jwaldmann](https://uzu.lurk.org/u/jwaldmann)\
**Post date:** [3 February 2022 20:00 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/9 "2022-02-03T20:00:38Z")

</div>

No. - What error, exactly? Or is this the coredump you mentioned earlier? For debugging, try these

- Use `strace sclang` [https://strace.io/](https://strace.io/) to see sc's syscalls (e.g., reading files)
- run `gdb sclang` (hopefully it stops before dumping core, so you can examine the state)
- if you do have a coredump already, `gdb` can read it  
(see option `-c` [Debugging with GDB - Getting In and Out of GDB](https://ftp.gnu.org/old-gnu/Manuals/gdb/html_chapter/gdb_3.html))

Wild guess - the sample is found, but it does not fit in memory? A lot of things can go wrong, e.g., strange characters in the file name, invalid (header) data in the file.

---

<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:** [3 February 2022 20:03 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/10 "2022-02-03T20:03:26Z")

</div>

> [@jwaldmann](#):
>
> is this the coredump you mentioned earlier?

no -

> [@jwaldmann](#):
>
> Wild guess - the sample is found, but it does not fit in memory? A lot of things can go wrong, e.g., strange characters in the file name, invalid (header) data in the file.

The samples all fit in memory - I replaced an scide installation with this, all the samples work fine in scide, it's only when I'm running sclang via the commandline

The error is the standard:

```haskell
no synth or sample named 'arpy' could be found.

```

having literally just registered the sample on startup

---

<div class="post-metadata">

**Author:** ![jwaldmann](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jwaldmann](https://uzu.lurk.org/u/jwaldmann)\
**Post date:** [3 February 2022 20:05 UTC](https://uzu.lurk.org/t/playing-tidal-live-with-absolutely-no-gui/3553/11 "2022-02-03T20:05:53Z")

</div>

Strange. Then I'd next try `strace` to see what files `sclang` actually accesses.
