From 2e6f266948bda4d4b08c9b88e14eeaeb284f137a Mon Sep 17 00:00:00 2001 From: Joris Date: Thu, 4 Jan 2024 21:03:03 +0100 Subject: Specify chord duration --- public/main.css | 20 ++++++-- public/rhythms/0.5.png | Bin 0 -> 4520 bytes public/rhythms/1.5.png | Bin 0 -> 3503 bytes public/rhythms/2.png | Bin 0 -> 3108 bytes songs/bob-marley/no-woman-no-cry.lisp | 89 ++++++++++++++++++++++++++++++++++ songs/bob-marley/woman-no-cry.lisp | 73 ---------------------------- src/main.lisp | 23 ++++++--- 7 files changed, 120 insertions(+), 85 deletions(-) create mode 100644 public/rhythms/0.5.png create mode 100644 public/rhythms/1.5.png create mode 100644 public/rhythms/2.png create mode 100644 songs/bob-marley/no-woman-no-cry.lisp delete mode 100644 songs/bob-marley/woman-no-cry.lisp diff --git a/public/main.css b/public/main.css index 236ddc0..8606108 100644 --- a/public/main.css +++ b/public/main.css @@ -53,13 +53,13 @@ body { .g-Part h3 { margin: 0; - background-color: #f0f0f0; padding: 0 0.25rem; border-radius: 0.25rem; font-size: 110%; font-weight: normal; font-family: monospace; color: #851616; + border: 1px solid #851616; width: fit-content; } @@ -78,13 +78,25 @@ body { text-align: center; border-left: 1px solid black; border-right: 1px solid black; - padding: 0.5rem 0; + padding: 0.5rem 1rem; + white-space: nowrap; +} + +.g-Chords__Chord { + display: inline-flex; + gap: 0.5rem; + align-items: baseline; +} + +.g-Chords__Rhythm { + height: 1.3rem; } .g-Chords__Chord:not(:last-child):after { display: inline-block; content: "/"; - margin: 0 0.5rem; + margin-left: 0.5rem; + margin-right: 1rem; } .g-Lyrics__Paragraph { @@ -94,5 +106,5 @@ body { } .g-Lyrics__Paragraph emph { - background-color: #e6e6d2; + background-color: #a7de9b; } diff --git a/public/rhythms/0.5.png b/public/rhythms/0.5.png new file mode 100644 index 0000000..08bf293 Binary files /dev/null and b/public/rhythms/0.5.png differ diff --git a/public/rhythms/1.5.png b/public/rhythms/1.5.png new file mode 100644 index 0000000..aae73bd Binary files /dev/null and b/public/rhythms/1.5.png differ diff --git a/public/rhythms/2.png b/public/rhythms/2.png new file mode 100644 index 0000000..0bcc0ba Binary files /dev/null and b/public/rhythms/2.png differ diff --git a/songs/bob-marley/no-woman-no-cry.lisp b/songs/bob-marley/no-woman-no-cry.lisp new file mode 100644 index 0000000..deaaa80 --- /dev/null +++ b/songs/bob-marley/no-woman-no-cry.lisp @@ -0,0 +1,89 @@ +(song + (title "No Woman, No Cry") + (from "Bob Marley & The Wailers") + (tonality "C") + + ; (chords + ; (:templates + ; (A ((C G) (("Am" 1.5) (F 0.5 2)) ((C 2) (F 1.5) (C 0.5)) (C G))) + ; (B ((C G) (("Am" 1.5) (F 0.5 2)) (C G) (("Am" 1.5) (F 0.5 2)))) + ; (C ((C G) ("Am" F) (C G) ("Am" F)))) + + ; (intro A) + ; (chorus A A) + ; (verse B B) + ; (bridge C C)) + + (chords + (intro + ((C G) (("Am" 1.5) (F 0.5 2))) + (((C 2) (F 1.5) (C 0.5)) (C G))) + + (chorus + ((C G) (("Am" 1.5) (F 0.5 2))) + (((C 2) (F 1.5) (C 0.5)) (C G)) + ((C G) (("Am" 1.5) (F 0.5 2))) + (((C 2) (F 1.5) (C 0.5)) (C G))) + + (verse + ((C G) (("Am" 1.5) (F 0.5 2))) + ((C G) (("Am" 1.5) (F 0.5 2))) + ((C G) (("Am" 1.5) (F 0.5 2))) + ((C G) (("Am" 1.5) (F 0.5 2)))) + + (bridge + ((C G) ("Am" F) (C G) ("Am" F)) + ((C G) ("Am" F) (C G) ("Am" F)))) + + (lyrics + (intro) + + (chorus + "No woman no cry, + No woman no cry. + No woman no cry, + No woman no cry.") + + (verse + "Say I remember, when we used to sit, + In the government yard in Trenchtown. + Observing the hypocrites, + As they would, mingle with the good people we met. + Good friends we had, and good friends we lost, + Along the way. + In this bright future, you can forget your past, + So dry your tears I say And,") + + (chorus + "No woman no cry, + No woman no cry. + Hey little darling, don’t shed no tears, + No woman no cry.") + + (verse + "Say I remember, when we used to sit, + In the government yard in Trenchtown. + And then Georgie, would make a fire light, + As it was, love wood burning through the night. + And we would cook, wholemeal porridge, + Of which I’ll share with you. + My feet is my only carriage, + So I’ve got to push on through, but while I’m gone I mean.") + + (bridge + "Everything’s going to be alright, + Everything’s going to be alright, + Everything’s going to be alright, + Everything’s going to be alright, + Everything’s going to be alright, + Everything’s going to be alright, + Everything’s going to be alright, + Everything’s going to be alright.") + + (chorus + "So woman no cry, + No woman no cry. + Oh my little sister, don’t shed no tears, + No woman no cry.") + + (outro))) diff --git a/songs/bob-marley/woman-no-cry.lisp b/songs/bob-marley/woman-no-cry.lisp deleted file mode 100644 index 57ba345..0000000 --- a/songs/bob-marley/woman-no-cry.lisp +++ /dev/null @@ -1,73 +0,0 @@ -(song - (title "No Woman, No Cry") - (from "Bob Marley & The Wailers") - (tonality "C") - - (chords - (intro - ((C G) ("Am *" F) (C "F *") (C G))) - - (chorus - ((C G) ("Am *" F) (C "F *") (C G)) - ((C G) ("Am *" F) (C "F *") (C G))) - - (verse - ((C G) ("Am *" F) (C G) ("Am *" F)) - ((C G) ("Am *" F) (C G) ("Am *" F))) - - (bridge - ((C G) ("Am" F) (C G) ("Am" F)) - ((C G) ("Am" F) (C G) ("Am" F)))) - - (lyrics - (intro) - - (chorus - "No woman no cry, - No woman no cry. - No woman no cry, - No woman no cry.") - - (verse - "Say I remember, when we used to sit, - In the government yard in Trenchtown. - Observing the hypocrites, - As they would, mingle with the good people we met. - Good friends we had, and good friends we lost, - Along the way. - In this bright future, you can forget your past, - So dry your tears I say And,") - - (chorus - "No woman no cry, - No woman no cry. - Hey little darling, don’t shed no tears, - No woman no cry.") - - (verse - "Say I remember, when we used to sit, - In the government yard in Trenchtown. - And then Georgie, would make a fire light, - As it was, love wood burning through the night. - And we would cook, wholemeal porridge, - Of which I’ll share with you. - My feet is my only carriage, - So I’ve got to push on through, but while I’m gone I mean.") - - (bridge - "Everything’s going to be alright, - Everything’s going to be alright, - Everything’s going to be alright, - Everything’s going to be alright, - Everything’s going to be alright, - Everything’s going to be alright, - Everything’s going to be alright, - Everything’s going to be alright.") - - (chorus - "So woman no cry, - No woman no cry. - Oh my little sister, don’t shed no tears, - No woman no cry.") - - (outro))) 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 -- cgit v1.2.3