VOWELS
vowels.dmt · 84 BPM · 30 s · 960×600
procedural
notes
Vocal formant synthesis. One vowel-morph parameter drives the choir, the soprano and the picture.
| music | vocal formant synthesis: glottal source through three resonant bandpasses morphing A/E/I/O/U via Wxx (choir, soprano with per-note vowels, unvoiced whisper), sub, soft percussion, chan reverbs |
|---|---|
| visual | spectral envelope with the three formant peaks sweeping across a log-frequency stage, a mouth whose opening follows F1 and width F2 (teeth on spread vowels), current vowel letter, bloom |
| file | vowels.dmt |
|---|---|
| duration | 0:30 |
| video | 960×600 · 30 fps · h264 + audio · 2.5 MB |
| song | 84 BPM · speed 6 · rpb 4 · 6 channels |
| loop | 0 |
| render | scale 1 · dither on · master 0.6 |
| uniforms | vv F1 F2 F3 lvl sop open wide hue |
| collection | Demos |
| tags | procedural |
| source | 272 lines · 12 KB · download |
anatomy
13VM programs
5patterns
1palettes
0timeline events
1text / sample / texture
272source lines
6inst
3chan
1master
1frame
1pixel
1post
9fn
line composition
pattern 38%fn 16%inst 16%pixel 11%chan 5%frame 4%post 3%palette 3%master 1%title 0%song 0%order 0%pan 0%uniform 0%text 0%
play order
01230124
order list · 8 entries
palettes
aurora5 keys · lines 16–22
timeline
This demo has no timeline events; it is driven by the tracker clock and per-frame programs.
resources
| kind | name | info | value |
|---|---|---|---|
| text | vowels | 5 | AEIOU |
source
1# @description Vocal formant synthesis. One vowel-morph parameter drives the choir, the soprano and the picture.
2# @tags procedural
3# @collection Demos
4# @music vocal formant synthesis: glottal source through three resonant bandpasses morphing A/E/I/O/U via Wxx (choir, soprano with per-note vowels, unvoiced whisper), sub, soft percussion, chan reverbs
5# @visual spectral envelope with the three formant peaks sweeping across a log-frequency stage, a mouth whose opening follows F1 and width F2 (teeth on spread vowels), current vowel letter, bloom
6# vowels.dmt - vocal formant synthesis. Glottal source -> three resonant bandpasses.
7# The vowel morph (A E I O U) is the master param mp0, set with Wxx in the patterns,
8# so the choir, the soprano and the picture all read the same value.
9title VOWELS
10song bpm=84 speed=6 rpb=4 channels=6 loop=0 volume=0.6 dither=1
11order 0 1 2 3 0 1 2 4
12pan 0.35 0.65 0.5 0.5 0.5 0.5
14text vowels "AEIOU"
16palette aurora {
17 0.00 0.02 0.00 0.06
18 0.30 0.10 0.30 0.60
19 0.55 0.20 0.90 0.70
20 0.75 0.95 0.70 0.30
21 1.00 0.02 0.00 0.06
22}
24# ------------------------------------------------------------------ formant helpers
25fn pick5(v, a, b, c, d, e) {
26 # piecewise-linear table lookup, v in 0..4
27 i = clamp(v, 0, 3.999)
28 k = fract(i)
29 s = floor(i)
30 lo = s < 1 ? a : (s < 2 ? b : (s < 3 ? c : d))
31 hi = s < 1 ? b : (s < 2 ? c : (s < 3 ? d : e))
32 return mix(lo, hi, k)
33}
34fn f1(v) {
35 return pick5(v, 800, 400, 300, 450, 325)
36}
37fn f2(v) {
38 return pick5(v, 1150, 1600, 2200, 800, 700)
39}
40fn f3(v) {
41 return pick5(v, 2900, 2700, 3000, 2830, 2700)
42}
43fn formant(x, f, q, amp) {
44 y = svf(x, f, q)
45 return r2 * amp
46}
47fn vocal(src, v, bright) {
48 # three parallel formants; higher formants fade with "bright"
49 a = formant(src, f1(v), 0.90, 1.0)
50 b = formant(src, f2(v), 0.93, 0.55 * bright)
51 c = formant(src, f3(v), 0.94, 0.22 * bright)
52 return a + b + c
53}
54fn glottis(p, hz, breath) {
55 # pulse-like glottal source: saw plus narrow pulse, a little aspiration noise
56 g = bsaw(p, hz) * 0.55 + bsqr(p, 0.12, hz) * 0.45
57 return g + noise() * breath
58}
60# ------------------------------------------------------------------ instruments
61inst choir nna=continue {
62 e = env(0.25, 0.6, 0.85, 0.9)
63 vib = 1 + 0.004 * sin(t * 5.3 + chan) * min(t * 0.8, 1) + 0.0015 * noise()
64 $p = $p + freq * vib / sr
65 $q = $q + freq * vib * 1.006 / sr
66 $r = $r + freq * vib * 0.994 / sr
67 src = glottis($p, freq, 0.02) + glottis($q, freq, 0.02) + glottis($r, freq, 0.02)
68 v = mp0 * 4
69 s = vocal(src * 0.4, v, 0.7 + 0.3 * e)
70 out(s * e * 0.5)
71}
72inst soprano nna=continue {
73 # vowel per note from p0 (Sxx), sliding toward it like a real singer
74 e = env(0.06, 0.4, 0.8, 0.5)
75 $v = $v + (p0 * 4 - $v) * 0.0006
76 vib = 1 + 0.006 * sin(t * 5.8) * min(max(t - 0.15, 0) * 3, 1) + 0.002 * noise()
77 $p = $p + freq * vib / sr
78 src = glottis($p, freq, 0.03)
79 s = vocal(src, $v, 1.0)
80 out(dist(s, 1.1) * e * 0.55)
81}
82inst whisper {
83 # unvoiced: noise through the formants of the current vowel
84 e = env(0.01, 0.15, 0.3, 0.1)
85 s = vocal(noise() * 0.8, mp0 * 4, 1.2)
86 out(s * e * 0.35)
87}
88inst sub {
89 e = env(0.01, 0.3, 0.7, 0.4)
90 out((sin(ph * tau) + sin(ph * tau * 2) * 0.15) * e * 0.55)
91}
92inst thump {
93 f = 45 + 200 * exp(-t * 25)
94 $p = $p + f / sr
95 out(sin($p * tau) * exp(-t * 7) * 0.7)
96}
97inst shaker {
98 out(hp(noise(), 6000) * exp(-t * (40 + 60 * (1 - vel))) * 0.18)
99}
101chan 0 {
102 w = verb(x, 0.9, 0.3)
103 out(x * 0.6 + w * 0.7)
104}
105chan 1 {
106 w = verb(x, 0.9, 0.3)
107 out(x * 0.6 + w * 0.7)
108}
109chan 2 {
110 d = dly(x, 0.5357, 0.35)
111 w = verb(x + d * 0.5, 0.85, 0.4)
112 out(x * 0.8 + d * 0.25 + w * 0.5)
113}
114master {
115 out(dist(l, 1.15), dist(r, 1.15))
116}
118# channels: 0 choir low 1 choir high 2 soprano 3 whisper 4 sub 5 perc
119# vowel plan: W00 A W40 E W80 I WC0 O WFF U
120pattern 0 rows=16 {
121 # Am: choir enters on "ah", drifts to "oh"
122 A-2 1 34 W00 | E-3 1 30 | . | . | A-1 4 36 | C-3 5 30
123 . | . | . | . | . | .
124 . | . | . | . | . | C-6 6 14
125 . | . | . | . | . | .
126 . | . | . | . | . | C-6 6 20
127 . | . | . | . | . | .
128 . | . | . | . | . | C-6 6 14
129 . | . | . | . | . | .
130 . . . WC0 | . | . | . | . | C-3 5 30
131 . | . | . | . | . | .
132 . | . | . | . | . | C-6 6 14
133 . | . | . | . | . | .
134 . | . | . | . | . | C-6 6 20
135 . | . | . | . | . | .
136 . | . | . | . | . | C-6 6 14
137 . | . | . | . | . | .
138}
139pattern 1 rows=16 {
140 # F: "oo" -> "ee", whisper answers, soprano enters
141 F-2 1 34 WFF | C-3 1 30 | A-4 2 34 S00 | . | F-1 4 36 | C-3 5 30
142 . | . | . | . | . | .
143 . | . | . | . | . | C-6 6 14
144 . | . | . | . | . | .
145 . | . | . | . | . | C-6 6 20
146 . | . | . | F-4 3 28 | . | .
147 . | . | . | . | . | C-6 6 14
148 . | . | . | . | . | .
149 . . . W80 | . | C-5 2 34 S80 | . | . | C-3 5 30
150 . | . | . | . | . | .
151 . | . | . | . | . | C-6 6 14
152 . | . | . | . | . | .
153 . | . | . | F-4 3 28 | . | C-6 6 20
154 . | . | . | . | . | .
155 . | . | . | . | . | C-6 6 14
156 . | . | . | . | . | .
157}
158pattern 2 rows=16 {
159 # C: "eh", soprano phrase cycling vowels
160 C-3 1 34 W40 | G-3 1 30 | E-5 2 34 S40 | . | C-2 4 36 | C-3 5 30
161 . | . | . | . | . | .
162 . | . | . | . | . | C-6 6 14
163 . | . | . | . | . | .
164 . | . | D-5 2 32 SC0 | . | . | C-6 6 20
165 . | . | . | . | . | .
166 . | . | . | . | . | C-6 6 14
167 . | . | . | . | . | .
168 . . . W00 | . | C-5 2 34 S00 | C-4 3 26 | . | C-3 5 30
169 . | . | . | . | . | .
170 . | . | . | . | . | C-6 6 14
171 . | . | . | . | . | .
172 . | . | E-5 2 30 SFF | . | . | C-6 6 20
173 . | . | . | . | . | .
174 . | . | . | . | . | C-6 6 14
175 . | . | . | . | . | .
176}
177pattern 3 rows=16 {
178 # G: "oh" -> "ah", whisper rhythm
179 G-2 1 34 WC0 | D-3 1 30 | D-5 2 34 S80 | . | G-1 4 36 | C-3 5 30
180 . | . | . | G-4 3 24 | . | .
181 . | . | . | . | . | C-6 6 14
182 . | . | . | G-4 3 24 | . | .
183 . | . | . | . | . | C-6 6 20
184 . | . | . | G-4 3 24 | . | .
185 . | . | . | . | . | C-6 6 14
186 . | . | B-4 2 30 S40 | G-4 3 24 | . | .
187 . . . W00 | . | . | . | . | C-3 5 30
188 . | . | . | . | . | .
189 . | . | . | . | . | C-6 6 14
190 . | . | . | . | . | .
191 . | . | G-4 2 32 S00 | . | . | C-6 6 20
192 . | . | . | . | . | .
193 . | . | . | . | . | C-6 6 14
194 . | . | off | . | . | .
195}
196pattern 4 rows=16 {
197 # cadence: everything on "ah", then release
198 A-2 1 36 W00 | E-3 1 32 | A-5 2 34 S00 | . | A-1 4 36 | C-3 5 30
199 . | . | . | . | . | .
200 . | . | . | . | . | .
201 . | . | . | . | . | .
202 . | . | . | . | . | .
203 . | . | . | . | . | .
204 . | . | . | . | . | .
205 . | . | . | . | . | .
206 . . . WFF | . | . | . | . | .
207 . | . | . | . | . | .
208 . | . | . | . | . | .
209 . | . | . | . | . | .
210 off | off | off | . | off | .
211 . | . | . | . | . | .
212 . | . | . | . | . | .
213 . | . | . | . | . | .
214}
216# ------------------------------------------------------------------ visuals
217fn logx(f) {
218 # 80 Hz .. 5 kHz across the screen in u (-aspect..aspect)
219 return (log(f / 80) / log(62.5) * 2 - 1) * aspect
220}
221fn peak(f, amp, wd) {
222 return amp * exp(-((u - logx(f)) / wd) ^ 2)
223}
225uniform vv F1 F2 F3 lvl sop open wide hue
227frame {
228 vv = mp0 * 4
229 F1 = f1(vv)
230 F2 = f2(vv)
231 F3 = f3(vv)
232 lvl = cenv(0) + cenv(1)
233 sop = cenv(2)
234 open = (F1 - 280) / 560 # 0 closed .. 1 open (jaw)
235 wide = (F2 - 650) / 1600 # 0 rounded .. 1 spread (lips)
236 hue = bar * 0.02
237}
238pixel {
239 # spectral landscape: the three formant peaks as glowing hills, sweeping with the vowel
240 env1 = peak(F1, 1.0, 0.14) + peak(F2, 0.65, 0.12) + peak(F3, 0.35, 0.1)
241 curve = env1 * 0.8 - 0.75 # spectral envelope as a height
242 line = exp(-abs(v - curve) * 22)
243 under = smooth(0.0, 0.5, curve - v) * step(v, curve)
244 grid = exp(-abs(fract((u / aspect) * 6) - 0.5) * 30) * 0.06
245 pal(aurora, env1 * 0.4 + hue + v * 0.1)
246 cmul((0.3 + 1.5 * lvl) * line + under * (0.08 + 0.25 * lvl) + (0.02 + 0.04 * (v + 1)))
247 cadd(grid, grid, grid)
248 # the mouth: an opening whose height follows F1 and width follows F2, lips lit by the soprano
249 mw = 0.55 + 0.45 * wide
250 mh = 0.06 + 0.42 * open
251 dm = len(u / mw, (v - 0.15) / mh) - 1
252 lips = exp(-abs(dm) * 18) * (0.6 + 1.5 * sop)
253 inner = 1 - smooth(-0.02, 0.02, dm)
254 cadd(lips * 0.9 + inner * 0.08, lips * 0.3 + inner * 0.02, lips * 0.4 + inner * 0.05)
255 # teeth when the mouth is spread
256 teeth = inner * step(0.6, wide) * step(0.55, fract(u * 9)) * step(v - 0.15, mh * 0.5) * step(mh * 0.25, v - 0.15)
257 cadd(teeth * 0.8, teeth * 0.8, teeth * 0.75)
258 # vowel letter top-left, choir level as a bar at the right
259 i = floor(vv + 0.5)
260 lx = (u + 0.95 * aspect) / 0.5
261 ly = (0.92 - v) / 0.5
262 letter = glyph(str(vowels, i), lx, ly) * step(0, lx) * step(lx, 1) * step(0, ly) * step(ly, 1)
263 cadd(letter, letter * 0.9, letter * 0.7)
264 cprev(x, y + 0.002, 0.35)
265}
266post {
267 g = tap(-1, 0) + tap(1, 0) + tap(0, -1) + tap(0, 1)
268 bl = g * 0.25
269 rgb(cget(0) + bl * 0.25, cget(1) + bl * 0.25, cget(2) + bl * 0.3)
270 d = len(u, v)
271 cmul(1 - 0.3 * d * d)
272}
Click a line number to link to that line.
← VOIDZOOM