Grass Cutters Together: the project as of moon-sweepers f3666f0

A clean start for the shared repository: the Unity project (Assets, Packages, ProjectSettings), ArtSource, Docs and
Tools as they stood at f3666f0 in the old local repository, with its generated prefabs and scene brought up to date.
Images, audio, models and binaries go through Git LFS (.gitattributes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiemandKG
2026-11-06 18:44:40 +06:00
parent 0f0467cd0c
commit d1c3761e58
4190 changed files with 270757 additions and 1 deletions

149
Tools/audio/finalize.py Normal file
View File

@ -0,0 +1,149 @@
"""Assemble final game audio from picked ElevenLabs candidates (eleven_raw/) into Assets/Audio.
Sounds not listed here keep their procedurally synthesized version from synth.py
(combo_up, combo_break, coin_tick, ui_hover, ui_open, ui_close, purchase, error,
star_1..3, recycler_accept). Run synth.py first, then this.
"""
import os
import numpy as np
from scipy import signal
import master as M
from master import SR
def m(x):
return M.mono(x)
def seg(x, a, b):
return x[int(a * SR): int(b * SR)]
def compress(x, thr_db=-18, ratio=4.0, ms=4.0):
env = M.envelope(x, ms) + 1e-9
thr = np.abs(x).max() * M.db(thr_db)
gain = np.where(env > thr, (thr / env) ** (1 - 1 / ratio), 1.0)
gain = M.lowpass(gain, 200)
return x * (gain if x.ndim == 1 else gain[:, None])
def gate(x, thr_db=-38, ms=6.0):
env = M.envelope(x, ms)
thr = np.abs(x).max() * M.db(thr_db)
g = np.clip((env / thr) ** 2, 0, 1)
return x * M.lowpass(g, 60)
def resample_pitch(x, factor):
"""Pitch-shift by resampling (factor > 1 = higher & shorter)."""
n = int(len(x) / factor)
return signal.resample(x, n)
def synth_file(name):
return M.load(os.path.join(M.OUT, name + ".wav"))
def pops():
pieces = []
for f in ("popseq_0.wav", "popseq_1.wav"):
for s, pk, t in M.slice_seq(m(M.raw(f)), max_len=0.32, min_gap=0.15, rel_db=-16):
pieces.append((pk, s))
pieces.sort(key=lambda p: -p[0])
clean = [M.clean(s, start_db=-26, tail_db=-46, max_len=0.3) for pk, s in pieces[:7]]
clean.append(M.clean(m(M.raw("pop_0.wav")), start_db=-26, tail_db=-46, max_len=0.3))
# two pitch variants of the strongest for extra variety
clean.append(M.fade(resample_pitch(clean[0], 1.15), 0, 15))
clean.append(M.fade(resample_pitch(clean[1], 0.88), 0, 15))
for i, c in enumerate(clean[:10]):
M.write(f"pop_{i + 1:02d}", c, -3)
big = M.clean(m(M.raw("pop_big_0.wav")), start_db=-26, tail_db=-60, max_len=0.35, fout_ms=90)
# add the synthesized low thump underneath for weight
syn = M.lowpass(synth_file("pop_big") if False else m(_synth_big()), 400)
n = min(len(big), len(syn))
big[:n] += syn[:n] * 0.35 * np.abs(big).max() / (np.abs(syn).max() + 1e-9)
M.write("pop_big", big, -2)
M.write("pop_golden", M.clean(m(M.raw("pop_golden_0.wav")), start_db=-26, tail_db=-50, max_len=1.9, fout_ms=200), -3)
def _synth_big():
t = np.arange(int(0.3 * SR)) / SR
f = 55 + 120 * np.exp(-t / 0.03)
return np.sin(2 * np.pi * np.cumsum(f) / SR) * np.exp(-t / 0.07)
def oneshots():
tape = M.clean(m(M.raw("tape_rip_1.wav")), start_db=-30, tail_db=-50, max_len=1.05, fout_ms=60)
M.write("tape_rip", tape, -3)
M.write("box_burst", M.clean(m(M.raw("box_burst_1.wav")), tail_db=-50, max_len=1.25, fout_ms=150), -3)
M.write("cash_register", M.clean(m(M.raw("cash_register_0.wav")), tail_db=-55, max_len=1.45, fout_ms=250), -3)
sc = M.clean(M.raw("shift_complete_1.wav"), tail_db=-55, max_len=2.9, fout_ms=400)
M.write("shift_complete", sc, -2) # stereo (2D UI sound)
M.write("confetti", M.clean(m(M.raw("confetti_0.wav")), tail_db=-50, max_len=1.4, fout_ms=200), -3)
grab = gate(m(M.raw("plastic_grab_1.wav")), -34)
M.write("plastic_grab", M.clean(seg(grab, 0.15, 0.7), start_db=-20, tail_db=-40, fout_ms=60), -6)
M.write("throw_whoosh", M.clean(m(M.raw("throw_whoosh_1.wav")), start_db=-40, tail_db=-50, max_len=0.4, lead_ms=0, fout_ms=60), -5)
M.write("recycler_grind", M.clean(m(M.raw("recycler_grind_0.wav")), tail_db=-50, max_len=2.35, fout_ms=200), -4)
honk = M.clean(m(M.raw("shift_start_horn_0.wav")), tail_db=-50, max_len=0.75, fout_ms=120)
first = M.fade(honk[: int(0.42 * SR)], 1, 40)
horn = np.zeros(int(0.42 * SR) + int(0.14 * SR) + len(honk))
horn[: len(first)] += first
horn[int(0.56 * SR): int(0.56 * SR) + len(honk)] += honk
M.write("shift_start_horn", horn, -3)
M.write("land", M.clean(m(M.raw("land_0.wav")), start_db=-30, tail_db=-46, max_len=0.35), -6)
M.write("jump", M.clean(m(M.raw("jump_0.wav")), tail_db=-40, max_len=0.22, fout_ms=40), -9)
unroll = compress(m(M.raw("roll_unroll_0.wav")), -20, 6)
M.write("roll_unroll", M.clean(unroll, start_db=-36, tail_db=-48, max_len=1.8, fout_ms=200), -4)
mal = M.clean(m(M.raw("mallet_thump_0.wav")), start_db=-26, tail_db=-50, max_len=0.6)
low = _synth_big()
low = np.interp(np.arange(len(low)) * 0.8, np.arange(len(low)), low) # slightly lower thump
n = min(len(mal), len(low))
mal[:n] += low[:n] * 0.45 * np.abs(mal).max()
M.write("mallet_thump", np.tanh(mal / np.abs(mal).max() * 1.6), -2)
M.write("ui_click", M.clean(m(M.raw("ui_click_0.wav")), tail_db=-45, max_len=0.22, fout_ms=40), -7)
def sequences():
th = M.slice_seq(m(M.raw("thud_0.wav")), max_len=0.45, min_gap=0.2, rel_db=-14)
th.sort(key=lambda p: -p[1])
thuds = [M.clean(s, tail_db=-46, max_len=0.42) for s, pk, t in th[:3]]
while len(thuds) < 3: # pad with pitch variants if fewer slices were found
thuds.append(M.fade(resample_pitch(thuds[0], 0.85 + 0.2 * len(thuds) / 3), 0, 20))
for i, t in enumerate(thuds):
M.write(f"cardboard_thud_{i + 1}", t, -4)
st = M.slice_seq(m(M.raw("footsteps_0.wav")), max_len=0.3, min_gap=0.25, rel_db=-16)
st.sort(key=lambda p: -p[1])
for i, (s, pk, t) in enumerate(st[:4]):
M.write(f"footstep_{i + 1}", M.clean(s, tail_db=-44, max_len=0.25), -9)
print(" (thud slices:", len(th), " step slices:", len(st), ")")
def loops():
eng = M.highpass(m(M.raw("roller_engine_0.wav")))
M.write("roller_engine_loop", M.loop_xfade(seg(eng, 0.3, 7.7), 0.6), -6)
con = M.highpass(m(M.raw("conveyor_0.wav")))
M.write("conveyor_loop", M.loop_xfade(seg(con, 0.2, 6.9), 0.6), -10)
amb = M.highpass(m(M.raw("ambience_0.wav")), 25)
M.write("ambience_loop", M.loop_xfade(seg(amb, 0.2, 14.8), 1.5), -14)
def music():
for src, dst, hint in (("music_menu.mp3", "music_menu_loop", 4.0), ("music_game.mp3", "music_game_loop", 4.0)):
x = M.raw(src)
loop = M.music_loop(x, start_hint=hint, tail_trim=7.0)
rms = np.sqrt(np.mean(loop ** 2))
loop = loop * (M.db(-17) / rms)
pk = np.abs(loop).max()
if pk > M.db(-1):
loop = np.tanh(loop / M.db(-1) * 0.9) / np.tanh(0.9) * M.db(-1)
M.write(dst, loop, None)
if __name__ == "__main__":
import sys
groups = {"pops": pops, "oneshots": oneshots, "sequences": sequences, "loops": loops, "music": music}
for g in sys.argv[1:] or list(groups):
print(f"[{g}]")
groups[g]()