~pbatch/codex

94b45aec7ebf402fc07b6425ad0042918b76af51 — Paul Batchelor 10 months ago 4c98ebe
kqpangiizk shimmers
3 files changed, 132 insertions(+), 22 deletions(-)

M kqpangiizk/Makefile
M kqpangiizk/mitireez.scm
M kqpangiizk/translate.scm
M kqpangiizk/Makefile => kqpangiizk/Makefile +4 -1
@@ 1,7 1,10 @@
mitireez.mp4: mitireez.scm translate.scm
mitireez.mp4: mitireez.scm translate.scm score.db
	../codex mitireez.scm
	../combine.sh mitireez_tmp.mp4 mitireez.wav mitireez.mp4
	convert mitireez.ppm mitireez.png

score.db: score.txt
	mnotil txt2cdb $< $@

clean:
	$(RM) mitireez.mp4 mitireez.h264 mitireez.wav mitireez.png mitireez_tmp.mp4

M kqpangiizk/mitireez.scm => kqpangiizk/mitireez.scm +113 -15
@@ 1,8 1,12 @@
(load (string-append (mnotop) "/core.scm"))

(load (mnopath "gfx.scm"))
(load (mnopath "kuf.scm"))
(load (mnopath "btprnt.scm"))
(load (mnopath "gst.scm"))
(load (mnopath "gest.scm"))
(load (mnopath "sqlar.scm"))
(load (mnopath "ugens.scm"))

(load "../spektrum.scm")
(load "../skript.scm")
(load "translate.scm")


@@ 10,9 14,6 @@
(define koan #("HISHUM" "CHEKAEJ" "NAEJAETU" "VAIDYV"
               "SHAEBA" "DIBAISAIZ" "TEEJ" "FUMEEG"))

(define (mkspaces words)
  (map (lambda (x) (string-append x " ")) words))

(define (clrsqr pos clr ypos)
  (gfxrectf (* pos 8) ypos 8 8 clr))



@@ 36,38 37,74 @@
  (lvl "param [vargrb zz]")
  (pop))

(define (colorbar pos)
  (btprnt:tr
   (lgrab "bp")
   0 (+ 8 (* pos (- 256 16)))
   192 16
   0 (+ 8 (* pos (- 256 16))) 11))

(define (draw)
  (dup)
  (gfxfill 1)
  (dup)
  ;(shimmer (varget "cnd"))
  (shimmer 0)
  (shimmer (varget "cnd"))
  (clrrow 0 0 (/ 192 8))
  (clrrow 0 (- 256 8) (/ 192 8))

  (gfxrectf (+ 8 8) (+ 16 8) (* 8 (- 4 2)) (* 8 (- 4 2)) 12)

  (lvl "bpfill [bpget [grab bp] 2] 0")
  (lvl (list
        "blngex"
        "[bpget [grab bp] 2]"
        "[grab pat1]" (num2str (+ pos 30))))



  (dup)
  (gfxrectf
   (+ 8 8 (* 4 8))
   (+ 16 (* 4 8) 8)
   (* 8 (- 5 2)) (* 8 (- 5 2)) 12)
  (lvl "bpfill [bpget [grab bp] 3] 0")
  (lvl (list
        "blngex"
        "[bpget [grab bp] 3]"
        "[grab pat1]" (num2str pos)))

  (dup)
  (gfxrectf
   (+ 8 8 (* 4 8) (* 5 8))
   (+ 16 (* 4 8) (* 5 8) 8)
   (* 8 (- 9 2)) (* 8 (- 9 2)) 12)
  (lvl "bpfill [bpget [grab bp] 1] 0")
  (lvl (list
        "blngex"
        "[bpget [grab bp] 1]"
        "[grab pat1]" (num2str (+ pos 30))))

  (dup)
  (gfxrectf
   (+ 8 8 (* 3 8))
   (+ 16 (* 4 8) (* 5 8) (* 9 8) 8)
   (* 8 (- 6 2)) (* 8 (- 6 2)) 12)
  (lvl "bpfill [bpget [grab bp] 4] 0")
  (lvl (list
        "blngex"
        "[bpget [grab bp] 4]"
        "[grab pat1]" (num2str (+ pos 15))))

  (dup)
  (gfxrectf
   (+ 8 8 (* 3 8) (* 6 8))
   (+ 16 (* 4 8) (* 5 8) (* 9 8) (* 6 8) 8)
   (* 8 (- 4 2)) (* 8 (- 4 2)) 12)
  (lvl "bpfill [bpget [grab bp] 5] 0")
  (lvl (list
        "blngex"
        "[bpget [grab bp] 5]"
        "[grab pat1]" (num2str pos)))

  (dup)
  (lvl "bptr [grab bp] 0 0 192 256 0 0 0")


@@ 80,13 117,8 @@
  ; 256 8
  ; 0 (- 256 (* 8 8)) 10)

  ;(dup)
  ;(btprnt:tr
  ; (lgrab "bp")
  ; (- 192 (* 8 6)) 0
  ; 8 256
  ; (- 192 (* 8 6)) 0 11)

  (dup)
  (colorbar (varget "cnd2"))
  (set! pos (+ pos 1))
)



