~pbatch/codex

4c98ebe919f53b176d10bafdcad43995d2058461 — Paul Batchelor 10 months ago ad0fd5e
kqpangiizk: its stencil beginnith
M Makefile => Makefile +3 -0
@@ 38,3 38,6 @@ codex: codex.c

server:
	weewiki server - $(PORT)

clean:
	$(RM) codex

A kqpangiizk/Makefile => kqpangiizk/Makefile +7 -0
@@ 0,0 1,7 @@
mitireez.mp4: mitireez.scm translate.scm
	../codex mitireez.scm
	../combine.sh mitireez_tmp.mp4 mitireez.wav mitireez.mp4
	convert mitireez.ppm mitireez.png

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

M kqpangiizk/kqpangiizk.org => kqpangiizk/kqpangiizk.org +36 -7
@@ 1,17 1,46 @@
#+TITLE: kqpangiizk
* mee
** chaerebyh
chibyzyz jasefaev guvyh shapic zheeshaish gaem sasaw reeludib go zih baideem saca zhiceg. wi da nep zhochaiz rumaza vic teev paejulef veseeh rolaiche hae reedee syliraesh. nafaevee gaek lij ketod wychaw nok boh. gee bajyg paeshode kona teewai chaesaw kosh wihom. 
chibyzyz jasefaev guvyh shapic zheeshaish gaem sasaw
reeludib go zih baideem saca zhiceg. wi da nep zhochaiz
rumaza vic teev paejulef veseeh rolaiche hae reedee
syliraesh. nafaevee gaek lij ketod wychaw nok boh. gee
bajyg paeshode kona teewai chaesaw kosh wihom.
** lylae
puw cichaet chysh juchu wocheecaz radad vaech baes kuzh gaeraweg kucywod. pos showil lytaezh buchadyb nawumee kae zaik sejozup meeryd pufeh ba zipaebi jaejefaig shaesyh rolor byviv rylaisash. haim ba naik vair gozazul nywosh homo. 
puw cichaet chysh juchu wocheecaz radad vaech baes kuzh
gaeraweg kucywod. pos showil lytaezh buchadyb nawumee kae
zaik sejozup meeryd pufeh ba zipaebi jaejefaig shaesyh
rolor byviv rylaisash. haim ba naik vair gozazul nywosh
homo.
** jawob
tamym faezeet noshej chish pairataem shogee naebap gait ruvaigy jeemaif woh kaeshidun gim saizhaihu valazhyz. bul lai tikil videet taib cag. zic zozh raeraem baehup charet mo len bor vacidig le piz fo rolizhef sep gafev shair. 
tamym faezeet noshej chish pairataem shogee naebap gait
ruvaigy jeemaif woh kaeshidun gim saizhaihu valazhyz. bul
lai tikil videet taib cag. zic zozh raeraem baehup charet
mo len bor vacidig le piz fo rolizhef sep gafev shair.
* gamaem
comazhech shogail shezhokuk heh raidazhaef heej laeshyje fu resh kaifadeen shaezh caepev seejelaen vok fonohaes wu zow. wak muchih rai paiwusen riry zhudep gut laetaegip vaibo zhagiw gaikaipaef naiwow jizh faebary rochaw. wuzetoj huleezhup cur naigaepeef leebu tehairee hotaijo heek renyl shozeebiv geekaelai lijekaew dik cohaet. 
comazhech shogail shezhokuk heh raidazhaef heej laeshyje fu
resh kaifadeen shaezh caepev seejelaen vok fonohaes wu zow.
wak muchih rai paiwusen riry zhudep gut laetaegip vaibo
zhagiw gaikaipaef naiwow jizh faebary rochaw. wuzetoj
huleezhup cur naigaepeef leebu tehairee hotaijo heek renyl
shozeebiv geekaelai lijekaew dik cohaet.
* fyruw
** wazh
syseetaech paez vaid fekaizhyv zhydawi vaek bewor teewokuz. weegevem faepaipe dukef hukai vub chaijijyw rinij to laesymut sailopol pycheedysh synudai baeshataeg mibim rub faechaic cymainael kae. lach rai caicybi rone wybo. 
syseetaech paez vaid fekaizhyv zhydawi vaek bewor teewokuz.
weegevem faepaipe dukef hukai vub chaijijyw rinij to
laesymut sailopol pycheedysh synudai baeshataeg mibim rub
faechaic cymainael kae. lach rai caicybi rone wybo.
** keem
reeneedaes laj niran tainaipaip. chulys hochofae dufep shuzhigy leechaep cybop cetucail zaijushish fupekek tachifum hut faeraik sulej sudaizai. peec gutybaev veeb vuvenaed hezh daip weha mahaehai cho muk maiwaip lisusail nuchailo paepawi nowozhi. mel meetoc resaim danaib haigashap falov maezeew pylubep zip na cicapur jofih chaiwolik bitis juzhipak devushuh chaig. 
reeneedaes laj niran tainaipaip. chulys hochofae dufep
shuzhigy leechaep cybop cetucail zaijushish fupekek
tachifum hut faeraik sulej sudaizai. peec gutybaev veeb
vuvenaed hezh daip weha mahaehai cho muk maiwaip lisusail
nuchailo paepawi nowozhi. mel meetoc resaim danaib
haigashap falov maezeew pylubep zip na cicapur jofih
chaiwolik bitis juzhipak devushuh chaig.
** saf
bashej kegaepeeb hotewy chob baij gaizee sifevaj shebaewae pashaim daebad. geerainid gyw wichihaim shaev gijah zait dokol shaizyt vah hicisyv fucum fezh rin cicoje. cain shutyrew furok lyhatyzh hyj charael faebidog heechez waik wodotaip shaez gaduch. lae ji heezhotak wozhu dom. 
bashej kegaepeeb hotewy chob baij gaizee sifevaj shebaewae
pashaim daebad. geerainid gyw wichihaim shaev gijah zait
dokol shaizyt vah hicisyv fucum fezh rin cicoje. cain
shutyrew furok lyhatyzh hyj charael faebidog heechez waik
wodotaip shaez gaduch. lae ji heezhotak wozhu dom.

