summaryrefslogtreecommitdiff
path: root/forge
diff options
context:
space:
mode:
authorSt33v <github@f3rr3t.com>2026-01-30 16:01:20 +1100
committerSt33v <github@f3rr3t.com>2026-01-30 16:01:20 +1100
commit21f762a2522d66afe7a5243826ccd60c1226222c (patch)
treebd82558046242a3e57a8d034b86b264fb0e5f11e /forge
parent59ca962ca867dc4b40d244b28e6bbceaf83f39db (diff)
first trial of sotd automation
Diffstat (limited to 'forge')
-rw-r--r--forge/automationUseCase.txt52
-rwxr-xr-xforge/script/sotd-build.sh77
-rw-r--r--forge/template/cover.jpgbin0 -> 76763 bytes
-rw-r--r--forge/template/lyrics13
-rw-r--r--forge/template/release.template19
-rw-r--r--forge/template/title1
6 files changed, 162 insertions, 0 deletions
diff --git a/forge/automationUseCase.txt b/forge/automationUseCase.txt
new file mode 100644
index 0000000..eaa1fbe
--- /dev/null
+++ b/forge/automationUseCase.txt
@@ -0,0 +1,52 @@
+# Use case for automation of Song of the Day
+# SJP 30 jan 2026
+This is for edification of LLM:
+
+keyboardMonkey:
+1. User selects sotd (in Suno)
+2. downloads .wav -> ~/cargo/
+3. copies lyrics from suno (copy from browser and paste into 'template/lyrics.txt'
+4. copies cover art and pastes in template/cover.png
+5. creates 'title' with echo 'my great song title' > title (or equivalent)
+6. user does 'mv ~/cargo/<song>.wav forge/in/.
+7. 'newSotd.path' service is triggered; activates 'newSotd.service' -> newSotd.sh
+
+newSotd.sh:
+8. opens template/release.template for reading
+(this might be too much micromanagament but bear with me and suggest a better way if you like)
+9. open out/release.eno for writing
+10. open template/lyrics for reading (if no lyrics file then the song is instrumental; don't fail but set $has_lyrics=false
+11. append two spaces to the end of each line (to force md display)
+12. read the first few lines of lyrics and copy to $synopsis , keeping < 256 char and adding '/ ' between lines
+
+13. construct $date from system date as string var 'yyyy-mm-dd'
+13a. construct $slug = "sotd-$date"
+14 read template/title and store in $title
+
+14. read a line (of release.templateA)
+
+15. if find a replacement {{}} marker:
+ if slug: write $slug
+16. if date: write $date
+17. if cover_image_desc, write 'Cover image for the song: $title'
+18. if title: write $title
+19. if lyrics:
+ if $has_lyrics==TRUE $replace with $lyrics or tempfile (with spaces appended to each line)
+ else: insert ""
+
+(parsing of template/release.template is complete)
+
+20. mkdir out/$slug
+21. copy out/rlease.eno to out/$slug/release.eno
+(this is messy, but you might be able to make it neater, in conjunction with step 9)(such as, mkdir the final $slug directory right at the start since we already know the date)
+
+22. close out/$slug/release.eno
+23. mv <song>.wav from /in to /out/$slug/.
+24. mv cover.png from template/ to out/$slug
+25. mv completed song package ($slug directory) to ../sotd/.
+26. execute faircamp --preview (FROM THE SOTD DIRECTORY).
+
+END
+
+
+
diff --git a/forge/script/sotd-build.sh b/forge/script/sotd-build.sh
new file mode 100755
index 0000000..9266806
--- /dev/null
+++ b/forge/script/sotd-build.sh
@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+ROOT="$HOME/dox/st33v.com"
+FORGE="$ROOT/forge"
+IN="$FORGE/in"
+OUT="$FORGE/out"
+TPL="$FORGE/template"
+
+die() { echo "[sotd-build] $*" >&2; exit 1; }
+
+# --- sanity checks --------------------------------------------------------
+
+wav=( "$IN"/*.wav )
+[[ -e "${wav[0]}" ]] || die "No wav file in forge/in"
+
+[[ ${#wav[@]} -eq 1 ]] || die "More than one wav in forge/in (ambiguous)"
+
+[[ -f "$TPL/title" ]] || die "template/title missing"
+
+template_file="$TPL/release.template"
+[[ -f "$template_file" ]] || die "release.template missing"
+
+# --- derive variables -----------------------------------------------------
+
+date_today="$(date -I)"
+slug="sotd-$date_today"
+
+release_dir="$OUT/$slug"
+mkdir -p "$release_dir"
+
+title="$(cat "$TPL/title")"
+cover_desc="Cover image for the song: $title"
+
+has_lyrics=false
+lyrics_md=""
+
+if [[ -f "$TPL/lyrics" ]]; then
+ has_lyrics=true
+ lyrics_md="$(sed 's/$/ /' "$TPL/lyrics")"
+fi
+
+# synopsis: first ~3 lines, <256 chars, joined by " / "
+synopsis=""
+if $has_lyrics; then
+ synopsis="$(head -n 3 "$TPL/lyrics" \
+ | tr '\n' '/' \
+ | sed 's|/| / |g' \
+ | cut -c1-255)"
+fi
+
+# --- render template ------------------------------------------------------
+
+release_eno="$release_dir/release.eno"
+
+sed \
+ -e "s|{{title}}|$title|g" \
+ -e "s|{{slug}}|$slug|g" \
+ -e "s|{{date_today}}|$date_today|g" \
+ -e "s|{{cover_image_desc}}|$cover_desc|g" \
+ -e "s|{{synopsis}}|$synopsis|g" \
+ -e "s|{{lyrics_md}}|$lyrics_md|g" \
+ "$template_file" > "$release_eno"
+
+# --- move assets ----------------------------------------------------------
+
+mv "${wav[0]}" "$release_dir/song.wav"
+
+if [[ -f "$TPL/cover.jpg" ]]; then
+ cp "$TPL/cover.jpg" "$release_dir/cover.jpg"
+fi
+
+# marker to show build complete
+touch "$release_dir/BUILT"
+
+echo "[sotd-build] Built $release_dir"
+
diff --git a/forge/template/cover.jpg b/forge/template/cover.jpg
new file mode 100644
index 0000000..baef5f1
--- /dev/null
+++ b/forge/template/cover.jpg
Binary files differ
diff --git a/forge/template/lyrics b/forge/template/lyrics
new file mode 100644
index 0000000..909c58e
--- /dev/null
+++ b/forge/template/lyrics
@@ -0,0 +1,13 @@
+[LFO]
+grouse (grouse) (grouse)
+
+[a discordant drone dominates]
+(what's that effect? it sounds grouse)
+
+[whining filters]
+grouse (grouse) (grouse)
+
+[is that a steady beat?]
+grouse (grouse) (grouse)
+
+Is that you or me?
diff --git a/forge/template/release.template b/forge/template/release.template
new file mode 100644
index 0000000..4d827d3
--- /dev/null
+++ b/forge/template/release.template
@@ -0,0 +1,19 @@
+title: {{title}}
+permalink: {{slug}}
+date: {{date_today}}
+
+release_artist: Song of the Day
+
+cover:
+description = {{cover_image_desc}}
+file = cover.png
+
+--synopsis
+{{synopsis}}
+--synopsis
+
+more_label: Lyrics
+
+--more
+{{lyrics_md}}
+--more
diff --git a/forge/template/title b/forge/template/title
new file mode 100644
index 0000000..ab9e0ef
--- /dev/null
+++ b/forge/template/title
@@ -0,0 +1 @@
+Grouse