-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09c5fd0
commit 3b46178
Showing
21 changed files
with
223 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
;;algo by Joseph Wilk | ||
(defvar start-total-count 0) | ||
|
||
|
||
(defun post-zone-algo-animate (c col wend) | ||
(let ((fall-p nil) ; todo: move outward | ||
(o (point)) ; for terminals w/o cursor hiding | ||
(p (point)) | ||
(insert-char (nth 0 `("⟁"))) | ||
(halt-char " ") | ||
(counter 0)) | ||
|
||
(while (< counter 10) | ||
(let ((next-char (char-after p)) | ||
(previous-char (char-after (- p 1)))) | ||
|
||
;;(progn (forward-line 1) (move-to-column col) (looking-at halt-char)) | ||
;; (when (< counter 50) (move-to-column (mod counter 150))) | ||
|
||
(when (< (random 100) 50) (move-to-column counter)) | ||
|
||
(setq counter (+ 1 counter)) | ||
(setq total-count (+ 1 total-count)) | ||
|
||
(if (and | ||
;;(not (looking-at ")")) | ||
;; (not (looking-at "(")) | ||
;; (not (looking-at "\W")) | ||
(not (looking-at insert-char)) | ||
;; (not (looking-at "\s")) | ||
;; (not (looking-at "\w")) | ||
|
||
|
||
) | ||
(progn | ||
(save-excursion | ||
(dotimes (_ 1) | ||
(delete-char 1) | ||
(insert insert-char) | ||
) | ||
;;(goto-char o) | ||
(sit-for 0)) | ||
(if (<= 5 (mod counter 10)) | ||
(setq p (- (point) 1)) | ||
(setq p (+ (point) 1))))))) | ||
fall-p)) | ||
|
||
|
||
(defun zone-algo-animate (c col wend) | ||
(let ((fall-p nil) ; todo: move outward | ||
(o (point)) ; for terminals w/o cursor hiding | ||
(p (point)) | ||
(insert-char (nth 0 `("⟁"))) | ||
(halt-char " ") | ||
(counter 0)) | ||
|
||
(while (< counter 10) | ||
(let ((next-char (char-after p)) | ||
(previous-char (char-after (- p 1)))) | ||
|
||
;;(progn (forward-line 1) (move-to-column col) (looking-at halt-char)) | ||
;; (when (< counter 50) (move-to-column (mod counter 150))) | ||
|
||
(when (< (random 100) 50) (move-to-column counter)) | ||
|
||
(setq counter (+ 1 counter)) | ||
(setq total-count (+ 1 total-count)) | ||
|
||
(if (and | ||
;;(not (looking-at ")")) | ||
;; (not (looking-at "(")) | ||
;; (not (looking-at "\W")) | ||
(not (looking-at insert-char)) | ||
;; (not (looking-at "\s")) | ||
;; (not (looking-at "\w")) | ||
|
||
|
||
) | ||
(progn | ||
(save-excursion | ||
(dotimes (_ 1) | ||
(delete-char 1) | ||
(insert insert-char) | ||
) | ||
;;(goto-char o) | ||
(sit-for 0)) | ||
(if (<= 5 (mod counter 10)) | ||
(setq p (- (point) 1)) | ||
(setq p (+ (point) 1))))))) | ||
fall-p)) | ||
|
||
(defun zone-algo () | ||
(set 'truncate-lines nil) | ||
(setq total-count 0) | ||
(let* ((ww (1- (window-width))) | ||
(wh (window-height)) | ||
(mc 0) ; miss count | ||
(total (* ww wh)) | ||
(fall-p nil) | ||
(wend 100) | ||
(wbeg 1) | ||
(counter 0)) | ||
(goto-char (point-min)) | ||
|
||
|
||
(let ((nl (- wh (count-lines (point-min) (point))))) | ||
(when (> nl 0) | ||
(let ((line (concat (make-string (1- ww) ? ) "\n"))) | ||
(do ((i 0 (1+ i))) | ||
((= i nl)) | ||
;;(insert line) | ||
)))) | ||
|
||
(catch 'done; ugh | ||
(while (not (input-pending-p)) | ||
(goto-char (point-min)) | ||
(let ((wbeg (window-start)) | ||
(wend (window-end))) | ||
(setq mc 0) | ||
|
||
(goto-char (+ wbeg (random (- wend wbeg)))) | ||
(while (or (looking-at "[\t\n]")) (goto-char (+ wbeg (random (- wend wbeg))))) | ||
;; character animation sequence | ||
|
||
(setq counter (+ 1 counter)) | ||
|
||
(let ((p (point))) | ||
(goto-char p) | ||
(when (< counter 10000) (zone-algo-animate (zone-cpos p) (current-column) wend)) | ||
(when (and (> counter 4500) (< counter 10000)) | ||
;;(delete-char 1) | ||
(while (re-search-forward "\\(\s+\\)" nil t 1) | ||
(when (< (random 100) 50) (replace-match "\\1 "))) | ||
) | ||
|
||
)) | ||
)))) | ||
|
||
(eval-after-load "zone" | ||
'(unless (memq 'zone-algo (append zone-programs nil)) | ||
(setq zone-programs [zone-algo]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#name: at | ||
# -- | ||
if spread(1,64).look | ||
at do | ||
sleep 1/8.0*2 | ||
$0 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# name: stb | ||
# -- | ||
Berry[/sus_oh_p_0$0_rel/,0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name: chip | ||
# -- | ||
🐿$0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#name: fxsp | ||
# -- | ||
with_fx(spread(${1:in}, ${2:over}).map{|s| s ? ${3:hit} : ${4:miss}}.look) do | ||
$0 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#name: gpa | ||
# -- | ||
synth :gpa, note: knit( :Fs4,64, :Cs5,64, | ||
:b4,64, :fs4,64/2.0, :a4, 64/2.0 | ||
).look, amp: 0.0, attack: 0.001, decay: fslice[:length], release: 0.001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name: hrt | ||
# -- | ||
♥️$0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name: knit | ||
# -- | ||
(knit $1,$0).look |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name: line | ||
# -- | ||
(line $1, $2, $3).look |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#name: ll | ||
# -- | ||
live_loop :${1:name} do | ||
tick | ||
$0 | ||
end | ||
with_fx :none, mix: 0 do | ||
tick | ||
forever = (knit 1/8.0, 32, 0, 0).look | ||
$0 | ||
sleep forever | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#name: lls | ||
# -- | ||
live_loop :${1:name}, sync: :${2:sname} do | ||
tick | ||
$0 | ||
end | ||
live_loop :${1:name}, sync: algo do | ||
with_fx :none, mix: 0 do | ||
tick | ||
$0 | ||
sleep (1/2.0)*6 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name: ring | ||
# -- | ||
(ring $0).look |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name: rmp | ||
# -- | ||
(ramp $1, $2, $3).tick(:fire) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name: skull | ||
# -- | ||
☠️$0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#name: smp | ||
# -- | ||
smp ${1:mod}[/:${2:pat}/,[0,0]].tick(:sample), cutoff: 135, amp: 1.0 | ||
smp ${1:mod}[/${2:pat}/,[0,0]].tick(:sample), cutoff: 135, amp: 1.0, rpitch: (ring 0).look |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# name: smppan | ||
# -- | ||
sample ${1:lib}[[$0]].look, amp: 0.05*1.0, pan: line(-0.25,0.25,256).look |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#name: spd | ||
# -- | ||
if spread($1).look | ||
$0 | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name: spreadw | ||
# -- | ||
$0 = spread(7,11).map{|s| s ? :hit : :miss} |