@kairotic/app 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.html +3 -2
- package/kairotic/assistant.cljs +9 -6
- package/kairotic/code.cljs +3 -3
- package/kairotic/docs.mjs +1 -1
- package/kairotic/help.cljs +82 -91
- package/kairotic/library.cljs +4 -3
- package/kairotic/packages/io.mjs +1 -1
- package/kairotic/packages/net.mjs +1 -1
- package/kairotic/packages/rhythm.mjs +22 -0
- package/kairotic/packages/theory/counterpoint.mjs +19 -80
- package/kairotic/packages/theory/mirror.mjs +1 -1
- package/kairotic/packages/theory/soft.mjs +150 -0
- package/kairotic/packages/theory.mjs +3 -15
- package/kairotic/ringaudio.cljs +1 -1
- package/package.json +1 -1
- package/sources.mjs +1 -1
package/index.html
CHANGED
|
@@ -965,7 +965,7 @@ button.act.small { padding: 1px 8px; font-size: 12px; }
|
|
|
965
965
|
<span>signal: <code>phasor~ [hz]</code> · <code>reader~ [x|y|path] [voices] [gate]</code> (position signal 0…1 on the left, buffer on the right; a voice keeps its last value where nothing passes; <code>gate</code> adds one outlet per voice, 1 where it sounds, 0 where not) · <code>sig~ [value]</code> · <code>osc~</code> and <code>gain~</code> take a signal on their frequency / factor · trajectories: <code>reader path [stroke]</code> (0…1 along a stroke → [x y])</span>
|
|
966
966
|
<span>Claude: the <b>Claude</b> tab, or <code>(ask-component "a slow LFO with its waveform drawn")</code> · with a component chosen in the Components tab, “change the selected component” · it uses your own Claude account</span>
|
|
967
967
|
<span>packages: writing a class of an official package brings the package into the work, as one component box pinned to its version · <code>@kairotic/synth</code>: <code>adsr~ [a d s r]</code>, <code>synth~</code> · <code>@kairotic/spatial</code>: <code>pan~ [pos]</code>, <code>space~ [x y]</code> · <code>@kairotic/analysis</code>: <code>pitch~</code>, <code>onset~</code>, <code>chroma~</code>, <code>features~</code>, <code>spectrum~</code> · <code>(packages)</code> · <code>(add-package! "@kairotic/synth")</code> · a component uses the core through <code>api/…</code> (<code>api/clamp</code>, <code>api/worklet-node</code>…)</span>
|
|
968
|
-
<span>annotations (Annotate, above the patch): <code>(mark :notes {:kind :arrow :pts [[:b1 120 10] [:b4 -6 10]]})</code> · <code>(mark :notes {:kind :text :at [:patch 300 40] :txt "…"})</code> (points anchored to a box, <code>[:bN dx dy]</code>, or to the paper) · <code>(move-mark :a1 20 0)</code> · <code>(unmark :a1)</code> · <code>(layer :notes {:z :under :show #{:present}})</code> · <code>(project :b9 :viz [40 40 800 480])</code> · <code>(annotate :arrow)</code> · drawing: <code>draw [w h]</code> (shapes from messages: <code>msg circle 40 40 10 accent hit sun</code>) · theory: <code>pcclock</code> <code>fourier</code> <code>tonnetz</code> <code>euclid</code> (<code>@kairotic/
|
|
968
|
+
<span>annotations (Annotate, above the patch): <code>(mark :notes {:kind :arrow :pts [[:b1 120 10] [:b4 -6 10]]})</code> · <code>(mark :notes {:kind :text :at [:patch 300 40] :txt "…"})</code> (points anchored to a box, <code>[:bN dx dy]</code>, or to the paper) · <code>(move-mark :a1 20 0)</code> · <code>(unmark :a1)</code> · <code>(layer :notes {:z :under :show #{:present}})</code> · <code>(project :b9 :viz [40 40 800 480])</code> · <code>(annotate :arrow)</code> · drawing: <code>draw [w h]</code> (shapes from messages: <code>msg circle 40 40 10 accent hit sun</code>) · theory: <code>pcclock</code> <code>fourier</code> <code>tonnetz</code> (<code>@kairotic/theory</code>) · rhythm: <code>euclid</code> <code>necklace</code> (<code>@kairotic/rhythm</code>) · data: <code>fetch</code> (a URL, kept in the work) <code>edn</code> (any value as a tree) (<code>@kairotic/data</code>)</span>
|
|
969
969
|
<span>presentation: <code>(present :b4 x y)</code> · <code>(present :b4)</code> · <code>(present-in-place :b3 :b4)</code> · <code>(resize :b3 640 300)</code> · <code>(side-panel false)</code> · <code>(release)</code> · <code>(forget-points [["id" 3]])</code> · <code>(store-presets! :b18)</code> · <code>(unpresent :b4)</code> · <code>(presentation true)</code> · a sub-patch with presented boxes is a panel of them · <code>(send-to! :b7.b4 0.5)</code></span>
|
|
970
970
|
<span><code>(box "text" x y)</code></span>
|
|
971
971
|
<span><code>(connect :b1 0 :b2 0)</code></span>
|
|
@@ -1054,8 +1054,9 @@ window.kairoticVerovio = new Promise(function (resolve, reject) {
|
|
|
1054
1054
|
// Faust (a WebAssembly compiler, about 8 MB) is only downloaded when a faust~ box asks for it.
|
|
1055
1055
|
// A published component is a JavaScript module that exports {class, version, author, license, doc, source}:
|
|
1056
1056
|
// inside claude.ai only npm modules via jsDelivr (or files of this page) can be loaded.
|
|
1057
|
+
// KAIROTIC_BASE: where the app's own files are, when a shell loads it from elsewhere (site/shell.html).
|
|
1057
1058
|
window.kairoticImport = function (url) {
|
|
1058
|
-
return import(new URL(url, document.baseURI).href).then(function (m) { return m.default; });
|
|
1059
|
+
return import(new URL(url, window.KAIROTIC_BASE || document.baseURI).href).then(function (m) { return m.default; });
|
|
1059
1060
|
};
|
|
1060
1061
|
window.kairoticLoadFaust = function () {
|
|
1061
1062
|
return import("https://cdn.jsdelivr.net/npm/@grame/faustwasm@0.18.5/dist/esm-bundle/index.js")
|
package/kairotic/assistant.cljs
CHANGED
|
@@ -421,17 +421,20 @@ Rules:
|
|
|
421
421
|
on the left), `tonnetz` (triads and the path of the harmony; the triad as :C, :am… on the left); they take
|
|
422
422
|
lists of pitches in Hz (as a keyboard or midiin sends them; MIDI or 0…11 with the word midi: `pcclock midi`),
|
|
423
423
|
notes one by one, or a chroma from `chroma~`; pressing a pitch class sends it (right).
|
|
424
|
-
Counterpoint in the same package: `comes [system] [mode]` (
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
424
|
+
Counterpoint in the same package: `comes [system] [mode] [speed]` (the comes reads the dux at a speed: 1 a
|
|
425
|
+
canon, 0.5 an augmentation, −1 a crab written from both ends to the middle; `inverted` upside down, with −1 a
|
|
426
|
+
table canon. You play the dux, in Hz or with midi: the Hz of both voices on 0 after their voice ids on 1, for one
|
|
427
|
+
synth~ 0→0 1→1; the futuribles on 2, where the work is on 3, the finished work as a tree on 4, for a tree box;
|
|
428
|
+
:engine plays alone; `live` on a pulse). The words name a system (diatonic, meantone, septimal31, pentatonic) and one of its modes (dorian…,
|
|
429
429
|
penta-A…), in any order. Orders are keywords: msg :engine, not msg engine.
|
|
430
|
-
Rhythm
|
|
430
|
+
Rhythm as geometry (package @kairotic/rhythm, it comes by itself): `euclid k n [rotation] [bars]` (a Euclidean rhythm drawn as a necklace: a musical
|
|
431
431
|
tree on 0, for a tree box, with an :rtm whose shares are the intervals between onsets; the :rtm map alone on
|
|
432
432
|
1; the pulses as 0/1 on 2). Its right inlet (cold) gives the pitches the notes take in turn (a keyboard's
|
|
433
433
|
keys in Hz, a melody string, {:pitches …}, a pattern {:note […]}); [:k 5] [:n 16] [:rotation 2] [:bars 4]
|
|
434
434
|
[:meter \"3/4\"] change it, a bang sends it.
|
|
435
|
+
`necklace [n]` takes a rhythm (euclid's pulses, intervals [3 3 2], box notation \"x..x..x.\", an :rtm map or
|
|
436
|
+
a tree), draws it with its axes of symmetry, is an editor (press a pulse, :complement, [:rotate 1], [:n 12]),
|
|
437
|
+
sends as euclid on 0–2 and its measures on 3 ({:ivec :evenness :even :deep :flat :axes :gap :oddity :euclid}).
|
|
435
438
|
- The outside (package @kairotic/io, it comes by itself; listening while ▶ runs): `midiin` (MIDI in: Hz and
|
|
436
439
|
voice ids for synth~ like a keyboard, and every event as a map {:type :note :freq :amp :gate …}),
|
|
437
440
|
`midiout [mpe]` (Hz after voice ids, or events, to a MIDI port; mpe for microtones), `oscout [target]` and
|
package/kairotic/code.cljs
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
;; ───────── data (with history) ─────────
|
|
15
15
|
|
|
16
16
|
(def empty {:source ""})
|
|
17
|
-
;; a code box may hold a whole package (a component box with every component of @kairotic/
|
|
18
|
-
;; about
|
|
19
|
-
(def max-source
|
|
17
|
+
;; a code box may hold a whole package (a component box with every component of @kairotic/theory is
|
|
18
|
+
;; about 85 000 characters, comes alone 52 000): longer sources are cut, and cut code does not read
|
|
19
|
+
(def max-source 250000)
|
|
20
20
|
|
|
21
21
|
(defn step [d [op & args]]
|
|
22
22
|
(let [d (or d empty)]
|