tomara-x / quartz

visual programming and dsp playground
https://codeberg.org/tomara-x/quartz
Apache License 2.0
90 stars 3 forks source link

documentation #59

Closed tomara-x closed 7 months ago

tomara-x commented 9 months ago
tomara-x commented 9 months ago
modes

#### modes 1. edit: (press `e` or `esc` in any other mode) interact with entities / execute commands 2. draw: (press `d` in any other mode) draw new circles 3. connect: (press `c` in any other mode) connect entities target: (hold `t` in connect mode) target an entity from another

tomara-x commented 9 months ago
commands

#### return-terminated: ##### file io `:e` edit (open) a scene file (in the assets path and without extension) `:w` write(save) a scene file (same) ##### set values (these can take an optional entity id. `:set n 4v0 42` will set the num of entity 4v0 to 42) if no id is provided they set the value of selected entities `:set n` set the num value of selected entities `:set r` set radius `:set x` set x position `:set y` set y position `:set z` set z position (this controls depth. what's in front of what) `:set h` set hue value [0...360] `:set s` set saturation [0...1] `:set l` set lightness [0...1] `:set a` set alpha [0...1] `:set v` set number of vertices (3 or higher) `:set o` or `:set rot` or `:set rotation` set rotation [-pi...pi] `:set op` set op (use shortcut `o`) `:set ord` or `:set order` set order (use `[` and `]` to increment/decrement order) `:set arr` or `:set array` set the array (space separated, no commas!) `:set tar` or `:set targets` set targets (space separated id's) (if nothing is selected, the first entity gets the rest of the list as its targets) `:tsel` target selected (`:tsel 4v2` sets selected entities as targets of entity 4v2) ##### other `:lt` set link type of hole (use shortcut `l`) `:ht` toggle open a white hole (by id) #### immediate: ##### run mode switching `d` go to draw mode `c` go to connect mode ##### drag modes what happens when dragging selected entities, or when arrow keys are pressed exclusive: `ee` drag nothing (default) `et` drag translation (move entity) `er` drag radius `en` drag number `eh` drag hue `es` drag saturation `el` drag lightness `ea` drag alpha `eo` drag rotation `ev` drag vertices (only changed with arrow keys) add a drag mode: (drag multiple things at the same time) `Et` add translation `Er` add radius `En` add num `Eh` add hue `Es` add saturation `El` add lightness `Ea` add alpha `Eo` add rotation `Ev` add vertices ##### white hole (those are not very useful now) `ht` toggle open status `hf` open for one frame ##### shortcuts `o` shortcut for `:set op ` `l` shortcut for `:lt ` ##### info texts `II` spawn info texts for selected entities `IC` clear info texts `ID` view entity id in info texts ##### audio node info `ni` number of inputs the selected entity's audio node has `no` number of outputs the selected entity's audio node has `np` print info about the audio net in the selected entity ##### inspect commands: `ii` entity id's `in` number values `ira` radius values `ix` x position `iy` y position `iz` z position `ih` hue value `is` saturation `il` lightness `ial` alpha `iv` vertices `iro` rotation `ior` order `iop` op `iar` array `it` targets `iL` hole link type `iO` white hole open status ##### selection: `sa` select all `sc` select all circles `sh` select all holes ##### visibility `vc` toggle circle visibility `vb` toggle black hole visibility `vw` toggle white hole visibility `va` toggle arrow visibility `vv` show all ##### other `quartz` shhh!

tomara-x commented 9 months ago
you africans, please listen to me as africans
and you non-africans, listen to me with open mind

remember playfulness? what happened?

tomara-x commented 9 months ago
link types

link types: - `n` or `-1` : num - `r` or `-2` : radius - `x` or `-3` : x position - `y` or `-4` : y position - `z` or `-5` : z position - `h` or `-6` : hue - `s` or `-7` : saturation - `l` or `-8` : lightness - `a` or `-9` : alpha - `ord` or `-10` : order (you can read/write the order of a circle, but once something hits order 0, it won't process anymore, so you have to increment manually (using `]`) it's kinda like locking your keys inside) - `v` or `-11` : vertices - `o` or `-12` : rotation - `A` or `-13` : array - `0` usually means audio network (or nothing) generally a 0 to 0 connection is gonna do nothing, but when connecting networks, the black hole is type 0, and the white hole is type (positive number)

tomara-x commented 9 months ago
order

order: every circle has an order (0 or higher). things in order 0 do nothing. each frame, every circle with a positive order gets processed (does whatever its op defines) this processing happens.. you guessed it, in *order* we process things breadth-first. so when a circle is processed, all its inputs must have their data ready (they processed in this frame) to make sure that's the case, their order has to be lower than that of the circle reading their data.... that's probably more confusing than no docs

tomara-x commented 8 months ago

ops (and commands) can have the std math constants in them https://doc.rust-lang.org/std/f32/consts/index.html

tomara-x commented 8 months ago

process is an op that will take its targets and process them in the order they appear in that targets array. it doesn't care about those targets' order. even if they're at order 0, in face it's preferable they are at 0 so you don't cause unexpected things. so for every frame "process" itself is processed, it processes all of its targets in order. combining that with the "reorder" and "rise" ops can allow you to perform things like that in a triggered way. combining that with the ability to store any number of targets (and repeated targets with the "repeat" op) allows for complex logic-time looping :smiling_imp:

aaaaaa fuck i'm terrible at explaining things

just needs a rewrite

mention that those will be processed after the original queue

tomara-x commented 8 months ago

circle anatomy

first, define your terms:

now let's get to the biz: in addition to the shared properties that both circles and holes have (position, color, radius, vertices) a circle holds other things:

tomara-x commented 8 months ago

the amount of policy changes that i've encountered in the past 4 months alone is laughable i thought you'd be happy for me, catra

tomara-x commented 8 months ago

cargo r --features inspector will build with the inspector enabled

tomara-x commented 7 months ago

targets: a circle has an array of "targets" those are just entity id's. so it's like a "pointer" to another circles or hole. think of it as a one-way wireless connection. some ops make a circle do things to its targets. like del_targets, spin_target, distro, reorder, open_target, close_target (those two work on hole targets)

(they allow some things that aren't easy through normal processing. since circles read their input when they process, while targets are written to when the controller circle is processed instead)

tomara-x commented 7 months ago

hmm.. ditch the tables and use lists for the ops?

tomara-x commented 7 months ago

now slowly describe each node.. thank you amy, you've done good work here