Rename project to AquaSynth

This commit is contained in:
Meta Vens 2026-05-16 05:49:44 +01:00
commit 64d0a6bf4f
47 changed files with 516 additions and 515 deletions

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
@ -23,7 +23,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\AquariumSynth.Dsl\AquariumSynth.Dsl.csproj" />
<ProjectReference Include="..\..\src\AquaSynth.Dsl\AquaSynth.Dsl.csproj" />
</ItemGroup>
</Project>

View file

@ -2,7 +2,7 @@ using System.Diagnostics;
using System.Text.Json;
using System.Text;
namespace AquariumSynth.Dsl.Tests;
namespace AquaSynth.Dsl.Tests;
public sealed class Dx7ReferenceParityTests
{
@ -319,8 +319,8 @@ public sealed class Dx7ReferenceParityTests
var dx7 = Dx7SysEx.TraceEnvelope(envelope, gateSeconds: 0.75f, durationSeconds: 1.1f);
var dx7Applied = Dx7SysEx.TraceInterpolatedEnvelope(envelope, gateSeconds: 0.75f, durationSeconds: 1.1f);
var approximation = ScaledEnvelope(Dx7SysEx.ApproximateRateLevelEnvelope(envelope), 0.62f, 0.75f);
var aquarium = TraceRateLevelEnvelope(approximation.Envelope, approximation.GateSeconds, durationSeconds: 1.1f);
var aquariumCurved = TraceRateLevelEnvelope(
var aquasynth = TraceRateLevelEnvelope(approximation.Envelope, approximation.GateSeconds, durationSeconds: 1.1f);
var aquasynthCurved = TraceRateLevelEnvelope(
new RateLevelEnvelope(
64f / 44100,
2f,
@ -341,27 +341,27 @@ public sealed class Dx7ReferenceParityTests
var path = Path.Combine(artifactDir, "egstep.csv");
using var writer = new StreamWriter(path);
writer.WriteLine("time_seconds,dx7_raw_gain,dx7_applied_gain,aquarium_rl_gain,aquarium_curved_gain,dx7_stage");
for (var i = 0; i < Math.Min(dx7.Count, aquarium.Length); i += 64)
writer.WriteLine("time_seconds,dx7_raw_gain,dx7_applied_gain,aquasynth_rl_gain,aquasynth_curved_gain,dx7_stage");
for (var i = 0; i < Math.Min(dx7.Count, aquasynth.Length); i += 64)
{
writer.WriteLine(string.Join(
",",
F(dx7[i].TimeSeconds),
F(dx7[i].Gain),
F(dx7Applied[i].Gain),
F(aquarium[i]),
F(aquariumCurved[i]),
F(aquasynth[i]),
F(aquasynthCurved[i]),
dx7[i].Stage.ToString(System.Globalization.CultureInfo.InvariantCulture)));
}
var linearShape = NormalizedDistance(
dx7Applied.Select(point => point.Gain).ToArray(),
aquarium);
aquasynth);
var curvedShape = NormalizedDistance(
dx7Applied.Select(point => point.Gain).ToArray(),
aquariumCurved);
Assert.True(linearShape > 0.55f, $"expected current Aquarium envelope to visibly differ; shape distance {linearShape}, artifact: {path}");
Assert.True(curvedShape < linearShape * 0.6f, $"expected curved Aquarium envelope to improve shape; linear {linearShape}, curved {curvedShape}, artifact: {path}");
aquasynthCurved);
Assert.True(linearShape > 0.55f, $"expected current AquaSynth envelope to visibly differ; shape distance {linearShape}, artifact: {path}");
Assert.True(curvedShape < linearShape * 0.6f, $"expected curved AquaSynth envelope to improve shape; linear {linearShape}, curved {curvedShape}, artifact: {path}");
}
private static string FixturePath(params string[] parts) =>
@ -370,7 +370,7 @@ public sealed class Dx7ReferenceParityTests
private static string ArtifactPath(params string[] parts)
{
var current = new DirectoryInfo(AppContext.BaseDirectory);
while (current is not null && !File.Exists(Path.Combine(current.FullName, "AquariumSynthCSharp.slnx")))
while (current is not null && !File.Exists(Path.Combine(current.FullName, "AquaSynth.slnx")))
{
current = current.Parent;
}
@ -771,7 +771,7 @@ public sealed class Dx7ReferenceParityTests
var peak = Math.Max(Peak(reference), Peak(candidate));
var scale = peak <= 0 ? 1 : 0.98f / peak;
WriteWav(Path.Combine(directory, "reference-dexed.wav"), reference, sampleRate, scale);
WriteWav(Path.Combine(directory, "candidate-aquarium.wav"), candidate, sampleRate, scale);
WriteWav(Path.Combine(directory, "candidate-aquasynth.wav"), candidate, sampleRate, scale);
File.WriteAllText(Path.Combine(directory, "candidate.aqua"), script);
File.WriteAllText(
Path.Combine(directory, "report.txt"),
@ -780,7 +780,7 @@ public sealed class Dx7ReferenceParityTests
ParityReport(comparison),
$"wav normalization scale: {scale}",
$"reference: {Path.Combine(directory, "reference-dexed.wav")}",
$"candidate: {Path.Combine(directory, "candidate-aquarium.wav")}"));
$"candidate: {Path.Combine(directory, "candidate-aquasynth.wav")}"));
}
private static void WriteWav(string path, IReadOnlyList<float> samples, int sampleRate, float scale)
@ -893,7 +893,7 @@ internal static class DexedPyRenderer
var python = await FindPythonWithDexedAsync(cancellationToken);
if (python is null) return null;
var tempDir = Path.Combine(Path.GetTempPath(), $"aquarium-dx7-render-{Guid.NewGuid():N}");
var tempDir = Path.Combine(Path.GetTempPath(), $"aquasynth-dx7-render-{Guid.NewGuid():N}");
Directory.CreateDirectory(tempDir);
try
{
@ -945,7 +945,7 @@ internal static class DexedPyRenderer
var python = await FindPythonWithDexedAsync(cancellationToken);
if (python is null) return null;
var tempDir = Path.Combine(Path.GetTempPath(), $"aquarium-dx7-patch-render-{Guid.NewGuid():N}");
var tempDir = Path.Combine(Path.GetTempPath(), $"aquasynth-dx7-patch-render-{Guid.NewGuid():N}");
Directory.CreateDirectory(tempDir);
try
{
@ -988,7 +988,7 @@ internal static class DexedPyRenderer
private static async Task<PythonCommand?> FindPythonWithDexedAsync(CancellationToken cancellationToken)
{
var configuredPython = Environment.GetEnvironmentVariable("AQUARIUM_DX7_PYTHON");
var configuredPython = Environment.GetEnvironmentVariable("AQUASYNTH_DX7_PYTHON");
var candidates = new List<PythonCommand>();
if (!string.IsNullOrWhiteSpace(configuredPython))
{

View file

@ -1,6 +1,6 @@
using AquariumSynth.Dsl;
using AquaSynth.Dsl;
namespace AquariumSynth.Dsl.Tests;
namespace AquaSynth.Dsl.Tests;
public sealed class Dx7SysExTests
{
@ -221,7 +221,7 @@ public sealed class Dx7SysExTests
}
[Fact]
public void CalibratesDx7OutputLevelToAquariumRouteIndex()
public void CalibratesDx7OutputLevelToAquaSynthRouteIndex()
{
var fullScalePhaseDeviationRadians = 2 * Dx7SysEx.OperatorOutputAmplitude(99) * Dx7SysEx.OperatorModulationRouteIndex;
@ -251,7 +251,7 @@ public sealed class Dx7SysExTests
}
[Fact]
public void CalibratesDx7FeedbackToAquariumFeedbackAmount()
public void CalibratesDx7FeedbackToAquaSynthFeedbackAmount()
{
Assert.Equal(0, Dx7SysEx.OperatorFeedbackAmount(0));
Assert.Equal(0.19f, Dx7SysEx.OperatorFeedbackAmount(5));

View file

@ -10,4 +10,4 @@ Artifacts artifact 152, "DX7 patches 1".
- SHA-256: `5AC120DF3A538DFB9A4B17A218F71B1D136269D2C30A33E676C1D6DDE2AC3AD2`
This fixture is test/development material only. It must not be packed into
`AquariumSynth.Dsl.nupkg`.
`AquaSynth.Dsl.nupkg`.

View file

@ -1,6 +1,6 @@
# Project-Authored ZynAddSubFX Fixtures
These `.xiz` files are tiny Aquarium-authored XML fixtures shaped like
These `.xiz` files are tiny AquaSynth-authored XML fixtures shaped like
ZynAddSubFX instrument files. They are not copied from an upstream Zyn bank.
Purpose:
@ -19,4 +19,4 @@ Current fixtures:
- `pad-harmonic.xiz`
- `vocal-layer.xiz`
License: project-authored for AquariumSynthCSharp tests.
License: project-authored for AquaSynth tests.

View file

@ -4,7 +4,7 @@
<INSTRUMENT>
<INFO>
<string name="name">AQ Additive Lead</string>
<string name="author">AquariumSynthCSharp tests</string>
<string name="author">AquaSynth tests</string>
<string name="comments">Project-authored additive fixture.</string>
<par name="type" value="0"/>
</INFO>

View file

@ -4,7 +4,7 @@
<INSTRUMENT>
<INFO>
<string name="name">AQ Pad Harmonic</string>
<string name="author">AquariumSynthCSharp tests</string>
<string name="author">AquaSynth tests</string>
<string name="comments">Project-authored PAD fixture with explicit oscillator harmonics.</string>
<par name="type" value="0"/>
</INFO>

View file

@ -4,7 +4,7 @@
<INSTRUMENT>
<INFO>
<string name="name">AQ Pad Pure</string>
<string name="author">AquariumSynthCSharp tests</string>
<string name="author">AquaSynth tests</string>
<string name="comments">Project-authored default PAD fixture for pure source-table parity.</string>
<par name="type" value="0"/>
</INFO>

View file

@ -4,7 +4,7 @@
<INSTRUMENT>
<INFO>
<string name="name">AQ Pad Texture</string>
<string name="author">AquariumSynthCSharp tests</string>
<string name="author">AquaSynth tests</string>
<string name="comments">Project-authored PAD fixture.</string>
<par name="type" value="0"/>
</INFO>

View file

@ -4,7 +4,7 @@
<INSTRUMENT>
<INFO>
<string name="name">AQ Vocal Layer</string>
<string name="author">AquariumSynthCSharp tests</string>
<string name="author">AquaSynth tests</string>
<string name="comments">Project-authored layered vocal/formant fixture.</string>
<par name="type" value="0"/>
</INFO>

View file

@ -1,7 +1,7 @@
using System.Diagnostics;
using System.IO.Compression;
namespace AquariumSynth.Dsl.Tests;
namespace AquaSynth.Dsl.Tests;
public sealed class PackageBoundaryTests
{
@ -9,20 +9,20 @@ public sealed class PackageBoundaryTests
public async Task NuGetPackageContainsOnlyPublishedSynthSurface()
{
var root = RepositoryRoot();
var outputDir = Path.Combine(Path.GetTempPath(), $"aquarium-pack-{Guid.NewGuid():N}");
var outputDir = Path.Combine(Path.GetTempPath(), $"aquasynth-pack-{Guid.NewGuid():N}");
Directory.CreateDirectory(outputDir);
try
{
var result = await RunAsync(
"dotnet",
["pack", Path.Combine(root, "src", "AquariumSynth.Dsl", "AquariumSynth.Dsl.csproj"), "-c", "Release", "--no-restore", "-o", outputDir]);
["pack", Path.Combine(root, "src", "AquaSynth.Dsl", "AquaSynth.Dsl.csproj"), "-c", "Release", "--no-restore", "-o", outputDir]);
Assert.Equal(0, result.ExitCode);
var package = Assert.Single(Directory.GetFiles(outputDir, "AquariumSynth.Dsl.*.nupkg"));
var package = Assert.Single(Directory.GetFiles(outputDir, "AquaSynth.Dsl.*.nupkg"));
using var archive = ZipFile.OpenRead(package);
var entries = archive.Entries.Select(entry => entry.FullName).ToArray();
Assert.Contains(entries, entry => entry.StartsWith("lib/net10.0/AquariumSynth.Dsl.dll", StringComparison.Ordinal));
Assert.Contains(entries, entry => entry.StartsWith("lib/net10.0/AquaSynth.Dsl.dll", StringComparison.Ordinal));
Assert.Contains("README.md", entries);
Assert.DoesNotContain(entries, entry => entry.StartsWith("tests/", StringComparison.OrdinalIgnoreCase));
Assert.DoesNotContain(entries, entry => entry.StartsWith("Fixtures/", StringComparison.OrdinalIgnoreCase));
@ -44,7 +44,7 @@ public sealed class PackageBoundaryTests
private static string RepositoryRoot()
{
var directory = new DirectoryInfo(AppContext.BaseDirectory);
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "AquariumSynthCSharp.slnx")))
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "AquaSynth.slnx")))
{
directory = directory.Parent;
}

View file

@ -1,6 +1,6 @@
using AquariumSynth.Dsl;
using AquaSynth.Dsl;
namespace AquariumSynth.Dsl.Tests;
namespace AquaSynth.Dsl.Tests;
public sealed class PatchScriptTests
{
@ -161,9 +161,9 @@ public sealed class PatchScriptTests
}
[Fact]
public void AquariumPresetsExportFaust()
public void AquaSynthPresetsExportFaust()
{
foreach (var patch in new[] { Presets.AquariumPluck(), Presets.AquariumHeartbeat(), Presets.AquariumVoice(), Presets.Sfxr("pickup") })
foreach (var patch in new[] { Presets.AquaSynthPluck(), Presets.AquaSynthHeartbeat(), Presets.AquaSynthVoice(), Presets.Sfxr("pickup") })
{
var export = FaustEmitter.Emit(patch);
Assert.Contains("process =", export.Source);
@ -832,7 +832,7 @@ public sealed class PatchScriptTests
public async Task FaustCompilerCanEmitCSharpWhenInstalled()
{
var export = FaustEmitter.EmitScript("v w=sin f=440 g=.2 s=.1 d=.2");
var output = Path.Combine(Path.GetTempPath(), $"aquarium-synth-{Guid.NewGuid():N}.cs");
var output = Path.Combine(Path.GetTempPath(), $"aquasynth-{Guid.NewGuid():N}.cs");
try
{
var validation = await FaustCompiler.CompileAsync(
@ -916,7 +916,7 @@ public sealed class PatchScriptTests
private static string RepositoryRoot()
{
var directory = new DirectoryInfo(AppContext.BaseDirectory);
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "AquariumSynthCSharp.slnx")))
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "AquaSynth.slnx")))
{
directory = directory.Parent;
}

View file

@ -1,6 +1,6 @@
using AquariumSynth.Dsl;
using AquaSynth.Dsl;
namespace AquariumSynth.Dsl.Tests;
namespace AquaSynth.Dsl.Tests;
public sealed class SfxrPatchReferenceTests
{

View file

@ -1,8 +1,8 @@
using System.IO.Compression;
using System.Text;
using AquariumSynth.Dsl;
using AquaSynth.Dsl;
namespace AquariumSynth.Dsl.Tests;
namespace AquaSynth.Dsl.Tests;
public sealed class ZynInstrumentTests
{
@ -18,7 +18,7 @@ public sealed class ZynInstrumentTests
ZynInstrumentReader.SourceForBytes("fixture://zyn/project/additive-lead.xiz", "project-authored", bytes));
Assert.Equal("AQ Additive Lead", instrument.Name);
Assert.Equal("AquariumSynthCSharp tests", instrument.Author);
Assert.Equal("AquaSynth tests", instrument.Author);
Assert.Contains(reference.Features, feature => feature.Name == "engine_add" && feature.Value == "1");
Assert.Contains(reference.Features, feature => feature.Name == "engine_sub" && feature.Value == "0");
Assert.Contains(reference.Features, feature => feature.Name == "engine_pad" && feature.Value == "0");
@ -148,11 +148,11 @@ public sealed class ZynInstrumentTests
}
[Fact]
public void RebuildsProjectAuthoredPadAsAquariumSpectrumScript()
public void RebuildsProjectAuthoredPadAsAquaSynthSpectrumScript()
{
var path = FixturePath("ZynAddSubFX", "ProjectAuthored", "pad-harmonic.xiz");
var rebuild = ZynInstrumentReader.RebuildFirstPadAsAquariumScript(path, tableRootFrequencyHz: 77.7813f);
var rebuild = ZynInstrumentReader.RebuildFirstPadAsAquaSynthScript(path, tableRootFrequencyHz: 77.7813f);
var patch = PatchScript.Parse(rebuild.Script);
Assert.Equal("AQ Pad Harmonic", rebuild.InstrumentName);
@ -181,7 +181,7 @@ public sealed class ZynInstrumentTests
return;
}
var rebuild = ZynInstrumentReader.RebuildFirstPadAsAquariumScript(path, tableRootFrequencyHz: 109.999f);
var rebuild = ZynInstrumentReader.RebuildFirstPadAsAquaSynthScript(path, tableRootFrequencyHz: 109.999f);
var patch = PatchScript.Parse(rebuild.Script);
var bank = Assert.Single(patch.SpectralBanks);
@ -200,7 +200,7 @@ public sealed class ZynInstrumentTests
return;
}
var rebuild = ZynInstrumentReader.RebuildEnabledPadsAsAquariumScript(
var rebuild = ZynInstrumentReader.RebuildEnabledPadsAsAquaSynthScript(
path,
new Dictionary<int, ZynPadTableRoot>
{
@ -275,7 +275,7 @@ public sealed class ZynInstrumentTests
private static string RepositoryRoot()
{
var directory = new DirectoryInfo(AppContext.BaseDirectory);
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "AquariumSynthCSharp.slnx")))
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "AquaSynth.slnx")))
{
directory = directory.Parent;
}

