summaryrefslogtreecommitdiff
path: root/examples/live
diff options
context:
space:
mode:
Diffstat (limited to 'examples/live')
-rw-r--r--examples/live/README.md20
-rw-r--r--examples/live/test/live.script6
2 files changed, 20 insertions, 6 deletions
diff --git a/examples/live/README.md b/examples/live/README.md
index ea62cec..781fc7a 100644
--- a/examples/live/README.md
+++ b/examples/live/README.md
@@ -1,7 +1,8 @@
# live
A program typed over its own picture, and heard, in pardes's editor
-(helix's keys, the language's grammar colouring it). Each line names an
+(helix's keys, the language's grammar colouring it and drawing the name
+each line defines a size larger). Each line names an
expression; the `out` line is what you hear (-1..1), the `color` line what
you see. At every keystroke that leaves a program that parses, the
program is compiled into two tapes of at most 128 instructions, and one
@@ -110,14 +111,21 @@ i; State keeps the editor's value (pardes-editor: 39 KiB of plain data,
4 KiB of text), both tapes, the probe's, the problem, the drag and the
time. grammar/grammar.js, generated into the committed grammar/src/parser.c,
is the same language for tree-sitter: its parse colours the text
-(queries/highlights.scm, in pardes's orchard theme), gives Alt-o its
-nodes and a new line its indent (queries/indents.scm). The tapes
+(queries/highlights.scm, in pardes's orchard theme) and sizes a
+definition's name (that query's `(definition name: (name))`, 1.2 times
+the rest), gives Alt-o its nodes and a new line its indent
+(queries/indents.scm). The code is one sketchbook paragraph (`f.paragraph`,
+a span a run of one class), and every range, caret and mark sits where
+`sk.text.places` lays its byte out; `update` finds the number under a
+press with the same places, so a mixed size moves nothing out of step.
+The canvas is the window's pixels, so the text is never scaled. The tapes
go to the GPU as data: the color tape as picture.frag's uniforms, the out
tape (with the one it replaces, for the crossfade) in a storage buffer for
synth.comp, both including shaders/vm.glsl, a loop over the tape with a
switch per op. No shader is compiled after the first frame, so typing
-never stalls one. A color tape over 64 instructions is drawn at half
-resolution: on an RTX 3050, 128 instructions took 2.7 ms at 1280x720 and
-0.85 at half; 60 took 1.4 at full. The sound is `pub const audio_pull =
+never stalls one. The picture is drawn at most 720 rows high and scaled
+to the window, and a color tape over 64 instructions at half that: on an
+RTX 3050, 128 instructions took 2.7 ms at 1280x720 and 0.85 at half; 60
+took 1.4 at full. The sound is `pub const audio_pull =
256` and a block a frame, as much as keeps the host's lead queued: a
change is heard a pull or so after the frame that made it.
diff --git a/examples/live/test/live.script b/examples/live/test/live.script
index 0d4b0c2..f39275d 100644
--- a/examples/live/test/live.script
+++ b/examples/live/test/live.script
@@ -85,6 +85,12 @@ expect probe.len 0
# 10 pixels a character, the name `out` a step larger at 12, its line 26
# high) pressed and dragged 40 pixels right is 230, then 12 left of where
# it was pressed is 217; the program follows; the drag is one step to undo.
+# Pressed 6 pixels left, where 220 began when every character was 10
+# pixels, it is the space before it: nothing drags.
+down 181 27
+move 221 27
+up 221 27
+expect out.code[1].a 1130102784
down 187 27
move 207 27
move 227 27