-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalphabet_instagram.py
67 lines (52 loc) · 1.35 KB
/
alphabet_instagram.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import sys
import numpy as np
sys.path.insert(1, "utils/")
from design_bits_system import *
from coldtype import *
from coldtype.warping import warp
factor = 20
length = 26
tl = Timeline(length * factor, fps=60)
font = Font.Cacheable("~/fonts/variable/Mona-Sans.ttf")
midi = MidiTimeline(__sibling__("midi/alphabet.mid"), bpm=177, fps=60)
ar = {
"KD": [4, 8],
"CW": [15, 75],
"HT": [10, 10],
"RS": [5, 5],
"SD": [3, 90],
"TM": [5, 10],
}
@animation(
rect=(1000, 1000),
timeline=midi,
composites=1,
bg=DB_BLACK,
)
def alphabet(f):
drums = f.t
snare = drums.ki(37)
snare_v, si = snare.adsr(ar["SD"], find=1)
kick = drums.ki(36)
return [
# P(f.a.r.inset(70))
# .fssw(-1, DB_LIGHT_GREEN, 2, 1)
# .ch(warp(f.i * 30, f.i, mult=100)),
P(
StSt(
chr(60 + si),
font,
400 if si % 2 == 0 else 600,
wdth=f.e("qeio", 3),
wght=1 - snare_v,
ro=1,
)
.scale(scaleX=1, scaleY=kick.adsr(ar["KD"], rng=(0.95, 1)))
.fssw(-1, DB_LIGHT_GREEN, 2)
.align(f.a.r, tx=1)
)
.insert(0, f.last_render())
.insert(1, P(f.a.r).f(DB_BLACK, 0.1)),
]
def release(passes):
FFMPEGExport(alphabet, passes).h264().write().open()