@@ 107,6 139,9 @@
(define (proclaim x y k)
  (skript:text (llvl "bpget [grab bp] 0") x y (koanwordp k)))

(define (args lst)
  (map (lambda (x) (if (number? x) (num2str x) x)) lst))

(define (slabit)
  (gfxnew "gfx" 192 256)
  (lvl "bpnew bp 192 256")


@@ 114,33 149,96 @@
  (lvl "bpset [grab bp] 0 0 0 192 256")
  (btprnt:set "bp" 1 16 96 (* 8 7) (* 8 7))
  (lvl "blkset 49")
  (lvl "blngnew pat1 128")
  (lvl
   (list
    "blngcmp"
    "[grab pat1]"
    "\"x t 32 % + y + abs x t + y - abs 1 + ^ 2 << 5 % !\""))

  (mksound "mitireez.wav" 30)

;; Window 1 (region 2)
  (skript:box (llvl "bpget [grab bp] 0") 8 16 (koanword 0) 4 4)

  (lvl
   (args
    (list
     "bpset" "[grab bp]"
     2
     (+ 8 8)
     (+ 8 16)
     (* 8 (- 4 2))
     (* 8 (- 4 2)))))

;; Window 2 (region 3)
  (skript:box
   (llvl "bpget [grab bp] 0")
   (+ 8 (* 4 8)) (+ 16 (* 4 8)) (koanword 1) 5 5)

  (lvl
   (args
    (list
     "bpset" "[grab bp]"
     3
     (+ 8 8 (* 4 8))
     (+ 8 16 (* 4 8))
     (* 8 (- 5 2))
     (* 8 (- 5 2)))))

;; Window 3 (big window) (region 1)
  (skript:box
   (llvl "bpget [grab bp] 0")
   (+ 8 (* 4 8) (* 5 8))
   (+ 16 (* 4 8) (* 5 8))
   (koanword 2) 9 9)

  (lvl
   (args
    (list
     "bpset" "[grab bp]"
     1
     (+ 8 8 (* 4 8) (* 5 8))
     (+ 8 16 (* 4 8) (* 5 8))
     (* 8 (- 9 2))
     (* 8 (- 9 2)))))

;; Window 4 (region 4)
  (skript:box
   (llvl "bpget [grab bp] 0")
   (+ 8 (* 3 8))
   (+ 16 (* 4 8) (* 5 8) (* 9 8))
   (koanword 3) 6 6)

  (lvl
   (args
    (list
     "bpset" "[grab bp]"
     4
     (+ 8 8 (* 3 8))
     (+ 8 16 (* 4 8) (* 5 8) (* 9 8))
     (* 8 (- 6 2))
     (* 8 (- 6 2)))))


;; Window 5 (terminus) (region 5)
  (skript:box
   (llvl "bpget [grab bp] 0")
   (+ 8 (* 3 8) (* 6 8))
   (+ 16 (* 4 8) (* 5 8) (* 9 8) (* 6 8))
   (koanword 4) 4 4)

  (lvl
   (args
    (list
     "bpset" "[grab bp]"
     5
     (+ 8 8 (* 3 8) (* 6 8))
     (+ 8 16 (* 4 8) (* 5 8) (* 9 8) (* 6 8))
     (* 8 (- 4 2))
     (* 8 (- 4 2)))))


  (proclaim (+ 8 (* 4 8) 8) (* 8 2) 5)
  (proclaim (+ 8 (* 4 8) (* 5 8) 8) (+ 16 (* 4 8)) 6)



@@ 156,9 254,9 @@

  (dup)
  (gfxppm "mitireez.ppm")
  (doit (* 60 10))
  (doit (* 60 30))
  (gfxclose)
  (gfxmp4 "mitireez.h264" "mitireez_tmp.mp4")
)
  )

(slabit)

M kqpangiizk/translate.scm => kqpangiizk/translate.scm +15 -6
@@ 1,8 1,3 @@
(load (string-append (mnotop) "/core.scm"))
(load (mnopath "sqlar.scm"))
(load (mnopath "gest.scm"))
(load (mnopath "ugens.scm"))

(define (open-db-in-monolith)
  (sqlar:opendb "sqlite" (string-append (getenv "SMP_HOME") "/a.db")))



@@ 236,15 231,29 @@
  (att -10)
  (add zz zz)

  (lvl "varnew cnd")
  (regget 0)
  (lvl "rephasor zz 0.25")
  (lvl "expmap zz 3")
  (lvl "rephasor zz 8")
  (lvl "varcpy zz cnd")

  (lvl "varnew cnd2")
  (regget 0)
  (lvl "rephasor zz 0.25")
  (lvl "varcpy zz cnd2")

  (unhold (regget 0))
  (regclr 0)
  (unhold (regget 1))
  (regclr 1))
  (regclr 1)
)

(define (mksound wav dur)
  (loop15-init)
  (loop15-redux)


  (tenv (tick) 0.001 (- dur 5.001) 5)
  (mul zz zz)
  (wavout zz wav)