# No Bounds rehearsals setup
## Install
### Flok
You need to have Node.js v12+ installed. Please follow the instructions on the [Node.js](https://nodejs.org/) website.
Open a terminal and run
```
npm install -g flok-repl
```
### Install ATK for SuperCollider
In your SC IDE evaluate:
```
Quarks.install("https://github.com/ambisonictoolkit/atk-sc3.git");
```
Wait until installation is done. You should see `-> Quark: atk-sc3[4.0.3]` or something like that in your Post Window.
Now, recompile class library (press Ctrl+Shift+L / Cmd+Shift+L). Now, run the following lines:
```
(
Atk.createUserSupportDir;
Atk.openUserSupportDir;
)
```
The second line should open your ATK folder in your file browser. Download the ATK [Kernels](https://github.com/ambisonictoolkit/atk-kernels/releases/download/v1.2.1/kernels.zip) and [Matrices](https://github.com/ambisonictoolkit/atk-matrices/releases/download/v1.0.0/matrices.zip) and unzip them there.
You should have the folders `matrices` and `kernels` in your ATK support folder.
## Usage
### Flok
First, create or join a session at https://flok.clic.cf/
Then, start your REPL by following the instructions. Usually it would be something like this, but with a different session token:
```
flok-repl -H wss://flok.clic.cf -s YjBjNjM4NmItMzY0Ny00MTQ4LTgzMzYtNzg3NWE1MGEwZTNj -t tidal
```
### SuperDirt
Open your SC IDE and start SuperDirt as usual.
Then configure panning to use ATK for binaural sound by evaluating the following 3 blocks separately:
```
(
// Creates an omni encoder and a binaural decoder. This takes some seconds to load...
e = FoaEncoderMatrix.newOmni;
d = FoaDecoderKernel.newCIPIC(12);
)
(
// Redefine the default panning function to use ATK
DirtPan.defaultPanningFunction = { |signals, numChannels, pan, mul|
var sig = FoaEncode.ar(signals.sum * mul, e);
// theta=azimuth, phi=elevation
// angle=pi/2, phi=0 -> push to plane wave
sig = FoaPush.ar(sig, angle: pi/2, theta: pan * pi);
FoaDecode.ar(sig, d);
};
// Reload SuperDirt synthdefs
~dirt.loadSynthDefs;
)
```
You can test if it works for you by running something like this:
```
d1 $ s "hh*16" # pan (slow 4 saw) # speed 0.5
```