aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2024-01-04 21:03:03 +0100
committerJoris2024-01-04 21:07:12 +0100
commit2e6f266948bda4d4b08c9b88e14eeaeb284f137a (patch)
tree414bd56985a0792ecbacd2404b563c243808e46b /src
parent6f0169bdb7fb8ba47fda49f458828a89ba7966a6 (diff)
Specify chord duration
Diffstat (limited to 'src')
-rw-r--r--src/main.lisp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/main.lisp b/src/main.lisp
index f3bd32e..d7dec7f 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -76,18 +76,25 @@
; Chords
-(defun chord-div (chord)
- (h "span" '(("class" "g-Chords__Chord")) (list (string chord))))
+(defun rhythm (x)
+ (h "img" (list '("class" "g-Chords__Rhythm") (list "src" (format nil "/rhythms/~S.png" x))) nil))
-(defun chord-cell (chords)
+(defun chord-div (x)
+ (h "span" '(("class" "g-Chords__Chord"))
+ (if
+ (listp x)
+ (cons (string (car x)) (mapcar #'rhythm (cdr x)))
+ (list (string x)))))
+
+(defun chord-cell (x)
(h "td" '(("class" "g-Chords__Cell"))
(if
- (listp chords)
- (mapcar #'chord-div chords)
- (list (chord-div chords)))))
+ (listp x)
+ (mapcar #'chord-div x)
+ (list (chord-div x)))))
-(defun chord-row (chords)
- (h "tr" nil (mapcar #'chord-cell chords)))
+(defun chord-row (xs)
+ (h "tr" nil (mapcar #'chord-cell xs)))
(defun chord-rows (xs)
(if