A kqpangiizk/mitireez.scm => kqpangiizk/mitireez.scm +164 -0
@@ 0,0 1,164 @@
(load (string-append (mnotop) "/core.scm"))
(load (mnopath "gfx.scm"))
(load (mnopath "kuf.scm"))
(load (mnopath "btprnt.scm"))
(load (mnopath "gst.scm"))
(load "../spektrum.scm")
(load "../skript.scm")
(load "translate.scm")

(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))

(define (clrrow pos ypos max)
  (if (> pos max) '()
      (begin
        (dup)
        (clrsqr pos (+ (modulo pos 5) 7) ypos)
        (clrrow (+ pos 1) ypos max))))

(define inc (/ 1 60))
(define pos 0)

(define (shimmer pos)
  (lvl (list "shimmer" (num2str pos))))

(define (borders) (lvl "borders"))

(define (varget name)
  (grab name)
  (lvl "param [vargrb zz]")
  (pop))

(define (draw)
  (dup)
  (gfxfill 1)
  (dup)
  ;(shimmer (varget "cnd"))
  (shimmer 0)
  (clrrow 0 0 (/ 192 8))
  (clrrow 0 (- 256 8) (/ 192 8))
  (gfxrectf (+ 8 8) (+ 16 8) (* 8 (- 4 2)) (* 8 (- 4 2)) 12)
  (dup)
  (gfxrectf
   (+ 8 8 (* 4 8))
   (+ 16 (* 4 8) 8)
   (* 8 (- 5 2)) (* 8 (- 5 2)) 12)

  (dup)
  (gfxrectf
   (+ 8 8 (* 4 8) (* 5 8))
   (+ 16 (* 4 8) (* 5 8) 8)
   (* 8 (- 9 2)) (* 8 (- 9 2)) 12)

  (dup)
  (gfxrectf
   (+ 8 8 (* 3 8))
   (+ 16 (* 4 8) (* 5 8) (* 9 8) 8)
   (* 8 (- 6 2)) (* 8 (- 6 2)) 12)

  (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)

  (dup)
  (lvl "bptr [grab bp] 0 0 192 256 0 0 0")
  (dup)
  ;(lvl "bptr [grab bp] 16 16 8 16 16 16 7")
  ;(dup)
  ;(btprnt:tr
  ; (lgrab "bp")
  ; 0 (- 256 (* 8 8))
  ; 256 8
  ; 0 (- 256 (* 8 8)) 10)

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

  (set! pos (+ pos 1))
)

