Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-111997.svg)](#build--distribution)
[![Electron](https://img.shields.io/badge/Electron-43-47848F.svg)](https://www.electronjs.org/)
[![Downloads](https://img.shields.io/github/downloads/CaYatur/SoundVisualizer/total?label=downloads)](https://github.com/CaYatur/SoundVisualizer/releases)
[![Tests](https://img.shields.io/badge/tests-2187%20passing-2ea043.svg)](#tests)
[![Tests](https://img.shields.io/badge/tests-2197%20passing-2ea043.svg)](#tests)
[![cayadev.com](https://img.shields.io/badge/cayadev.com-e11d2a.svg)](https://cayadev.com)

</div>
Expand Down Expand Up @@ -258,6 +258,11 @@ that asserts the bar profile has no step in it.
equations (wave scale and smoothing, the volume fade, warp speed and scale) come from the file as
they do there, so a wave scale of 0 flattens the wave (102 presets of the corpus). Rendered
through the engine, every case matches MilkDrop's formula within 2/255.
- **Preset files are read the way MilkDrop reads them.** With fidelity on, keys are case-sensitive,
a key written twice takes the value MilkDrop finds (usually the first), numbered code ends at the
first missing number, integer settings drop their fractions, and equation lines are glued the way
MilkDrop glues them, `\\` comments included. 32 presets of the corpus read differently; with
fidelity off the old parser stays.
- **Composite shaders get the hue colour MilkDrop gives them.** MilkDrop passes every composite
shader four slowly drifting corner colours as `hue_shader`, whatever the preset's `fShader`
says; `fShader` only scales them on the fixed pipeline. The engine applied `fShader` to shaders
Expand Down Expand Up @@ -1308,7 +1313,7 @@ npm test
npm start -- --smoke
```

**2187 unit tests, all passing.** They are written to check answers, not to exercise lines:
**2197 unit tests, all passing.** They are written to check answers, not to exercise lines:

- **Formulas** are checked against values derived by hand from their definitions — Viviani's curve
staying on its sphere, the torus tube radius, Chladni's m↔n antisymmetry, every attractor
Expand Down
9 changes: 7 additions & 2 deletions README.tr.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-111997.svg)](#paketleme--dağıtım)
[![Electron](https://img.shields.io/badge/Electron-43-47848F.svg)](https://www.electronjs.org/)
[![İndirme](https://img.shields.io/github/downloads/CaYatur/SoundVisualizer/total?label=indirme)](https://github.com/CaYatur/SoundVisualizer/releases)
[![Test](https://img.shields.io/badge/test-2187%20geçiyor-2ea043.svg)](#testler)
[![Test](https://img.shields.io/badge/test-2197%20geçiyor-2ea043.svg)](#testler)
[![cayadev.com](https://img.shields.io/badge/cayadev.com-e11d2a.svg)](https://cayadev.com)

</div>
Expand Down Expand Up @@ -251,6 +251,11 @@ profilinde basamak olmadığını doğruluyor.
(dalga ölçeği ve yumuşatması, sesle sönme, warp hızı ve ölçeği) oradaki gibi dosyadan geliyor, yani
0 dalga ölçeği dalgayı düzleştiriyor (korpusta 102 preset). Motordan geçirilerek çizildi: her
durum MilkDrop'un formülüyle 2/255 içinde aynı.
- **Preset dosyaları MilkDrop'un okuduğu gibi okunuyor.** Uyum açıkken anahtarlar büyük/küçük harfe
duyarlı, iki kez yazılmış bir anahtar MilkDrop'un bulduğu değeri (çoğunlukla ilkini) alıyor,
numaralı kod ilk eksik numarada bitiyor, tam sayı ayarları kesirlerini atıyor ve denklem satırları
MilkDrop'un yapıştırdığı gibi, `\\` yorumları dahil, yapışıyor. Korpusta 32 preset farklı
okunuyor; uyum kapalıyken eski ayrıştırıcı duruyor.
- **Birleştirme shader'ları MilkDrop'un verdiği ton rengini alıyor.** MilkDrop her birleştirme
shader'ına `hue_shader` olarak dört köşede yavaşça gezinen renkler veriyor, presetin `fShader`ı
ne derse desin; `fShader` onları yalnız sabit yolda ölçekliyor. Motor `fShader`ı shader'lara da
Expand Down Expand Up @@ -1306,7 +1311,7 @@ npm test
npm start -- --smoke
```

**2187 birim testi, hepsi geçiyor.** Satır çalıştırmak için değil, cevap denetlemek için yazıldılar:
**2197 birim testi, hepsi geçiyor.** Satır çalıştırmak için değil, cevap denetlemek için yazıldılar:

- **Formüller**, tanımlarından elle türetilmiş değerlerle sınanıyor — Viviani eğrisinin küre
üzerinde kalması, simidin boru yarıçapı, Chladni'nin m↔n antisimetrisi, her çekicinin sınırlı
Expand Down
97 changes: 75 additions & 22 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ npm test
npm start -- --smoke
```

- **2187 unit tests, all passing** on `main`. 703 of those shipped in v3.1.0;
- **2197 unit tests, all passing** on `main`. 703 of those shipped in v3.1.0;
105 came with v3.1.1; 163 came with v3.1.2; 157 came with v3.1.3 — 1128 at
that tag — 469 more with v3.1.4, most of them from the MilkDrop work, and 590
that tag — 469 more with v3.1.4, most of them from the MilkDrop work, and 600
on `main` since.
Formulas are checked against values derived
by hand from their definitions — Viviani's curve staying on its sphere, the
Expand Down Expand Up @@ -1963,13 +1963,14 @@ rest after. No version number yet.
gives a part. ◀ ▶ step through a history of recipes (part → preset);
a recipe whose preset was deleted is skipped. The id comes from the
recipe (`md_mix`, the rule version and two 32-bit hashes; the
version is 2 since #580), so the same mash-up saved twice leaves one
version is 3 since #580), so the same mash-up saved twice leaves one
file, and the version in it keeps later rule changes from
overwriting earlier saves.
- *Part tests* decide which presets can give a part without parsing
them (13.5 µs a test): a non-comment equation line, an enabled wave
or shape block, a non-empty shader line (since #580, one whose stage
version MilkDrop reads as above 0).
- *Part tests* decide which presets can give a part: a non-comment
equation line, an enabled wave or shape block, a non-empty shader
line. They first worked on the text without parsing it (13.5 µs a
test); since #580 they read the file the way MilkDrop does (0.04 ms)
and a shader counts only if MilkDrop draws it.
- **Mash-ups measured** on the whole 10,332-preset corpus. The part tests
agree with the parser for every preset and part. A mash-up whose six
parts come from one preset is that preset again for all 10,332 —
Expand Down Expand Up @@ -2032,8 +2033,8 @@ rest after. No version number yet.
the old ring nouns, the " · " in mash-up names or removing the
module's script tag each fails a test.
- **Fidelity follow-ups (#580)** · the fixed composite, the stage rule,
MilkDrop's defaults, the hue colour and the values that stay in the file
are done; the other audits and the file-reading differences are next.
MilkDrop's defaults, the hue colour, the values that stay in the file and
MilkDrop's way of reading a file are done; the other audits are next.
- **Checked against the source.** Nullsoft's own code
(jecassis/foo_vis_milk2 5b44cea) and, for the fixed pipeline's blend
passes, the D3D9 code the D3D11 fork was ported from (BeatDrop
Expand Down Expand Up @@ -2174,19 +2175,62 @@ rest after. No version number yet.
flat; of the 4 with warp speed 0, one changes, slightly. With fidelity
off all of them are identical. The 900-preset sample sorts into the
same classes, preset for preset.
- **Files read the way MilkDrop reads them.** With fidelity on, a preset
file goes through a reader that follows MilkDrop's own
(`parseMilkMd2`; state.cpp _GetLineByName, the GetFast readers,
ReadCode and the three Import functions, the same in the D3D9 code);
with it off the old parser stays. MilkDrop first indexes the file line
by line — a line's name runs to the first `=`, space or line break —
and then looks the keys up in its own order, trying the line after the
previous read before scanning from the top. So keys are case-sensitive;
an indented line has an empty name and is never read; `key value` is
read and `key = value` is not; a key written twice takes the next line
or the first occurrence, not the last; integer keys are `%d`
(`textured=0.05` is off, where we had it on) and float keys take the
leading number (`.975;` is 0.975); numbered code ends at the first
missing number; and equation lines lose `//` and `\\` comments and are
glued with nothing between them, trailing spaces kept. A simulation of
that reader against our parser found real differences in 25 files of
the corpus; the engine-side check (`readingsDiffer`: stage versions,
the numeric keys the engine reads, equations without whitespace) finds
32 — duplicated keys (4 presets), fractions in integer keys (11), key
case (2), a per-frame name written in the header, shapes past MilkDrop
2's four, a `\\` comment, a gap in the numbering. Our builtins,
generated presets and mash-ups read the same both ways. Turning
fidelity over rebuilds the running preset only when the two readings
differ for it, and the stage choice reads the file the same way.
- **Mash-ups read their donors the same way.** A preset gives a part only
if MilkDrop reads that part from it, and the version lines written for a
shader are the ones MilkDrop reads from its donor — a donor writing
`PSVERSION_comp=3` gives version 2. The same recipe can give different
version lines than before, so the mash-up rule version went to 3. The
part test now reads the file (0.04 ms a test, was 0.014); on the whole
corpus it agrees with the engine for every preset and part, a mash-up of
one preset reads as that preset for all 10,332, and 5,000 random
mash-ups keep every part and stage of their donors.
- **Measured** against `main`, the last ten of 60 frames: 120 control
presets are identical with fidelity on and off; of the 32 that read
differently, 15 change with fidelity on, 12 by more than 1% (up to
32%), and all 32 are identical with it off. The 900-preset sample sorts
into the same classes, preset for preset.
- **Not done yet:** the fixed warp path, the blur chain, borders and
centre darkening, and the rest of the blend snap points; the
file-reading differences found while building the mash-ups (a
duplicated key, where MilkDrop reads the first occurrence and we keep
the last; numbered code that MilkDrop stops reading at the first
missing number; `\\` comments; integer keys holding fractions; text
after a number; key case; indented lines — about 40 corpus presets in
all); whether `uv` in preset shaders runs the way MilkDrop's does —
read back from the screen, our `uv.y` is 1 at the top, where MilkDrop's
texture coordinate is 0; sampling agrees, but a shader doing arithmetic
on `uv.y` may come out mirrored, which needs its own check; the
reference comparison with an external renderer, which needs one
installed and waits for the user's approval.
centre darkening, and the rest of the blend snap points; whether `uv`
in preset shaders runs the way MilkDrop's does — read back from the
screen, our `uv.y` is 1 at the top, where MilkDrop's texture
coordinate is 0; sampling agrees, but a shader doing arithmetic on
`uv.y` may come out mirrored, which needs its own check; MilkDrop's
internal comparison functions such as `_aboeq`, which three corpus
presets call and our compiler does not know; the reference comparison
with an external renderer, which needs one installed and waits for the
user's approval. Left out of the reader on purpose: MilkDrop reads
bytes and the engine gets decoded text, so its two byte rules — a
0xFF byte ends the file, a value over 251 characters splits into a
second index line — cannot be kept exactly, and neither touches a
corpus file; values stay double where MilkDrop stores float, a
difference below 1e-7; and a block that fails to compile is dropped
whole in MilkDrop but recovered statement by statement here, because
our parser and MilkDrop's do not agree on what an error is (`_aboeq`
is one case), so dropping whole blocks would drop some MilkDrop runs.
- **Tests.** 14 new: the version rule and the stage choice, the two
generated shaders (float rounding, samplers, echo, hue, flag order,
and that they translate), echo orientation and gamma cases, the
Expand Down Expand Up @@ -2216,7 +2260,16 @@ rest after. No version number yet.
counting as 1 with it off; and the volume fade's switch and range from
the file with MilkDrop's defaults, a negative switch counting as on.
Five test files follow the new reads, one of them with a flat custom
wave at scale 0. 16 of 16 mutations are caught.
wave at scale 0. 16 of 16 mutations are caught. The file reading adds
ten: the reader's naming (case, indentation, the space separator), the
next-line and first-occurrence lookup, `%d` and `%f`, code ending at a
gap with comments cut and lines glued, the version lines in MilkDrop's
order, `readMilk` and the Preset's `readAcc`, `readingsDiffer`, every
Preset built in `src` naming its reading rule, the toggle rebuilding
only when the readings differ, and a mash-up's version lines from its
donor's reading. The own-presets test also requires both readings to
agree, and the mash-up part test compares with the new reader.
23 of 23 mutations are caught.

## v3.1.6 — Comprehensive video export

Expand Down
5 changes: 3 additions & 2 deletions src/admin/milkdrop-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,8 @@
// Doğrulama: yüklü presetin derleme durumu
if (md.source && window.SVMilkdrop) {
try {
const p = new window.SVMilkdrop.Preset(md.source);
// Görselleştiricinin okuyacağı kuralla (#580: uyum açıkken MilkDrop'unki)
const p = new window.SVMilkdrop.Preset(md.source, { accurate: md.accurate !== false });
/* Sayı ve metin AYRI düğümlerde. i18n sözlüğü metin düğümlerini
birebir eşleştiriyor, dolayısıyla '3 hata' gibi birleşik bir metin
hiçbir zaman eşleşmez ve İngilizce arayüzde Türkçe kalırdı —
Expand Down Expand Up @@ -1301,7 +1302,7 @@
const items = [];
let bad = 0;
for (const f of r.files) {
const parsed = M ? new M.Preset(f.text, { name: f.name }) : null;
const parsed = M ? new M.Preset(f.text, { name: f.name, accurate: md.accurate !== false }) : null;
if (parsed && parsed.errors.length) bad++;
items.push({
id: 'md_' + Math.random().toString(36).slice(2, 10),
Expand Down
Loading
Loading