View file

@ -1,6 +1,6 @@
using System.Diagnostics;
namespace AquariumSynth.Dsl.Tests;
namespace AquaSynth.Dsl.Tests;
public sealed class ZynReferenceParityTests
{
@ -12,8 +12,8 @@ public sealed class ZynReferenceParityTests
Assert.True(Directory.Exists(zynRoot), "ZynAddSubFX reference source submodule is missing. Run `git submodule update --init --recursive`.");
Assert.True(File.Exists(Path.Combine(zynRoot, "COPYING")), "ZynAddSubFX reference source should keep its GPL license file.");
Assert.True(File.Exists(Path.Combine(zynRoot, "src", "Params", "PADnoteParameters.cpp")), "PAD parameter implementation is the parity source, not Aquarium runtime code.");
Assert.True(File.Exists(Path.Combine(zynRoot, "src", "Synth", "PADnote.cpp")), "PAD note implementation is the parity source, not Aquarium runtime code.");
Assert.True(File.Exists(Path.Combine(zynRoot, "src", "Params", "PADnoteParameters.cpp")), "PAD parameter implementation is the parity source, not AquaSynth runtime code.");
Assert.True(File.Exists(Path.Combine(zynRoot, "src", "Synth", "PADnote.cpp")), "PAD note implementation is the parity source, not AquaSynth runtime code.");
Assert.Contains("GNU GENERAL PUBLIC LICENSE", await File.ReadAllTextAsync(Path.Combine(zynRoot, "COPYING")));
var revision = await RunAsync("git", ["-C", zynRoot, "rev-parse", "HEAD"]);
@ -35,12 +35,12 @@ public sealed class ZynReferenceParityTests
var artifactDir = Path.Combine(root, "artifacts", "parity", "zyn-pad-reference", RunFolderName("pad-texture"));
Directory.CreateDirectory(artifactDir);
var input = Path.Combine(root, "tests", "AquariumSynth.Dsl.Tests", "Fixtures", "ZynAddSubFX", "ProjectAuthored", "pad-texture.xiz");
var input = Path.Combine(root, "tests", "AquaSynth.Dsl.Tests", "Fixtures", "ZynAddSubFX", "ProjectAuthored", "pad-texture.xiz");
var zynRaw = Path.Combine(artifactDir, "reference-zyn.f32");
var zynWav = Path.Combine(artifactDir, "reference-zyn.wav");
var zynTableRaw = Path.Combine(artifactDir, "reference-zyn-table0.f32");
var zynTableWav = Path.Combine(artifactDir, "reference-zyn-table0.wav");
var aquaWav = Path.Combine(artifactDir, "candidate-aquarium.wav");
var aquaWav = Path.Combine(artifactDir, "candidate-aquasynth.wav");
var reportPath = Path.Combine(artifactDir, "report.txt");
var command = string.Join(' ', [
@ -93,7 +93,7 @@ public sealed class ZynReferenceParityTests
$"zyn_table_rms: {Rms(zynTableSamples):0.######}"
};
var rebuild = ZynInstrumentReader.RebuildFirstPadAsAquariumScript(input, ParseBaseFrequency(tableReference.Stdout));
var rebuild = ZynInstrumentReader.RebuildFirstPadAsAquaSynthScript(input, ParseBaseFrequency(tableReference.Stdout));
report.AddRange(rebuild.MatchedFeatures.Select(feature => $"matched_{feature.Name}: {feature.Value}"));
report.AddRange(rebuild.MissingFeatures.Select(feature => $"missing_{feature.Name}: {feature.Value} - {feature.Notes}"));
var aquaExport = FaustEmitter.EmitScript(rebuild.Script, new FaustExportOptions("zyn_pad_texture"));
@ -129,7 +129,7 @@ public sealed class ZynReferenceParityTests
return;
}
var fixtureDir = Path.Combine(root, "tests", "AquariumSynth.Dsl.Tests", "Fixtures", "ZynAddSubFX", "ProjectAuthored");
var fixtureDir = Path.Combine(root, "tests", "AquaSynth.Dsl.Tests", "Fixtures", "ZynAddSubFX", "ProjectAuthored");
var artifactDir = Path.Combine(root, "artifacts", "parity", "zyn-pad-fixtures");
Directory.CreateDirectory(artifactDir);
@ -156,7 +156,7 @@ public sealed class ZynReferenceParityTests
Assert.Equal(0, note.ExitCode);
var table = await RunAsync(bash, ["-lc", ZynPadCommand(root, input, tableRaw, 0, "0")]);
Assert.Equal(0, table.ExitCode);
var rebuild = ZynInstrumentReader.RebuildFirstPadAsAquariumScript(input, ParseBaseFrequency(table.Stdout));
var rebuild = ZynInstrumentReader.RebuildFirstPadAsAquaSynthScript(input, ParseBaseFrequency(table.Stdout));
await File.WriteAllTextAsync(Path.Combine(runDir, "candidate.aqua"), rebuild.Script);
var noteSamples = await ReadFloat32Async(noteRaw);
@ -254,7 +254,7 @@ public sealed class ZynReferenceParityTests
var noteWav = Path.Combine(runDir, "reference-zyn.wav");
var tableRaw = Path.Combine(runDir, "reference-zyn-table0.f32");
var tableWav = Path.Combine(runDir, "reference-zyn-table0.wav");
var aquaWav = Path.Combine(runDir, "candidate-aquarium.wav");
var aquaWav = Path.Combine(runDir, "candidate-aquasynth.wav");
var noteStdouts = new List<string>();
var noteLayers = new List<float[]>();
@ -290,7 +290,7 @@ public sealed class ZynReferenceParityTests
}
var noteSamples = SumSamples(noteLayers);
var rebuild = ZynInstrumentReader.RebuildEnabledPadsAsAquariumScript(input, tableRoots);
var rebuild = ZynInstrumentReader.RebuildEnabledPadsAsAquaSynthScript(input, tableRoots);
await File.WriteAllTextAsync(Path.Combine(runDir, "candidate.aqua"), rebuild.Script);
Assert.True(noteSamples.Length > 0);
@ -361,7 +361,7 @@ public sealed class ZynReferenceParityTests
private static string RepositoryRoot()
{
var directory = new DirectoryInfo(AppContext.BaseDirectory);
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "AquariumSynthCSharp.slnx")))
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "AquaSynth.slnx")))
{
directory = directory.Parent;
}