Skip to content

A toolbox of film styles made in code for Claude Code: 66 ready to use, and your own. Each style is a style prompt plus a demo film made entirely in code by Claude Opus 5.5, with no video model. By Lemomo. · 一套用代码做片的风格工具箱:66 种现成风格,也能做出你自己的

1.3 KB
Raw Blame
# Score edit: Dreamy Flashback (opening) → Jaunty Gumption (paper world, jump-cut to its ending) → Heartwarming (real world)
import numpy as np, soundfile as sf, os, sys
os.chdir(os.path.dirname(os.path.abspath(__file__)))
OUT = sys.argv[1] if len(sys.argv) > 1 else 'score.wav'   # default demo/music/score.wav (mix.py reads it)
SR = 48000; DUR = 133.0
out = np.zeros((int(DUR * SR), 2))
def load(f): y, sr = sf.read(f); assert sr == SR; return y
def place(y, t_video, t0, t1, fin=.02, fout=.02, gain=1.0):
    seg = y[int(t0 * SR):int(t1 * SR)].copy() * gain
    n = len(seg); fi, fo = int(fin * SR), int(fout * SR)
    if fi: seg[:fi] *= np.sin(np.linspace(0, np.pi / 2, fi))[:, None] ** 2
    if fo: seg[-fo:] *= np.cos(np.linspace(0, np.pi / 2, fo))[:, None] ** 2
    a = int(t_video * SR); b = min(len(out), a + n); out[a:b] += seg[:b - a]
DF, JG, HW = load('Dreamy_Flashback.wav'), load('Jaunty_Gumption.wav'), load('Heartwarming.wav')
place(DF, 0.0, 0.0, 16.2, fin=1.5, fout=1.6, gain=.9)
JS = 15.4; A, B, X = 73.21, 102.79, .42      # jump-cut points, crossfade of one beat
place(JG, JS, 0.0, A + X / 2, fin=.05, fout=X)
place(JG, JS + A - X / 2, B - X / 2, 118.41, fin=X, fout=.3)
place(HW, 104.8, 39.38, 71.5, fin=.35, fout=1.0, gain=1.15)
sf.write(OUT, out.astype(np.float32), SR)
print('jaunty end at video', JS + A + (118.4 - B))