You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63-16Lines changed: 63 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,57 +9,56 @@ Claude is built around a standard *client-server* architecture, in which the ser
9
9
More specifically, the Claude server creates a window in which it renders a simple rectangle using OpenGL.
10
10
Hence, the content of the window can be customized using a *fragment shader* provided as input.
11
11
12
+
You can modify the fragment shader while Claude is running:
13
+
whenever you save this file, the changes will apply in the window.
14
+
12
15
The Claude server - as its name indicates - also creates a server process that listens for any incoming messages.
13
16
These messages are used to modify the fragment shader's *uniforms*.
14
17
Claude clients connect to the server process and send messages to change uniform values.
15
18
16
-
> Note: for now only uniforms of type *float* are supported. This should change soon.
17
-
18
19
How does that make it an audio-visual synchronization tool?
19
20
Several audio live-coding environments work in the exact same way: by connecting to a server in charge of "making sounds" and regularly sending it messages using a *clock* system.
20
21
Therefore, by creating Claude clients in these audio live-coding environments, we can use the same clock to update our fragment shader's uniform, giving the impression that the visuals are synchronized with the audio.
21
22
22
-
Currently Claude is available in only one live-coding environment: **Sardine**.
23
+
Currently Claude is available in only one live-coding environment: [Sardine](https://github.com/Bubobubobubobubo/sardine).
23
24
It can be used as a regular *sender*, thus allowing to take advantage of the *Sardine Pattern Language* for writing uniform values to send.
24
25
25
26
## Install
26
27
27
28
See [INSTALL](INSTALL.md).
28
29
29
-
## First test with telnet
30
+
## Usage
30
31
31
-
To test the installation of Claude, start by simply launching a Claude server:
32
+
### First test with telnet
32
33
34
+
To test the installation of Claude, start by simply launching a Claude server:
33
35
```
34
36
cd Claude
35
37
python -m claude_server
36
38
```
39
+
A window should open, displaying an animated wave.
37
40
38
41
Then, in another terminal, connect to the server using the *telnet* utility:
39
-
40
42
```
41
43
telnet 127.0.0.1 65432
42
44
```
43
45
44
46
You can now send messages to the server, try the following ones and see what happens in Claude's window:
45
-
46
47
```
47
-
freq 5
48
-
amp .1
49
-
amp .4
50
-
freq 1
51
-
...
48
+
f freq 5
49
+
f amp .1
50
+
f water 1 0 0
51
+
i nb_waves 3
52
52
```
53
53
54
-
By default the Claude server uses the [wave](resources/wave.frag) shader, which has two uniforms: `freq` (frequency) and `amp` (amplitude).
55
-
These two parameters allow you to tweak the sine wave you are visualizing on screen.
54
+
By default the Claude server uses the [wave](resources/wave.frag) shader, which has a few uniforms for controlling the output.
55
+
These parameters allow you to tweak the wave(s) you are visualizing on screen.
56
56
57
-
## Using Claude in Sardine
57
+
###Using Claude in Sardine
58
58
59
59
Once the Claude extension is installed in Sardine, a Claude client will be initialized when you start a new session.
60
60
61
61
You can then use the `Claude(...)` alias to send messages to the Claude server:
62
-
63
62
```python
64
63
@swim
65
64
defwave(p=2, i=0):
@@ -70,3 +69,51 @@ def wave(p=2, i=0):
70
69
71
70
This alias takes two positional arguments, the uniform name and value, followed by the usual Sardine send parameters (iterator, divisor, rate).
72
71
Note that you can use patterns for the value argument, thus giving great flexibility during live-coding sessions.
72
+
73
+
In the previous example, the uniforms sent were simply floats, but we can also send vectors (up to 4 dimensions):
74
+
```python
75
+
@swim
76
+
defwave(p=2, i=0):
77
+
Claude('water', ['.2 1 .5', 0, '1 .2'], i=i)
78
+
again(wave, p=2, i=i+1)
79
+
```
80
+
81
+
Moreover, another optional argument lets us specify the *datatype* that we want to use.
82
+
This argument is called `datatype` but it can be replaced by its alias `dt`:
83
+
```python
84
+
@swim
85
+
defwave(p=2, i=0):
86
+
Claude('nb_waves', '1 2 3 4 3 2', dt='i', i=i)
87
+
again(wave, p=2, i=i+1)
88
+
```
89
+
90
+
> Note: for now only the float and integer datatypes are supported ('f' and 'i').
91
+
> The default datatype is float, hence it is not necessary to specify it.
92
+
93
+
### Shader live-coding
94
+
95
+
The `claude_server` application has a few configuration options that can be detailed with:
96
+
```
97
+
python -m claude_server -h
98
+
```
99
+
100
+
The two most important options are `--res` and `--frag`, which allow you to pass in and use your own fragment shader.
101
+
102
+
Claude is designed for live-coding: you can edit your fragment shader while Claude is running, and every time you save it Claude will update its content.
103
+
104
+
Feel free to use the [template shader](resources/template.frag) and [utilities](resources/utils/glsl) provided.
105
+
106
+
## Contributions
107
+
108
+
Claude is at an early development stage, and we're actively seeking contributors to help enhance the project.
109
+
110
+
Contributions can take many forms:
111
+
- general feedback
112
+
- bug reports
113
+
- features requests
114
+
- code improvements
115
+
- documentation
116
+
- tool design ideas
117
+
- demos and tutorials.
118
+
119
+
There is no official communication channel yet, so please use GitHub issues.
0 commit comments