libraryextensions/blender/demos/PcWalk.xtl

PcWalk.xtl -- HEX1000's program counter, a video made with the explainer kit (Video.xtl): the 64 addresses of a ROM page as cells in reading order, and the program counter visiting them in the order its shift register steps -- 0 1 3 7 15 31 63 62 ..., never +1 -- each cell lit as it is reached, colored by when, the path drawn behind it. The order is X_eTaL-fpga's Hex1000 library (hx:Order, pinned at FPGA_COMMIT); the first hops are in slow motion and the rest a time-lapse (vd:r_etime), behind a title card, with captions, a cue sheet and subtitles; the same scene fits a YouTube video (1920 by 1080) or a Short (1080 by 1920). Shared by the demo (demos/hex-pc.xtl) and its test. Import: "pw:" u_se< "PcWalk"

source · imports hx: work/fpga/libs/Hex1000/src/Hex1000.xtl; vd: extensions/blender/lib/Video.xtl

The data

ˡorder : Int

value · line 24

order: the addresses the program counter visits from 0, in turn (X_eTaL-fpga's hx:Order); after the last it is back at 0

      "pw:" u̲se< "PcWalk"
      8 t̲ake ᵖʷorder
0 1 3 7 15 31 63 62
ˡorder ← ʰˣOrder

ˡn : Int

value · line 27

n: how many (64, a ROM page)

ˡn ← t̲ally ˡorder

Time

ˡmap : Float

value · line 35

the scene's own seconds: hop k (from 1) at second k - 1, back to 0 at second n. map: the scene's seconds to the video's -- a title card first, the first six hops a second each (slow motion), the other 57 in 5.7 seconds (a time-lapse), the hop back to 0 slower

ˡmap ← 4 2 r̲eshape 0.0 3.5  6.0 9.5  63.0 15.2  64.0 16.2
Used in: ˡat, ˡs̲cene

ˡlength : Float

value · line 38

length: the video's seconds

ˡlength ← 19.5

ˡat : Float

value · line 44

at: the video second of each hop (n), then of the hop back to 0

      "pw:" u̲se< "PcWalk"
      7 t̲ake ᵖʷat
3.5 4.5 5.5 6.5 7.5 8.5 9.5
ˡat ← (ˡmap, (r̲ange ˡn + 1) − 1) ᵛᵈr̲etime 0

Where things are

ˡp̲lace : Any a => (Int, Float) -> a -> Float

function · line 55

(address, y) pw:p_lace 0: x y z of addresses (n by 3), in reading order: 8 a row, 0 at the top left, 1.2 m apart, at depth y

      "pw:" u̲se< "PcWalk"
      (0 9 63, 0.0) ᵖʷp̲lace 0
-4.2 0.0  4.2
-3.0 0.0  3.0
 4.2 0.0 -4.2
ˡp̲lace ← { (a, y) z →
  k ← t̲ally a
  x ← 1.2 × (f̲loat a m̲od 8) − 3.5
  zz ← 1.2 × 3.5 − f̲loat a d̲iv 8
  2 1 t̲ranspose (3 c̲at k) r̲eshape x c̲at (k r̲eshape y) c̲at zz
}

ˡcolors : Float

value · line 64

colors: a color for each hop, by when (deep blue first, orange last: vd:t_one)

ˡcolors ← ((r̲ange ˡn) − 1, 0.0, f̲loat ˡn − 1) ᵛᵈt̲one 0
Used in: ʰcells, ʰpath

ʰcells : Float

value (private) · line 67
ʰcells ← ((ˡorder, 0.0) ˡp̲lace 0) c̲at₂ ((ˡn c̲at 3) r̲eshape 1.0 0.25 1.0) c̲at₂ ˡcolors c̲at₂ (ˡn c̲at 1) r̲eshape 0.0
Used in: ˡs̲cene

ʰpage : Float

value (private) · line 70
ʰpage ← ((ˡorder, 0.0) ˡp̲lace 0) c̲at₂ (ˡn c̲at 7) r̲eshape 1.04 0.3 1.04 70 76 96 1.0
Used in: ˡs̲cene

ʰglowTimes : Float

value (private) · line 74
ʰglowTimes ← 2 1 t̲ranspose (4 c̲at ˡn) r̲eshape (ˡn r̲eshape 0.0) c̲at (ˡn t̲ake ˡat − 1.0 ÷ 30.0) c̲at (ˡn t̲ake ˡat) c̲at ˡn t̲ake ˡat + 0.35
Used in: ˡs̲cene

ʰglowAmounts : Float

value (private) · line 75
ʰglowAmounts ← (ˡn c̲at 4) r̲eshape 0.0 0.0 3.0 1.0
Used in: ˡs̲cene

ʰmarkerAt : Float

value (private) · line 78
ʰmarkerAt ← (1 c̲at (ˡn + 1) c̲at 6) r̲eshape ((ˡorder c̲at 0, -0.2) ˡp̲lace 0) c̲at₂ ((ˡn + 1) c̲at 3) r̲eshape 1.3 0.4 1.3
Used in: ˡs̲cene

ʰpath : Float

value (private) · line 81
ʰpath ← ((ˡorder, -0.3) ˡp̲lace 0) c̲at₂ (((1 d̲rop ˡorder) c̲at 0, -0.3) ˡp̲lace 0) c̲at₂ ˡcolors c̲at₂ (ˡn c̲at 1) r̲eshape 0.05
Used in: ˡs̲cene

ʰpathShown : Float

value (private) · line 84
ʰpathShown ← 2 1 t̲ranspose (2 c̲at ˡn) r̲eshape (ˡn t̲ake ˡat) c̲at ˡn r̲eshape ˡlength
Used in: ˡs̲cene

Words

ˡtitle : Char

value · line 89

the title card's title and subtitle

ˡtitle ← "HEX1000"

ˡsubtitle : Char

value · line 91

the subtitle

ˡsubtitle ← "its program counter, one hop at a time"

ˡcaptionTexts : Char

value · line 95

captionTexts: the captions, | between them -- the first hops and their count from the data

ˡcaptionTexts ← "slow motion: PC goes " c̲at (f̲ormat 7 t̲ake ˡorder) c̲at "|time-lapse: all " c̲at (f̲ormat ˡn) c̲at " addresses, each once|then back to 0: a ROM page in shift-register order"

ˡcaptionTable : Float

value · line 98

captionTable: each caption's from and to (video seconds), white

ˡcaptionTable ← 3 5 r̲eshape 3.6 9.4 255 255 255  9.7 15.1 255 255 255  15.4 19.5 255 255 255

ʰcardTable : Float

value (private) · line 101
ʰcardTable ← 1 8 r̲eshape 0.0 3.2 255 255 255 18 22 44

ˡcueTexts : Char

value · line 105

the cues: the title card's and the captions' texts and their times (for vd:c_ues and vd:s_rt)

ˡcueTexts ← ˡtitle c̲at ": " c̲at ˡsubtitle c̲at "|" c̲at ˡcaptionTexts
Used in: _

ˡcueTable : Float

value · line 107

their from and to (video seconds)

ˡcueTable ← (2 t̲ake₂ ʰcardTable) c̲at 2 t̲ake₂ ˡcaptionTable
Used in: _

The scene

ʰsky : Int

value (private) · line 112
ʰsky ← 8 10 18
Used in: ˡs̲cene

ʰcamTimes : Float

value (private) · line 115
ʰcamTimes ← -3.5 6.0 63.0 66.0
Used in: ˡs̲cene

ʰcamFrom : Float

value (private) · line 116
ʰcamFrom ← 4 3 r̲eshape -2.0 -1.12 1.5  -1.0 -1.02 0.5  1.5 -1.02 -0.5  2.0 -1.06 0.0
Used in: ˡs̲cene

ˡs̲cene : Num a => a -> Char

function · line 123

pw:s_cene size: the whole script Blender runs, before its stills or video: the stage at that size (width height: vd:landscape or vd:shorts), the page, the cells, the marker and the path keyed by the data, the camera far enough back for the grid and the captions to fit (vd:f_it), the title card, the captions

ˡs̲cene ← { size →
  w ← 1 s̲elect size
  h ← 2 s̲elect size
  d ← (w, h, 35, 11.0, 15.0) ᵛᵈf̲it 0
  aim ← 0.0 0.0 -1.6
  eyes ← (4 3 r̲eshape aim) + ʰcamFrom × 4 3 r̲eshape 1.0 c̲at d c̲at 1.0
  ((ᵛᵈhead c̲at ((w, h, 30, ˡlength, ʰsky, 35) ᵛᵈs̲tage 0)) c̲at
    ((("page", ʰpage) ᵛᵈo̲utlines 0) c̲at (("cells", ʰcells) ᵛᵈb̲oxes 0) c̲at ("cells", ʰglowTimes, ʰglowAmounts) ᵛᵈg̲lows 0) c̲at
    ((("pc", 1 10 r̲eshape (6 t̲ake r̲avel ʰmarkerAt) c̲at 255 255 255 2.0) ᵛᵈo̲utlines 0) c̲at ("pc", ˡat, ʰmarkerAt) ᵛᵈm̲oves 0) c̲at
    ((("path", ʰpath) ᵛᵈl̲ines 0) c̲at ("path", ʰpathShown) ᵛᵈs̲hown 0) c̲at
    (((ˡmap, ʰcamTimes) ᵛᵈr̲etime 0, eyes, 4 3 r̲eshape aim) ᵛᵈc̲amera 0) c̲at
    ((ˡtitle, ˡsubtitle, ʰcardTable) ᵛᵈc̲ards 0) c̲at (ˡcaptionTexts, ˡcaptionTable) ᵛᵈc̲aptions 0)
}
Used in: _