Showing the source code of programming launguage as video¶
- see also
Using `subtitles’¶
Because “subtitles” is used for subtitles, I think it is rare for those who want to do this. Also, if you want to quote the code “beautifully”, it will usually be easy to embed in your video an image that captures something (such as an HTML page) rendered using some tool.
If you still want to do with only the “ass” mechanism, there are four main points to do that:
Use fixed width font.
Escape special characters for `ass’.
Handling of line breaks.
How to display blanks at the beginning of lines?
For the first one, just use the monospace font. As for the second, at least, “{“, and “}”. The third one just needs to be replaced by “\N” (hard break).
The biggest problem is the fourth one. Ffmpeg’s `ass’ engine kills all blanks at the beginning of the line. Furthermore, there is no way to control that behavior. So, at best, all you can do is replace the leading blanks with non-blanks and “make them unreadable”.
With all this in mind, writing these code citations “hands-on” is a lot of work and silliness. In my case, for example, I use Python:
#! /bin/bash
pref="`basename $0 .sh`"
#
function cite_snippet() {
python -c '
import io, re
code = io.open("'$1'").read()
lines = []
for line in re.split(r"\r*\n", code):
line = line.rstrip()
line = re.sub(r"([{}])", r"\\\1", line)
m = re.match(r"^( +)(.*)$", line)
if m:
lsp, rest = m.group(1, 2)
line = r"{\c&H000000}" + "_" * len(lsp) + r"{\r}" + rest
lines.append(line)
print("\\N".join(lines))
'
}
#
cat <<__END__> ${pref}.ass
[Script Info]
PlayResX: 1280
PlayResY: 720
WrapStyle: 1
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, Alignment, Encoding
Style: Code, monospace,20,&HFFFFFF,7,0
[Events]
Format: Layer, Start, End, Style, Text
Dialogue: 0,00:00:00.00,00:00:30.00,Code,{\pos(100,100)}`cite_snippet aaa.py`
__END__
#
ffmpeg -y -filter_complex "
color=black:s=1280x720:d=30,ass=${pref}.ass
" ${pref}.mp4
The “ass file” created by this script is, for example:
[Script Info]
PlayResX: 1280
PlayResY: 720
WrapStyle: 1
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, Alignment, Encoding
Style: Code, monospace,20,&HFFFFFF,7,0
[Events]
Format: Layer, Start, End, Style, Text
Dialogue: 0,00:00:00.00,00:00:30.00,Code,{\pos(100,100)}# -*- coding: utf-8 -*-\Nimport math\N\N#\N# see details: https://en.wikipedia.org/wiki/MIDI_tuning_standard\N#\N_KTAB = [\N{\c&H000000}____{\r}"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"\N{\c&H000000}____{\r}]\N\Ndef nn2scale(nn):\N{\c&H000000}____{\r}return _KTAB[int(nn) % 12], int(nn / 12) - 1\N\Ndef ok2nn(k, oct):\N{\c&H000000}____{\r}return (oct + 1) * 12 + _KTAB.index(k)\N\Ndef nn2freq(nn):\N{\c&H000000}____{\r}return math.pow(2, (nn - 69) / 12.) * 440\N
I suppose it is probably a bug in ffmpeg’s ass engine that we can not escape “\n”, and “\N”. That is, complete code citation is not possible if they are included. From this point of view, it is usually not advisable to try to do “only with the ass mechanism”. (For this site you are looking at now, it is not a problem as it is just a simple shell script, but it is quite lucky.)
Using `latex’¶
Just like “Is there a way to render math only with ffmpeg?”, there are cases where it’s easier to embed the image converted from the code directly to png using latex and embed it in the video:
#! /bin/sh
outname="${outname:-code}.png"
dpi=${dpi:-"880"}
gamma=${gamma:-"1.5"}
#
cat << '__END__' > /tmp/code.tex
\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{bm}
\pagestyle{empty}
\begin{document}
\tt\scriptsize
\begin{verbatim}
__END__
cat >> /tmp/code.tex
cat << '__END__' >> /tmp/code.tex
\end{verbatim}
\end{document}
__END__
#
pwd="`pwd`"
(
cd /tmp
latex --interaction=nonstopmode code.tex && \
dvipng -o "${outname}" -T tight -z9 -gamma ${gamma} -D ${dpi} -bg Transparent code.dvi && \
mv "${outname}" "${pwd}"
)
#! /bin/bash
pref="`basename $0 .sh`"
#
./code2png.sh < aaa.py # -> generate code.png
#
ffmpeg -y -filter_complex "
color=black:s=1280x720:d=30[vb];
movie=code.png,loop=-1:size=2,scale=1280:720,negate,colorkey=black[vt];
[vb][vt]overlay=shortest=1
" ${pref}.mp4
This is pretty easy if it works, but perhaps you’re more likely to face paper size problems than formulas, and you’ll have more trouble. I think that it is often easier to capture rendering results from other tools such as web page.
Using `pygmentize’¶
If you have Pygments, you can also use pygmentize:
#! /bin/bash
pref="`basename $0 .sh`"
#
pygmentize -l python -o code.png aaa.py # -> generate code.png
#
ffmpeg -y -filter_complex "
color=black:s=1280x720:d=30[vb];
movie=code.png,loop=-1:size=2,scale=1280:720[vt];
[vb][vt]overlay=shortest=1
" ${pref}.mp4
The image created with this tool is beautiful, but it may be more difficult to make it transparent.
If the input source code is long, of course, it will be a very vertically long output image (so it can not be opened by the image viewer). In such cases, consider scrolling:
#! /bin/sh
#
# usage: src2mp4.sh your_source
#
inputsrc="${1:-${0}}"
inputsrcbase="`basename \"${inputsrc}\"`"
dur=${dur:-30}
#
# If you do not want to print out line numbers, highlight a specific line,
# or change the style, see the pygmentize help or the Pygments documentation.
#
pygmentize -g -o /tmp/code.png "${inputsrc}" # -> generate /tmp/code.png
#
ffmpeg -y -i /tmp/code.png -filter_complex "
color=black:s=1280x720:d=${dur}[vb];
[0:v]loop=-1:size=2,scale=1280:-1[vt];
[vb][vt]overlay='shortest=1:x=0:y=-t/${dur}*(h-H)'
" "${inputsrcbase}.mp4"
See Using overlay for scroll, roll.
To pause before and after scrolling¶
If you want to pause before and after scrolling, for example:
#! /bin/sh
#
# usage: src2mp4.sh your_source
#
inputsrc="${1:-${0}}"
inputsrcbase="`basename \"${inputsrc}\"`"
tdur=${tdur:-40}
pbdur=${pbdur:-5} # pause before scrolling
padur=${padur:-6} # pause after scrolling
#
# If you do not want to print out line numbers, highlight a specific line,
# or change the style, see the pygmentize help or the Pygments documentation.
#
pygmentize -g -o /tmp/code.png "${inputsrc}" # -> generate /tmp/code.png
#
ffmpeg -y -i /tmp/code.png -filter_complex "
color=black:s=1280x720:d=${tdur}[vb];
[0:v]loop=-1:size=2,scale=1280:-1[vt];
[vb][vt]overlay='
shortest=1
:x=0
:y=-min(max(0, t - ${pbdur}), (${tdur} - ${pbdur} - ${padur})) /
(${tdur} - ${pbdur} - ${padur}) * (h - H)
'
" "${inputsrcbase}.mp4"
If you love `automatic’, then you want to detect the duration of the result movie, do like this:
#! /bin/bash
#
# usage: src2mp4.sh your_source
#
inputsrc="${1:-${0}}"
inputsrcbase="`basename \"${inputsrc}\"`"
tdur=${tdur:-$((`cat "${inputsrc}" | wc -l` / 4))}
# if you don't want to depend on "bash", you can:
# tdur=${tdur:-`expr \`cat "${inputsrc}" | wc -l\` / 4`}
pbdur=${pbdur:-5} # pause before scrolling
padur=${padur:-6} # pause after scrolling
#
# If you do not want to print out line numbers, highlight a specific line,
# or change the style, see the pygmentize help or the Pygments documentation.
#
pygmentize -g -o /tmp/code.png "${inputsrc}" # -> generate /tmp/code.png
#
ffmpeg -y -i /tmp/code.png -filter_complex "
color=black:s=1280x720:d=${tdur}[vb];
[0:v]loop=-1:size=2,scale=1280:-1[vt];
[vb][vt]overlay='
shortest=1
:x=0
:y=-min(max(0, t - ${pbdur}), (${tdur} - ${pbdur} - ${padur})) /
(${tdur} - ${pbdur} - ${padur}) * (h - H)
'
" "${inputsrcbase}.mp4"
To emphasize lines, to omit linenumbers¶
If you want to “emphasize-lines”, want to “omit linenumbers”, for example:
#! /bin/sh
#
# usage: src2mp4.sh your_source
#
inputsrc="${1:-${0}}"
inputsrcbase="`basename \"${inputsrc}\"`"
tdur=${tdur:-`expr \`cat "${inputsrc}" | wc -l\` / 4`}
#tdur=${tdur:-$((`cat "${inputsrc}" | wc -l` / 4))}
pbdur=${pbdur:-5} # pause before scrolling
padur=${padur:-6} # pause after scrolling
#
# If you do not want to print out line numbers, highlight a specific line,
# or change the style, see the pygmentize help or the Pygments documentation.
#
pygopts=${pygopts:--O hl_lines="3 4",line_numbers=False}
#
pygmentize -g -o /tmp/code.png "${pygopts}" "${inputsrc}" # -> generate /tmp/code.png
#
ffmpeg -y -i /tmp/code.png -filter_complex "
color=black:s=1280x720:d=${tdur}[vb];
[0:v]loop=-1:size=2,scale=1280:-1[vt];
[vb][vt]overlay='
shortest=1
:x=0
:y=-min(max(0, t - ${pbdur}), (${tdur} - ${pbdur} - ${padur})) /
(${tdur} - ${pbdur} - ${padur}) * (h - H)
'
" "${inputsrcbase}.mp4"
Visualizing the result of `trace.py -t’¶
Warning
Don’t think of the technique presented here as one of your program’s debugging goals. If you try to apply this to a real world program that requires serious debugging, you will be stunned facing huge traces and huge scripts (and, if successful, huge videos of the result). The techniques presented here should be used only for commentary or education. If you want to debug, use the debugger straightly.
Python provides some debugging features that are easy to use at any time. One of them is “trace.py”:
[me@host: ~]$ python -m trace -t /path/to/your_script.py
...
[me@host: ~]$ echo "a, c = d" | python -m trace -t /path/to/python/Lib/tokenize.py
--- modulename: tokenize, funcname: <module>
tokenize.py(21): """
tokenize.py(23): __author__ = 'Ka-Ping Yee <ping@lfw.org>'
tokenize.py(24): __credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '
tokenize.py(27): from builtins import open as _builtin_open
--- modulename: _bootstrap, funcname: _handle_fromlist
<frozen importlib._bootstrap>(1006): <frozen importlib._bootstrap>(1025): tokenize.py(28): from codecs import lookup, BOM_UTF8
--- modulename: _bootstrap, funcname: _handle_fromlist
<frozen importlib._bootstrap>(1006): <frozen importlib._bootstrap>(1025): tokenize.py(29): import collections
tokenize.py(30): from io import TextIOWrapper
... (snip) ...
tokenize.py(707): yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')
tokenize.py(753): token_type = token.type
tokenize.py(754): if args.exact:
tokenize.py(756): token_range = "%d,%d-%d,%d:" % (token.start + token.end)
tokenize.py(757): print("%-20s%-15s%-15r" %
tokenize.py(758): (token_range, tok_name[token_type], token.string))
2,0-2,0: ENDMARKER ''
tokenize.py(752): for token in tokens:
--- modulename: tokenize, funcname: _tokenize
--- modulename: trace, funcname: _unsettrace
trace.py(77): sys.settrace(None)
Let’s think about making a video that tracks the line numbers of the trace results for “tokenize.py”. To achieve this, the simplest approach is to divide the range of timestamps by “between” etc and sum them up:
#! /bin/sh
ffmpeg -y -i in.png -filter_complex "
color=white:s=1920x1080:d=30[bg];
[0:v]loop=-1:size=2[fg];
[bg][fg]overlay='y=
between(t, 0, 15 - 0.01) * (-t * 50)
+ gte(t, 15) * (-750 + (t - 15) * 50)'
" out.mp4
Here is a script based on this simple idea:
# -*- coding: utf-8 -*-
from __future__ import division
import io
import re
import sys
import os
_source_fn = sys.argv[1]
_trace_res_fn = sys.argv[2]
# ================================================
# get linenumbers from the result of 'trace.py -t'
#
_rgx = re.compile(r"^([\d.]+ )?(.+?)\((\d+)\): .*$")
_trace_orig = []
with io.open(_trace_res_fn) as fi:
for k, ln in enumerate([
int(m.group(3))
for m in [
_rgx.match(line)
for line in re.split(r"\r*\n", fi.read().strip())
]
if m and m.group(2) == os.path.basename(_source_fn)]):
_trace_orig.append((k, ln))
# ============================
# omit except inflexion points
#
_xd = [(b[1] - a[1]) for a, b in zip(_trace_orig[:-1], _trace_orig[1:])]
_xdd = [b - a for a, b in zip(_xd[:-1], _xd[1:])]
_inds = [0] + [
(k + 1) for k, d in enumerate(_xdd)
if d != 0
] + [len(_trace_orig) - 1]
_trace = [(k, ln) for k, ln in _trace_orig if k in _inds]
# ===============
# generate script
#
_speed = 1.5
_bet = {
False: "between(${{t}}, {}, {:g})", # not last
True: "gte(${{t}}, {})", # last
}
_fcs = "\n+ ".join([
"{} * ({} - 10 + max(0, min({}, 1.4 * (${{t}} - 0.5 - {}))) * {:g})".format(
_bet[i == len(_trace) - 2].format(k0, k1 - 1e-3),
ln0 - 1,
(k1 - k0),
k0,
(ln1 - ln0) / (k1 - k0))
for i, ((k0, ln0), (k1, ln1)) in enumerate(
zip(_trace[:-1], _trace[1:]))])
_fcs = """\
color=white:s=1920x1080:d={}[bg];
[0:v]loop=-1:size=2[fg];
[bg][fg]overlay='y=
-${{hr}} * (
{}
)':shortest=1
,drawbox=x=0:y=10*${{hr}}-8:w=1920:h=${{hr}}+16:c=blue:t=2
""".format(_trace[-1][0] / _speed + 1, _fcs)
#
print("""\
#! /bin/sh
sfn="{}"
sbfn="`basename \\"${{sfn}}\\"`"
#
test -f _"${{sbfn}}".png || \\
pygmentize -g -o _"${{sbfn}}".png -O "image_pad=0" "${{sfn}}"
test -f "${{sbfn}}".png || \\
ffmpeg -y -i _"${{sbfn}}".png -vf 'scale=1920:-1' "${{sbfn}}".png > /dev/null 2>&1
img_height=`ffprobe "${{sbfn}}".png 2>&1 | \\
grep "Video:" | sed 's@^.*, [0-9]*x\\([0-9]*\\),.*$@\\1@'`
tl=`cat "${{sfn}}" | wc -l`
hr=`python -c "print(${{img_height}} / float(${{tl}}))"`
t="(t * {})"
#
trap 'rm -f _fcs.txt' 0 1 2 3 15
cat << __END__ > _fcs.txt
{}
__END__
#
ffmpeg -y -i "${{sbfn}}".png -filter_complex_script _fcs.txt "${{sbfn}}".mp4""".format(
_source_fn, _speed, _fcs))
[me@host: ~]$ targ="c:/Python35/Lib/tokenize.py"
[me@host: ~]$ echo "a, c = d" | python -m trace -t ${targ} > tokenize.py.trace.txt
[me@host: ~]$ python trace_t_to_video.py ${targ} tokenize.py.trace.txt > toktrace2mov.sh
#! /bin/sh
sfn="c:/Python35/Lib/tokenize.py"
sbfn="`basename \"${sfn}\"`"
#
test -f _"${sbfn}".png || \
pygmentize -g -o _"${sbfn}".png -O "image_pad=0" "${sfn}"
test -f "${sbfn}".png || \
ffmpeg -y -i _"${sbfn}".png -vf 'scale=1920:-1' "${sbfn}".png > /dev/null 2>&1
img_height=`ffprobe "${sbfn}".png 2>&1 | \
grep "Video:" | sed 's@^.*, [0-9]*x\([0-9]*\),.*$@\1@'`
tl=`cat "${sfn}" | wc -l`
hr=`python -c "print(${img_height} / float(${tl}))"`
t="(t * 1.5)"
#
trap 'rm -f _fcs.txt' 0 1 2 3 15
cat << __END__ > _fcs.txt
color=white:s=1920x1080:d=348.3333333333333[bg];
[0:v]loop=-1:size=2[fg];
[bg][fg]overlay='y=
-${hr} * (
between(${t}, 0, 0.999) * (20 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 0))) * 2)
+ between(${t}, 1, 1.999) * (22 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 1))) * 1)
+ between(${t}, 2, 4.999) * (23 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 2))) * 3)
+ between(${t}, 5, 5.999) * (32 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 5))) * 1)
+ between(${t}, 6, 6.999) * (33 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 6))) * 3)
+ between(${t}, 7, 7.999) * (36 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 7))) * 2)
+ between(${t}, 8, 10.999) * (38 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 8))) * 1)
+ between(${t}, 11, 11.999) * (41 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 11))) * 2)
+ between(${t}, 12, 17.999) * (43 - 10 + max(0, min(6, 1.4 * (${t} - 0.5 - 12))) * 1)
+ between(${t}, 18, 18.999) * (49 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 18))) * 2)
+ between(${t}, 19, 61.999) * (51 - 10 + max(0, min(43, 1.4 * (${t} - 0.5 - 19))) * 1)
+ between(${t}, 62, 62.999) * (94 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 62))) * 3)
+ between(${t}, 63, 63.999) * (97 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 63))) * 0)
+ between(${t}, 64, 64.999) * (97 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 64))) * 1)
+ between(${t}, 65, 65.999) * (98 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 65))) * 5)
+ between(${t}, 66, 66.999) * (103 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 66))) * 7)
+ between(${t}, 67, 68.999) * (110 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 67))) * 1)
+ between(${t}, 69, 69.999) * (112 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 69))) * 4)
+ between(${t}, 70, 71.999) * (116 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 70))) * 1)
+ between(${t}, 72, 72.999) * (118 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 72))) * -7)
+ between(${t}, 73, 73.999) * (111 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 73))) * -1)
+ between(${t}, 74, 74.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 74))) * 2)
+ between(${t}, 75, 75.999) * (112 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 75))) * -2)
+ between(${t}, 76, 76.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 76))) * 9)
+ between(${t}, 77, 77.999) * (119 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 77))) * 2)
+ between(${t}, 78, 81.999) * (121 - 10 + max(0, min(4, 1.4 * (${t} - 0.5 - 78))) * 1)
+ between(${t}, 82, 82.999) * (125 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 82))) * -15)
+ between(${t}, 83, 83.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 83))) * 16)
+ between(${t}, 84, 84.999) * (126 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 84))) * 1)
+ between(${t}, 85, 85.999) * (127 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 85))) * -17)
+ between(${t}, 86, 86.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 86))) * 2)
+ between(${t}, 87, 87.999) * (112 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 87))) * -2)
+ between(${t}, 88, 88.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 88))) * 18)
+ between(${t}, 89, 89.999) * (128 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 89))) * 1)
+ between(${t}, 90, 90.999) * (129 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 90))) * -19)
+ between(${t}, 91, 91.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 91))) * 20)
+ between(${t}, 92, 92.999) * (130 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 92))) * -20)
+ between(${t}, 93, 93.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 93))) * 21)
+ between(${t}, 94, 94.999) * (131 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 94))) * -21)
+ between(${t}, 95, 95.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 95))) * 23)
+ between(${t}, 96, 96.999) * (133 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 96))) * 3)
+ between(${t}, 97, 99.999) * (136 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 97))) * 2)
+ between(${t}, 100, 100.999) * (142 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 100))) * 1)
+ between(${t}, 101, 101.999) * (143 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 101))) * -33)
+ between(${t}, 102, 102.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 102))) * 35)
+ between(${t}, 103, 103.999) * (145 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 103))) * 1)
+ between(${t}, 104, 104.999) * (146 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 104))) * -36)
+ between(${t}, 105, 105.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 105))) * 41)
+ between(${t}, 106, 108.999) * (151 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 106))) * 1)
+ between(${t}, 109, 109.999) * (154 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 109))) * -44)
+ between(${t}, 110, 110.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 110))) * 46)
+ between(${t}, 111, 111.999) * (156 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 111))) * 1)
+ between(${t}, 112, 112.999) * (157 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 112))) * -47)
+ between(${t}, 113, 113.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 113))) * 48)
+ between(${t}, 114, 114.999) * (158 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 114))) * -48)
+ between(${t}, 115, 115.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 115))) * 50)
+ between(${t}, 116, 116.999) * (160 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 116))) * -50)
+ between(${t}, 117, 117.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 117))) * 51)
+ between(${t}, 118, 118.999) * (161 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 118))) * 3)
+ between(${t}, 119, 119.999) * (164 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 119))) * 1)
+ between(${t}, 120, 120.999) * (165 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 120))) * -55)
+ between(${t}, 121, 121.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 121))) * 56)
+ between(${t}, 122, 122.999) * (166 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 122))) * 1)
+ between(${t}, 123, 123.999) * (167 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 123))) * -57)
+ between(${t}, 124, 124.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 124))) * 0)
+ between(${t}, 125, 125.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 125))) * 58)
+ between(${t}, 126, 126.999) * (168 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 126))) * -58)
+ between(${t}, 127, 127.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 127))) * 59)
+ between(${t}, 128, 128.999) * (169 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 128))) * -59)
+ between(${t}, 129, 129.999) * (110 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 129))) * 61)
+ between(${t}, 130, 130.999) * (171 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 130))) * 3)
+ between(${t}, 131, 147.999) * (174 - 10 + max(0, min(17, 1.4 * (${t} - 0.5 - 131))) * 1)
+ between(${t}, 148, 148.999) * (191 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 148))) * 2)
+ between(${t}, 149, 149.999) * (193 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 149))) * 1)
+ between(${t}, 150, 150.999) * (194 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 150))) * 7)
+ between(${t}, 151, 151.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 151))) * 2)
+ between(${t}, 152, 152.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 152))) * -2)
+ between(${t}, 153, 153.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 153))) * 2)
+ between(${t}, 154, 154.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 154))) * -2)
+ between(${t}, 155, 155.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 155))) * 2)
+ between(${t}, 156, 156.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 156))) * -2)
+ between(${t}, 157, 157.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 157))) * 2)
+ between(${t}, 158, 158.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 158))) * -2)
+ between(${t}, 159, 159.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 159))) * 2)
+ between(${t}, 160, 160.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 160))) * -2)
+ between(${t}, 161, 161.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 161))) * 2)
+ between(${t}, 162, 162.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 162))) * -2)
+ between(${t}, 163, 163.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 163))) * 2)
+ between(${t}, 164, 164.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 164))) * -2)
+ between(${t}, 165, 165.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 165))) * 2)
+ between(${t}, 166, 166.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 166))) * -2)
+ between(${t}, 167, 167.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 167))) * 2)
+ between(${t}, 168, 168.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 168))) * -2)
+ between(${t}, 169, 169.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 169))) * 2)
+ between(${t}, 170, 170.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 170))) * -2)
+ between(${t}, 171, 171.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 171))) * 2)
+ between(${t}, 172, 172.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 172))) * -2)
+ between(${t}, 173, 173.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 173))) * 2)
+ between(${t}, 174, 174.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 174))) * -2)
+ between(${t}, 175, 175.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 175))) * 2)
+ between(${t}, 176, 176.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 176))) * -2)
+ between(${t}, 177, 177.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 177))) * 2)
+ between(${t}, 178, 178.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 178))) * -2)
+ between(${t}, 179, 179.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 179))) * 2)
+ between(${t}, 180, 180.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 180))) * -2)
+ between(${t}, 181, 181.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 181))) * 2)
+ between(${t}, 182, 182.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 182))) * -2)
+ between(${t}, 183, 183.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 183))) * 2)
+ between(${t}, 184, 184.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 184))) * -2)
+ between(${t}, 185, 185.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 185))) * 2)
+ between(${t}, 186, 186.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 186))) * -2)
+ between(${t}, 187, 187.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 187))) * 2)
+ between(${t}, 188, 188.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 188))) * -2)
+ between(${t}, 189, 189.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 189))) * 2)
+ between(${t}, 190, 190.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 190))) * -2)
+ between(${t}, 191, 191.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 191))) * 2)
+ between(${t}, 192, 192.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 192))) * -2)
+ between(${t}, 193, 193.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 193))) * 2)
+ between(${t}, 194, 194.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 194))) * -2)
+ between(${t}, 195, 195.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 195))) * 2)
+ between(${t}, 196, 196.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 196))) * -2)
+ between(${t}, 197, 197.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 197))) * 2)
+ between(${t}, 198, 198.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 198))) * -2)
+ between(${t}, 199, 199.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 199))) * 2)
+ between(${t}, 200, 200.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 200))) * -2)
+ between(${t}, 201, 201.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 201))) * 2)
+ between(${t}, 202, 202.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 202))) * -2)
+ between(${t}, 203, 203.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 203))) * 2)
+ between(${t}, 204, 204.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 204))) * -2)
+ between(${t}, 205, 205.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 205))) * 2)
+ between(${t}, 206, 206.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 206))) * -2)
+ between(${t}, 207, 207.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 207))) * 2)
+ between(${t}, 208, 208.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 208))) * -2)
+ between(${t}, 209, 209.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 209))) * 2)
+ between(${t}, 210, 210.999) * (203 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 210))) * -2)
+ between(${t}, 211, 211.999) * (201 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 211))) * 3)
+ between(${t}, 212, 212.999) * (204 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 212))) * 1)
+ between(${t}, 213, 213.999) * (205 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 213))) * 7)
+ between(${t}, 214, 214.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 214))) * 2)
+ between(${t}, 215, 215.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 215))) * -2)
+ between(${t}, 216, 216.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 216))) * 2)
+ between(${t}, 217, 217.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 217))) * -2)
+ between(${t}, 218, 218.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 218))) * 2)
+ between(${t}, 219, 219.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 219))) * -2)
+ between(${t}, 220, 220.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 220))) * 2)
+ between(${t}, 221, 221.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 221))) * -2)
+ between(${t}, 222, 222.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 222))) * 2)
+ between(${t}, 223, 223.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 223))) * -2)
+ between(${t}, 224, 224.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 224))) * 2)
+ between(${t}, 225, 225.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 225))) * -2)
+ between(${t}, 226, 226.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 226))) * 2)
+ between(${t}, 227, 227.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 227))) * -2)
+ between(${t}, 228, 228.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 228))) * 2)
+ between(${t}, 229, 229.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 229))) * -2)
+ between(${t}, 230, 230.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 230))) * 2)
+ between(${t}, 231, 231.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 231))) * -2)
+ between(${t}, 232, 232.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 232))) * 2)
+ between(${t}, 233, 233.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 233))) * -2)
+ between(${t}, 234, 234.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 234))) * 2)
+ between(${t}, 235, 235.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 235))) * -2)
+ between(${t}, 236, 236.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 236))) * 2)
+ between(${t}, 237, 237.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 237))) * -2)
+ between(${t}, 238, 238.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 238))) * 2)
+ between(${t}, 239, 239.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 239))) * -2)
+ between(${t}, 240, 240.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 240))) * 2)
+ between(${t}, 241, 241.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 241))) * -2)
+ between(${t}, 242, 242.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 242))) * 2)
+ between(${t}, 243, 243.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 243))) * -2)
+ between(${t}, 244, 244.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 244))) * 2)
+ between(${t}, 245, 245.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 245))) * -2)
+ between(${t}, 246, 246.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 246))) * 2)
+ between(${t}, 247, 247.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 247))) * -2)
+ between(${t}, 248, 248.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 248))) * 2)
+ between(${t}, 249, 249.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 249))) * -2)
+ between(${t}, 250, 250.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 250))) * 2)
+ between(${t}, 251, 251.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 251))) * -2)
+ between(${t}, 252, 252.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 252))) * 2)
+ between(${t}, 253, 253.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 253))) * -2)
+ between(${t}, 254, 254.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 254))) * 2)
+ between(${t}, 255, 255.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 255))) * -2)
+ between(${t}, 256, 256.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 256))) * 2)
+ between(${t}, 257, 257.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 257))) * -2)
+ between(${t}, 258, 258.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 258))) * 2)
+ between(${t}, 259, 259.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 259))) * -2)
+ between(${t}, 260, 260.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 260))) * 2)
+ between(${t}, 261, 261.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 261))) * -2)
+ between(${t}, 262, 262.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 262))) * 2)
+ between(${t}, 263, 263.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 263))) * -2)
+ between(${t}, 264, 264.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 264))) * 2)
+ between(${t}, 265, 265.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 265))) * -2)
+ between(${t}, 266, 266.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 266))) * 2)
+ between(${t}, 267, 267.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 267))) * -2)
+ between(${t}, 268, 268.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 268))) * 2)
+ between(${t}, 269, 269.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 269))) * -2)
+ between(${t}, 270, 270.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 270))) * 2)
+ between(${t}, 271, 271.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 271))) * -2)
+ between(${t}, 272, 272.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 272))) * 2)
+ between(${t}, 273, 273.999) * (214 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 273))) * -2)
+ between(${t}, 274, 274.999) * (212 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 274))) * 4)
+ between(${t}, 275, 275.999) * (216 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 275))) * 2)
+ between(${t}, 276, 276.999) * (218 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 276))) * 0)
+ between(${t}, 277, 277.999) * (218 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 277))) * 2)
+ between(${t}, 278, 278.999) * (220 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 278))) * 0)
+ between(${t}, 279, 279.999) * (220 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 279))) * 3)
+ between(${t}, 280, 280.999) * (223 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 280))) * 0)
+ between(${t}, 281, 281.999) * (223 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 281))) * 2)
+ between(${t}, 282, 282.999) * (225 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 282))) * 6)
+ between(${t}, 283, 283.999) * (231 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 283))) * 13)
+ between(${t}, 284, 285.999) * (244 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 284))) * 37)
+ between(${t}, 286, 286.999) * (318 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 286))) * 27)
+ between(${t}, 287, 287.999) * (345 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 287))) * 11)
+ between(${t}, 288, 288.999) * (356 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 288))) * 93)
+ between(${t}, 289, 289.999) * (449 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 289))) * 16)
+ between(${t}, 290, 290.999) * (465 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 290))) * 28)
+ between(${t}, 291, 291.999) * (493 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 291))) * 218)
+ between(${t}, 292, 292.999) * (711 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 292))) * 3)
+ between(${t}, 293, 293.999) * (714 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 293))) * 60)
+ between(${t}, 294, 294.999) * (774 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 294))) * 1)
+ between(${t}, 295, 295.999) * (775 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 295))) * -60)
+ between(${t}, 296, 296.999) * (715 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 296))) * 6)
+ between(${t}, 297, 297.999) * (721 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 297))) * 11)
+ between(${t}, 298, 303.999) * (732 - 10 + max(0, min(6, 1.4 * (${t} - 0.5 - 298))) * 1)
+ between(${t}, 304, 305.999) * (738 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 304))) * 2)
+ between(${t}, 306, 306.999) * (742 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 306))) * 5)
+ between(${t}, 307, 307.999) * (747 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 307))) * 1)
+ between(${t}, 308, 308.999) * (748 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 308))) * 3)
+ between(${t}, 309, 309.999) * (751 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 309))) * -257)
+ between(${t}, 310, 313.999) * (494 - 10 + max(0, min(4, 1.4 * (${t} - 0.5 - 310))) * 1)
+ between(${t}, 314, 314.999) * (498 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 314))) * 3)
+ between(${t}, 315, 317.999) * (501 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 315))) * 1)
+ between(${t}, 318, 318.999) * (504 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 318))) * 2)
+ between(${t}, 319, 319.999) * (506 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 319))) * 5)
+ between(${t}, 320, 321.999) * (511 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 320))) * 1)
+ between(${t}, 322, 322.999) * (513 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 322))) * 4)
+ between(${t}, 323, 323.999) * (517 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 323))) * 2)
+ between(${t}, 324, 324.999) * (519 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 324))) * 1)
+ between(${t}, 325, 325.999) * (520 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 325))) * 2)
+ between(${t}, 326, 326.999) * (522 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 326))) * 21)
+ between(${t}, 327, 330.999) * (543 - 10 + max(0, min(4, 1.4 * (${t} - 0.5 - 327))) * 1)
+ between(${t}, 331, 332.999) * (547 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 331))) * 2)
+ between(${t}, 333, 333.999) * (551 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 333))) * 3)
+ between(${t}, 334, 334.999) * (554 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 334))) * 2)
+ between(${t}, 335, 335.999) * (556 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 335))) * 3)
+ between(${t}, 336, 336.999) * (559 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 336))) * 13)
+ between(${t}, 337, 337.999) * (572 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 337))) * 3)
+ between(${t}, 338, 338.999) * (575 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 338))) * 14)
+ between(${t}, 339, 339.999) * (589 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 339))) * 10)
+ between(${t}, 340, 340.999) * (599 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 340))) * 1)
+ between(${t}, 341, 341.999) * (600 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 341))) * -428)
+ between(${t}, 342, 342.999) * (172 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 342))) * 429)
+ between(${t}, 343, 345.999) * (601 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 343))) * 1)
+ between(${t}, 346, 347.999) * (604 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 346))) * 2)
+ between(${t}, 348, 348.999) * (608 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 348))) * 1)
+ between(${t}, 349, 349.999) * (609 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 349))) * 2)
+ between(${t}, 350, 350.999) * (611 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 350))) * 11)
+ between(${t}, 351, 351.999) * (622 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 351))) * 6)
+ between(${t}, 352, 352.999) * (628 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 352))) * 12)
+ between(${t}, 353, 354.999) * (640 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 353))) * 1)
+ between(${t}, 355, 355.999) * (642 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 355))) * 11)
+ between(${t}, 356, 356.999) * (653 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 356))) * 1)
+ between(${t}, 357, 357.999) * (654 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 357))) * 7)
+ between(${t}, 358, 358.999) * (661 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 358))) * 1)
+ between(${t}, 359, 359.999) * (662 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 359))) * 4)
+ between(${t}, 360, 360.999) * (666 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 360))) * 13)
+ between(${t}, 361, 361.999) * (679 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 361))) * 4)
+ between(${t}, 362, 362.999) * (683 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 362))) * 69)
+ between(${t}, 363, 363.999) * (752 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 363))) * 1)
+ between(${t}, 364, 364.999) * (753 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 364))) * 2)
+ between(${t}, 365, 366.999) * (755 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 365))) * 1)
+ between(${t}, 367, 367.999) * (757 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 367))) * -6)
+ between(${t}, 368, 368.999) * (751 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 368))) * -152)
+ between(${t}, 369, 369.999) * (599 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 369))) * 1)
+ between(${t}, 370, 370.999) * (600 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 370))) * -428)
+ between(${t}, 371, 371.999) * (172 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 371))) * 429)
+ between(${t}, 372, 374.999) * (601 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 372))) * 1)
+ between(${t}, 375, 376.999) * (604 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 375))) * 2)
+ between(${t}, 377, 377.999) * (608 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 377))) * 1)
+ between(${t}, 378, 378.999) * (609 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 378))) * 2)
+ between(${t}, 379, 379.999) * (611 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 379))) * 11)
+ between(${t}, 380, 380.999) * (622 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 380))) * 6)
+ between(${t}, 381, 381.999) * (628 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 381))) * 12)
+ between(${t}, 382, 383.999) * (640 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 382))) * 1)
+ between(${t}, 384, 384.999) * (642 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 384))) * 11)
+ between(${t}, 385, 385.999) * (653 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 385))) * 31)
+ between(${t}, 386, 386.999) * (684 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 386))) * 3)
+ between(${t}, 387, 388.999) * (687 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 387))) * 2)
+ between(${t}, 389, 389.999) * (691 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 389))) * 3)
+ between(${t}, 390, 390.999) * (694 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 390))) * 58)
+ between(${t}, 391, 391.999) * (752 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 391))) * 1)
+ between(${t}, 392, 392.999) * (753 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 392))) * 2)
+ between(${t}, 393, 394.999) * (755 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 393))) * 1)
+ between(${t}, 395, 395.999) * (757 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 395))) * -6)
+ between(${t}, 396, 396.999) * (751 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 396))) * -152)
+ between(${t}, 397, 397.999) * (599 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 397))) * 1)
+ between(${t}, 398, 398.999) * (600 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 398))) * -428)
+ between(${t}, 399, 399.999) * (172 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 399))) * 429)
+ between(${t}, 400, 402.999) * (601 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 400))) * 1)
+ between(${t}, 403, 404.999) * (604 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 403))) * 2)
+ between(${t}, 405, 405.999) * (608 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 405))) * 1)
+ between(${t}, 406, 406.999) * (609 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 406))) * 2)
+ between(${t}, 407, 407.999) * (611 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 407))) * 11)
+ between(${t}, 408, 408.999) * (622 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 408))) * 6)
+ between(${t}, 409, 409.999) * (628 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 409))) * 12)
+ between(${t}, 410, 411.999) * (640 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 410))) * 1)
+ between(${t}, 412, 412.999) * (642 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 412))) * 11)
+ between(${t}, 413, 413.999) * (653 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 413))) * 1)
+ between(${t}, 414, 414.999) * (654 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 414))) * 7)
+ between(${t}, 415, 415.999) * (661 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 415))) * 1)
+ between(${t}, 416, 416.999) * (662 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 416))) * 4)
+ between(${t}, 417, 417.999) * (666 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 417))) * 13)
+ between(${t}, 418, 418.999) * (679 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 418))) * 4)
+ between(${t}, 419, 419.999) * (683 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 419))) * 69)
+ between(${t}, 420, 420.999) * (752 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 420))) * 1)
+ between(${t}, 421, 421.999) * (753 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 421))) * 2)
+ between(${t}, 422, 423.999) * (755 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 422))) * 1)
+ between(${t}, 424, 424.999) * (757 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 424))) * -6)
+ between(${t}, 425, 425.999) * (751 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 425))) * -152)
+ between(${t}, 426, 426.999) * (599 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 426))) * 1)
+ between(${t}, 427, 427.999) * (600 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 427))) * -428)
+ between(${t}, 428, 428.999) * (172 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 428))) * 429)
+ between(${t}, 429, 431.999) * (601 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 429))) * 1)
+ between(${t}, 432, 433.999) * (604 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 432))) * 2)
+ between(${t}, 434, 434.999) * (608 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 434))) * 1)
+ between(${t}, 435, 435.999) * (609 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 435))) * 2)
+ between(${t}, 436, 436.999) * (611 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 436))) * 11)
+ between(${t}, 437, 437.999) * (622 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 437))) * 6)
+ between(${t}, 438, 438.999) * (628 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 438))) * 12)
+ between(${t}, 439, 440.999) * (640 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 439))) * 1)
+ between(${t}, 441, 441.999) * (642 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 441))) * 11)
+ between(${t}, 442, 442.999) * (653 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 442))) * 31)
+ between(${t}, 443, 443.999) * (684 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 443))) * 3)
+ between(${t}, 444, 445.999) * (687 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 444))) * 2)
+ between(${t}, 446, 446.999) * (691 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 446))) * 3)
+ between(${t}, 447, 447.999) * (694 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 447))) * 58)
+ between(${t}, 448, 448.999) * (752 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 448))) * 1)
+ between(${t}, 449, 449.999) * (753 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 449))) * 2)
+ between(${t}, 450, 451.999) * (755 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 450))) * 1)
+ between(${t}, 452, 452.999) * (757 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 452))) * -6)
+ between(${t}, 453, 453.999) * (751 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 453))) * -152)
+ between(${t}, 454, 454.999) * (599 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 454))) * 1)
+ between(${t}, 455, 455.999) * (600 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 455))) * -428)
+ between(${t}, 456, 456.999) * (172 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 456))) * 429)
+ between(${t}, 457, 459.999) * (601 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 457))) * 1)
+ between(${t}, 460, 461.999) * (604 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 460))) * 2)
+ between(${t}, 462, 462.999) * (608 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 462))) * 1)
+ between(${t}, 463, 463.999) * (609 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 463))) * 2)
+ between(${t}, 464, 464.999) * (611 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 464))) * 11)
+ between(${t}, 465, 465.999) * (622 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 465))) * 6)
+ between(${t}, 466, 466.999) * (628 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 466))) * 12)
+ between(${t}, 467, 468.999) * (640 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 467))) * 1)
+ between(${t}, 469, 469.999) * (642 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 469))) * 11)
+ between(${t}, 470, 470.999) * (653 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 470))) * 1)
+ between(${t}, 471, 471.999) * (654 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 471))) * 7)
+ between(${t}, 472, 472.999) * (661 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 472))) * 1)
+ between(${t}, 473, 473.999) * (662 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 473))) * 4)
+ between(${t}, 474, 474.999) * (666 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 474))) * 13)
+ between(${t}, 475, 475.999) * (679 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 475))) * 4)
+ between(${t}, 476, 476.999) * (683 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 476))) * 69)
+ between(${t}, 477, 477.999) * (752 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 477))) * 1)
+ between(${t}, 478, 478.999) * (753 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 478))) * 2)
+ between(${t}, 479, 480.999) * (755 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 479))) * 1)
+ between(${t}, 481, 481.999) * (757 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 481))) * -6)
+ between(${t}, 482, 482.999) * (751 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 482))) * -152)
+ between(${t}, 483, 483.999) * (599 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 483))) * 1)
+ between(${t}, 484, 484.999) * (600 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 484))) * -428)
+ between(${t}, 485, 485.999) * (172 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 485))) * 429)
+ between(${t}, 486, 488.999) * (601 - 10 + max(0, min(3, 1.4 * (${t} - 0.5 - 486))) * 1)
+ between(${t}, 489, 490.999) * (604 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 489))) * 2)
+ between(${t}, 491, 491.999) * (608 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 491))) * 1)
+ between(${t}, 492, 492.999) * (609 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 492))) * 2)
+ between(${t}, 493, 493.999) * (611 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 493))) * 1)
+ between(${t}, 494, 495.999) * (612 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 494))) * 3)
+ between(${t}, 496, 496.999) * (618 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 496))) * 134)
+ between(${t}, 497, 497.999) * (752 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 497))) * 1)
+ between(${t}, 498, 498.999) * (753 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 498))) * 2)
+ between(${t}, 499, 500.999) * (755 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 499))) * 1)
+ between(${t}, 501, 501.999) * (757 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 501))) * -6)
+ between(${t}, 502, 502.999) * (751 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 502))) * -132)
+ between(${t}, 503, 503.999) * (619 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 503))) * -20)
+ between(${t}, 504, 504.999) * (599 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 504))) * -87)
+ between(${t}, 505, 505.999) * (512 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 505))) * 1)
+ between(${t}, 506, 506.999) * (513 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 506))) * 4)
+ between(${t}, 507, 507.999) * (517 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 507))) * 2)
+ between(${t}, 508, 508.999) * (519 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 508))) * 1)
+ between(${t}, 509, 509.999) * (520 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 509))) * 2)
+ between(${t}, 510, 510.999) * (522 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 510))) * 21)
+ between(${t}, 511, 511.999) * (543 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 511))) * 1)
+ between(${t}, 512, 512.999) * (544 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 512))) * 156)
+ between(${t}, 513, 513.999) * (700 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 513))) * 4)
+ between(${t}, 514, 514.999) * (704 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 514))) * 2)
+ between(${t}, 515, 515.999) * (706 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 515))) * 46)
+ between(${t}, 516, 516.999) * (752 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 516))) * 1)
+ between(${t}, 517, 517.999) * (753 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 517))) * 2)
+ between(${t}, 518, 519.999) * (755 - 10 + max(0, min(2, 1.4 * (${t} - 0.5 - 518))) * 1)
+ gte(${t}, 520) * (757 - 10 + max(0, min(1, 1.4 * (${t} - 0.5 - 520))) * -6)
)':shortest=1
,drawbox=x=0:y=10*${hr}-8:w=1920:h=${hr}+16:c=blue:t=2
__END__
#
ffmpeg -y -i "${sbfn}".png -filter_complex_script _fcs.txt "${sbfn}".mp4
Running toktrace2mov.sh produces the following video:
Watch on youtube.com