(define (doit n)
  (if (> n 0)
      (begin
        (if (= (modulo n 60) 0)
            (begin (display n) (newline)))
        (compute-audio)
        (draw)
        (dup)
        (gfxframe)
        (doit (- n 1)))))

(define (koanword k) (vector-ref koan k))
(define (koanwordp k) (string-append (koanword k) "."))

(define (proclaim x y k)
  (skript:text (llvl "bpget [grab bp] 0") x y (koanwordp k)))

(define (slabit)
  (gfxnew "gfx" 192 256)
  (lvl "bpnew bp 192 256")
  (skript:load "../skript.txt")
  (lvl "bpset [grab bp] 0 0 0 192 256")
  (btprnt:set "bp" 1 16 96 (* 8 7) (* 8 7))
  (lvl "blkset 49")

  (mksound "mitireez.wav" 30)

  (skript:box (llvl "bpget [grab bp] 0") 8 16 (koanword 0) 4 4)

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

  (skript:box
   (llvl "bpget [grab bp] 0")
   (+ 8 (* 4 8) (* 5 8))
   (+ 16 (* 4 8) (* 5 8))
   (koanword 2) 9 9)

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

  (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)

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

  (lvl "grab gfx")

  (rainbow1-load)
  (dup)
  (gfxclrhex 12 (vector-ref rainbow-pastel 0))
  (dup)
  (gfxopen "mitireez.h264")
  (dup)
  (draw)

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

(slabit)

A kqpangiizk/render.sh => kqpangiizk/render.sh +1 -0
@@ 0,0 1,1 @@
make

A kqpangiizk/score.txt => kqpangiizk/score.txt +136 -0
@@ 0,0 1,136 @@
@mel
beg 4 4
mr 2 t 4 mg
t 5 mg
t 7 mg
end
beg 4 4
mr 2 t 8 mg
t 7 mg
pr 3
mr 2
t 5 mg
pr 2
t 7 mg
t 5 mg
end
beg 4 4
mr 2 t 4 gl
mr 2 t 0 mg
end

beg 4 4
mr 2 t 4 mg
t 5 mg
t 7 mg
end
beg 4 4
mr 2 t 8 mg
t 7 mg
pr 3
mr 2
t 5 mg
pr 2
t 7 mg
t 5 mg
end
beg 4 4
mr 2 t 4 gl
mr 2 t 0 mg
end

beg 4 4
mr 2 t 11 lin
mr 2 t 12 gl
end

beg 4 4
mr 2 t -2 lin
mr 2 t 0 gl
end

beg 4 4
t 0 lin
t 1 lin
mr 2 t 0 gl
end
loop fin

@modindex
beg 4 4
mr 2 t 1 exp 1
mr 2 t 3 mg
end
beg 4 4
mr 4 t 3 mg
end
beg 4 4
mr 4 t 1 mg
end
loop fin

@bass
beg 8 8
mr 4 t 0 mg
mr 4 t -7 mg
end
beg 8 8
mr 4 t 0 mg
mr 4 t -4 mg
end
beg 8 8
mr 4 t -7 mg
mr 4 t 0 mg
end
beg 8 8
mr 3 t 0 mg
t -2 lin
mr 3 t 0 mg
t -2 lin
end
beg 4 4
mr 4 t 0 mg
end
loop fin

@bassfdbk
beg 8 2
t 0.1 exp 1
t 0.7
end
loop fin

@snare
beg 4 4
mr 4 t 0 rmp r 16 unroll 0 exp 1
end
beg 4 4
mr 2 t 0 rmp r 3 unroll 0 lin
mr 2 t 0 rmp r 5 unroll 0 lin
end
beg 4 4
mr 2 t 0 rmp r 3 unroll 0 exp -1
mr 2 t 0 rmp r 12 unroll 0 exp 3
end
loop fin

@thoomp
beg 4 4
t 0 rmp r 3 unroll 0.5
t 0 rmp r 2 unroll 0
t 0 rmp r 1 unroll 1
t 0 rmp r 1
end
beg 4 4
t 0 rmp r 3 unroll 0.5
t 0 rmp r 2 unroll 1
t 0 rmp r 1
t 0 rmp r 12 unroll 0
end
loop fin

@ping
beg 24 1
t 0 rmp r 64 unroll 0 exp 3
end
loop fin

A kqpangiizk/translate.scm => kqpangiizk/translate.scm +259 -0
@@ 0,0 1,259 @@
(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")))

(define (loadsineft)
  (lvl "tabnew 2048 sineft")
  (lvl "gensine zz"))

(define (newsig sig)
  (let ((r (nxtfree)))
    (regset (hold (sig)) r)
    (regmrk r)
    r))

(define (clrsig r)
  (unhold (regget r))
  (regclr r))

(define (att amt)
  (mul zz (dblin amt)))

(define (crateload wtname uuid)
  (crate:wavk (lgrab "sqlite") wtname uuid))

(define loop15-base 58)
(define (loop15-init)
  (open-db-in-monolith)
  (loadsineft)
  (crateload "ilowfreq" "gerripsoe")
  (crateload "linb" "gjlkljfap")
  (glang:new "gl"))

(define (loop15-mel-redux cnd)
  (fmpair2
   (grab "sineft")
   (grab "ilowfreq")
   (begin
     (glang:gexprdb cnd (lgrab "gl") "score.db" "mel")
     (add zz loop15-base)
     (mtof zz))
   (param 1)
   (param 1.0)
   (glang:gexprdb cnd (lgrab "gl") "score.db" "modindex")
   (param 0.9)))

(define (loop15-bass-redux cnd)
  (grab "sineft")
  (grab "ilowfreq")
  (glang:gexprdb cnd (lgrab "gl") "score.db" "bass")
  (add zz (+ loop15-base -24))
  (mtof zz)
  (fmpair2 zz zz zz
           (param 1)
           (param 1)
           (param 8)
           (glang:gexprdb
            cnd (lgrab "gl") "score.db" "bassfdbk"))

  (softclip zz 8)
  (butlp zz 800))

(define (newscalar)
  (let ((r (nxtfree)))
    (gest:scalarnew)
    (regset zz r)
    (regmrk r)
    r))

(define (tsmpv2 ft in play)
  (param ft)
  (param in)
  (param play)
  (lvl "tsmp zz zz zz"))

(define (loop15-thoomp-redux cnd)
  (let ((rep (newscalar))
        (roll (newscalar)))
    (display "rep: ")
    (display rep)
    (newline)
    (display "roll: ")
    (display roll)
    (newline)

    (glang:scalar (lgrab "gl") (lregget rep) "r")
    (glang:scalar (lgrab "gl") (lregget roll) "unroll")

    (glang:gexprdb cnd (lgrab "gl") "score.db" "thoomp")
    (dup)

    (let ((tk
           (newsig (lambda ()
                     (phsclk zz
                             (gest:scalar
                              (lregget rep)))))))

      (crate:wav (lgrab "sqlite") "gdujfdp%")
      (regget tk)
      (trand (regget tk) 1.0 1.9)
      (tsmpv2 zz zz zz)
      (trand (regget tk) 0.9 1.0)
      (mul zz zz)
      (tgate (regget tk) 0.11)
      (lvl "smoother zz 0.001")
      (mul zz zz)
      (swap)
      (scale zz 0.1 1.0)
      (param 1)
      (crossfade zz zz (gest:scalar (lregget roll)))
      (mul zz zz)
      (clrsig tk))

    (regclr rep)
    (regclr roll)))

(define (loop15-snare-redux cnd)
  (let ((rep (newscalar))
        (roll (newscalar)))
    (glang:scalar (lgrab "gl") (lregget rep) "r")
    (glang:scalar (lgrab "gl") (lregget roll) "unroll")
    (glang:gexprdb cnd (lgrab "gl") "score.db" "snare")
    (dup)
    (let ((tk
           (newsig
            (lambda ()
              (phsclk zz (gest:scalar (lregget rep)))))))

      (crate:wav (lgrab "sqlite") "gfohawsjq%")
      (regget tk)
      (trand (regget tk) 1.0 3)
      (tsmpv2 zz zz zz)
      (trand (regget tk) 0.9 1.0)
      (mul zz zz)
      (tgate (regget tk) 0.11)
      (lvl "smoother zz 0.001")
      (mul zz zz)
      (swap)
      (scale zz 0.1 1.0)
      (param 1)
      (crossfade zz zz (gest:scalar (lregget roll)))
      (mul zz zz)
      (clrsig tk))

    (regclr rep)
    (regclr roll)))

(define (loop15-ping-redux cnd)
  (let ((rep (newscalar))
        (roll (newscalar)))
    (glang:scalar (lgrab "gl") (lregget rep) "r")
    (glang:scalar (lgrab "gl") (lregget roll) "unroll")
    (glang:gexprdb cnd (lgrab "gl") "score.db" "ping")
    (dup)
    (let ((tk (newsig (lambda () (phsclk zz (gest:scalar (lregget rep)))))))
      (display tk)
      (newline)
      (crate:wav (lgrab "sqlite") "ghkeewp%")
      (regget tk)
      (trand (regget tk) 1.0 3)
      (tsmpv2 zz zz zz)
      (trand (regget tk) 0.9 1.0)
      (mul zz zz)
      (tgate (regget tk) 0.11)
      (lvl "smoother zz 0.001")
      (mul zz zz)
      (swap)
      (scale zz 0.1 1.0)
      (param 1)
      (crossfade zz zz (gest:scalar (lregget roll)))
      (mul zz zz)
      (clrsig tk))

    (regclr rep)
    (regclr roll)))

(define (mix in cab amt)
  (param in)
  (cab)
  (param amt)
  (lvl "mix zz zz zz"))

(define (loop15-redux)
  (gest:cnd 73)
  (hold zz)
  (regset zz 0)
  (regmrk 0)

  (lvl "zero")
  (hold zz)
  (regset zz 1)
  (regmrk 1)


  (loop15-mel-redux (lregget 0))
  (att -18)
  (dup)
  (mix zz (lregget 1) 0.9)
  (att -3)

  (loop15-bass-redux (lregget 0))
  (att -15)
  (dup)
  (mix zz (lregget 1) 0.3)
  (att -3)
  (add zz zz)

  (loop15-thoomp-redux (lregget 0))
  (att -2)
  (dup)
  (mix zz (lregget 1) 0.9)
  (add zz zz)

  (loop15-snare-redux (lregget 0))
  (att -3)
  (dup)
  (mix zz (lregget 1) 0.8)
  (add zz zz)

  (loop15-ping-redux (lregget 0))
  (att -8)
  (dup)
  (mix zz (lregget 1) 1.9)
  (att -10)
  (add zz zz)

  (regget 1)
  (vardelay zz 0.0 0.2 0.3)
  (dup)
  (bigverb zz zz 0.93 8000)
  (drop)
  (dcblocker zz)
  (att -10)
  (add zz zz)

  (unhold (regget 0))
  (regclr 0)
  (unhold (regget 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)
)

;;(loop15-init)
;;(loop15-redux)
;; (tenv (tick) 0.001 28 5)
;; (mul zz zz)
;; (dup)
;; (wavouts zz zz "translate.wav")
;; (lvl "computes 35")

M qipacal/rai.scm => qipacal/rai.scm +0 -1
@@ 124,7 124,6 @@
  (kuf:setblk 8 (lgrab "kuf") 4 0 (genblk))
  (stripes 6 0)


  (stripes 0 2)
  (kuf:setblk 8 (lgrab "kuf") 2 2 (genblk))
  (stripes 4 2)