Rename project to AquaSynth
This commit is contained in:
parent
5c972443bc
commit
64d0a6bf4f
47 changed files with 516 additions and 515 deletions
|
|
@ -1,16 +1,16 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<PackageId>AquariumSynth.Dsl</PackageId>
|
||||
<Version>0.1.0-aquarium.1</Version>
|
||||
<PackageId>AquaSynth.Dsl</PackageId>
|
||||
<Version>0.1.0-aquasynth.1</Version>
|
||||
<Authors>GameCult</Authors>
|
||||
<Company>GameCult</Company>
|
||||
<Description>Aquarium synth patch DSL model, parser, analysis helpers, and Faust source emitter.</Description>
|
||||
<Description>AquaSynth patch DSL model, parser, analysis helpers, and Faust source emitter.</Description>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<RepositoryUrl>https://github.com/GameCult/AquariumSynthCSharp</RepositoryUrl>
|
||||
<RepositoryUrl>https://github.com/GameCult/AquaSynth</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Numerics;
|
||||
|
||||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public sealed record AudioAnalysisConfig(
|
||||
float SampleRate = 44100,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public static class BuiltInScripts
|
||||
{
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Security.Cryptography;
|
||||
|
||||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public enum Dx7FrequencyMode
|
||||
{
|
||||
|
|
@ -316,7 +316,7 @@ public static class Dx7SysEx
|
|||
return new Dx7RateLevelEnvelopeApproximation(
|
||||
new RateLevelEnvelope(r1, l1, r2, l2, r3, l3, r4, l4),
|
||||
Math.Max(r1 + r2 + r3, 0.02f),
|
||||
"Approximation: DX7 EG uses four rate/level segments; Aquarium staged envelopes preserve the intermediate target levels.");
|
||||
"Approximation: DX7 EG uses four rate/level segments; AquaSynth staged envelopes preserve the intermediate target levels.");
|
||||
}
|
||||
|
||||
public static Dx7RateLevelEnvelopeApproximation ApproximateAppliedRateLevelEnvelope(
|
||||
|
|
@ -359,7 +359,7 @@ public static class Dx7SysEx
|
|||
RateLevelCurve.Exponential,
|
||||
RateLevelCurve.Exponential),
|
||||
gateSeconds,
|
||||
"Approximation: DX7 applied EG gain sampled per 64-sample block and normalized for Aquarium operator-level scaling.");
|
||||
"Approximation: DX7 applied EG gain sampled per 64-sample block and normalized for AquaSynth operator-level scaling.");
|
||||
}
|
||||
|
||||
public static IReadOnlyList<Dx7EnvelopeTracePoint> TraceEnvelope(
|
||||
|
|
@ -2,9 +2,9 @@ using System.Diagnostics;
|
|||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public sealed record FaustExportOptions(string Name = "aquarium_patch", bool Stereo = false);
|
||||
public sealed record FaustExportOptions(string Name = "aquasynth_patch", bool Stereo = false);
|
||||
|
||||
public sealed record FaustExport(string Source, IReadOnlyList<string> Warnings);
|
||||
|
||||
|
|
@ -655,7 +655,7 @@ public static class FaustCompiler
|
|||
faustPath ??= FindFaust();
|
||||
if (faustPath is null) return null;
|
||||
|
||||
var sourcePath = Path.Combine(Path.GetTempPath(), $"aquarium-synth-{Guid.NewGuid():N}.dsp");
|
||||
var sourcePath = Path.Combine(Path.GetTempPath(), $"aquasynth-{Guid.NewGuid():N}.dsp");
|
||||
await File.WriteAllTextAsync(sourcePath, source, cancellationToken);
|
||||
try
|
||||
{
|
||||
|
|
@ -691,7 +691,7 @@ public static class FaustCompiler
|
|||
if (faustPath is null) return null;
|
||||
|
||||
var frames = Math.Max(1, (int)MathF.Round(options.SampleRate * Math.Max(options.DurationSeconds, 1f / options.SampleRate)));
|
||||
var tempDir = Path.Combine(Path.GetTempPath(), $"aquarium-synth-render-{Guid.NewGuid():N}");
|
||||
var tempDir = Path.Combine(Path.GetTempPath(), $"aquasynth-render-{Guid.NewGuid():N}");
|
||||
Directory.CreateDirectory(tempDir);
|
||||
try
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public enum Waveform
|
||||
{
|
||||
|
|
@ -309,7 +309,7 @@ public sealed record ReferencePatch(
|
|||
ReferenceSource Source,
|
||||
IReadOnlyList<ReferenceFeature> Features,
|
||||
IReadOnlyList<PatchParameter> Parameters,
|
||||
string? AquariumScript = null);
|
||||
string? AquaSynthScript = null);
|
||||
|
||||
public sealed record Repeat(float IntervalSeconds);
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Numerics;
|
||||
|
||||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
internal static class PadSynthWaveform
|
||||
{
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Globalization;
|
||||
|
||||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public sealed class PatchScriptException(int line, string message) : Exception($"line {line}: {message}")
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
internal readonly record struct PatchScriptStatement(string Text, int Line);
|
||||
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public static class Presets
|
||||
{
|
||||
public static SynthPatch AquariumPluck()
|
||||
public static SynthPatch AquaSynthPluck()
|
||||
{
|
||||
var envelope = new Envelope(0.002f, 0, 0.7246377f, 0.43f);
|
||||
return new SynthPatch
|
||||
|
|
@ -18,7 +18,7 @@ public static class Presets
|
|||
};
|
||||
}
|
||||
|
||||
public static SynthPatch AquariumHeartbeat()
|
||||
public static SynthPatch AquaSynthHeartbeat()
|
||||
{
|
||||
var envelope = new Envelope(0.004f, 0, 0.617284f, 0.2f);
|
||||
return new SynthPatch
|
||||
|
|
@ -33,7 +33,7 @@ public static class Presets
|
|||
};
|
||||
}
|
||||
|
||||
public static SynthPatch AquariumVoice()
|
||||
public static SynthPatch AquaSynthVoice()
|
||||
{
|
||||
var voice = Simple(new Oscillator(Waveform.Triangle, 220), new Envelope(0.018f, 0, 0.9259259f, 0.28f), 0.34f, 0.1944f) with
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public sealed record ReferenceRebuild(
|
||||
string Id,
|
||||
|
|
@ -15,7 +15,7 @@ public static class ReferenceRebuildCatalog
|
|||
public static readonly IReadOnlyList<ReferenceRebuild> ZynRebuilds =
|
||||
[
|
||||
new(
|
||||
"zyn/project-additive-lead/aquarium",
|
||||
"zyn/project-additive-lead/aquasynth",
|
||||
"zynaddsubfx",
|
||||
"Project additive lead",
|
||||
"zyn/project/additive-lead",
|
||||
|
|
@ -24,17 +24,17 @@ public static class ReferenceRebuildCatalog
|
|||
new("engine_add", "1", "Represented as additive sine partials under named layer authority."),
|
||||
new("named_layers", "body,shine", "Layer declarations group partial voices under reusable ADD engine intent."),
|
||||
new("additive_harmonic_bank", "2 banks / 4 partials", "Harmonic-bank syntax records authored ADD partial sets before lowering to ordinary voices."),
|
||||
new("partial_voice_count", "4", "The additive shape lowers to four Aquarium partial voices."),
|
||||
new("partial_voice_count", "4", "The additive shape lowers to four AquaSynth partial voices."),
|
||||
new("envelope_count", "2", "Amplitude and pitch contour pressure maps to ADSR plus vibrato in the current patch surface."),
|
||||
new("lfo_count", "1", "The fixture's amplitude/frequency motion is represented as patch-level vibrato/macro motion.")
|
||||
],
|
||||
[
|
||||
new("zyn_addsynth_oscillator_detail", "Zyn ADDsynth harmonic phase/bandwidth details", "Aquarium records harmonic ratios and gains, but not Zyn's full ADDsynth oscillator table semantics."),
|
||||
new("zyn_free_envelope_exactness", "Zyn envelope parameter semantics", "The rebuild uses Aquarium ADSR/motion controls rather than Zyn's exact envelope timing model.")
|
||||
new("zyn_addsynth_oscillator_detail", "Zyn ADDsynth harmonic phase/bandwidth details", "AquaSynth records harmonic ratios and gains, but not Zyn's full ADDsynth oscillator table semantics."),
|
||||
new("zyn_free_envelope_exactness", "Zyn envelope parameter semantics", "The rebuild uses AquaSynth ADSR/motion controls rather than Zyn's exact envelope timing model.")
|
||||
],
|
||||
"This is the easy Zyn pressure case: Aquarium can now say the sound as named harmonic banks while keeping the emitted voice graph plain enough to inspect."),
|
||||
"This is the easy Zyn pressure case: AquaSynth can now say the sound as named harmonic banks while keeping the emitted voice graph plain enough to inspect."),
|
||||
new(
|
||||
"zyn/project-pad-texture/aquarium",
|
||||
"zyn/project-pad-texture/aquasynth",
|
||||
"zynaddsubfx",
|
||||
"Project PAD texture",
|
||||
"zyn/project/pad-texture",
|
||||
|
|
@ -49,12 +49,12 @@ public static class ReferenceRebuildCatalog
|
|||
new("slow_modulation", "patch_lfo", "The rebuild adds slow patch modulation because PAD texture wants motion even though the minimal fixture only marks PAD/filter/free-envelope pressure.")
|
||||
],
|
||||
[
|
||||
new("padsynth_wavetable_exactness", "Full Zyn PAD engine behavior", "Aquarium now uses frequency-domain spreading, deterministic random phase, and one inverse FFT, but does not cover every Zyn harmonic profile, randomness control, or pitch-zone table behavior."),
|
||||
new("free_envelope_shape", "arbitrary Zyn envelope points", "Aquarium has staged voice envelopes now, but not arbitrary point/free-mode Zyn envelope curves.")
|
||||
new("padsynth_wavetable_exactness", "Full Zyn PAD engine behavior", "AquaSynth now uses frequency-domain spreading, deterministic random phase, and one inverse FFT, but does not cover every Zyn harmonic profile, randomness control, or pitch-zone table behavior."),
|
||||
new("free_envelope_shape", "arbitrary Zyn envelope points", "AquaSynth has staged voice envelopes now, but not arbitrary point/free-mode Zyn envelope curves.")
|
||||
],
|
||||
"This is pressure, not a claim of full Zyn PAD parity. Aquarium can now state a layered FFT spectral cloud, while exact Zyn PAD profile coverage remains separate pressure."),
|
||||
"This is pressure, not a claim of full Zyn PAD parity. AquaSynth can now state a layered FFT spectral cloud, while exact Zyn PAD profile coverage remains separate pressure."),
|
||||
new(
|
||||
"zyn/project-vocal-layer/aquarium",
|
||||
"zyn/project-vocal-layer/aquasynth",
|
||||
"zynaddsubfx",
|
||||
"Project vocal layer",
|
||||
"zyn/project/vocal-layer",
|
||||
|
|
@ -62,15 +62,15 @@ public static class ReferenceRebuildCatalog
|
|||
[
|
||||
new("engine_add", "1", "The air/formant layer is represented as a formant-filtered oscillator voice."),
|
||||
new("engine_sub", "1", "The body layer is represented as a lower triangle voice."),
|
||||
new("layered_instrument", "yes", "Multiple Zyn kit items map to multiple Aquarium voices."),
|
||||
new("layered_instrument", "yes", "Multiple Zyn kit items map to multiple AquaSynth voices."),
|
||||
new("named_layers", "air,body,breath", "Layer declarations preserve source identity before voice expansion."),
|
||||
new("voice_rate_level_envelope", "3", "Each vocal layer uses a staged rate/level voice envelope for asymmetric onset and release shape."),
|
||||
new("formant_filter_count", "1", "Represented with Aquarium formant filters and a vowel macro."),
|
||||
new("formant_filter_count", "1", "Represented with AquaSynth formant filters and a vowel macro."),
|
||||
new("effect_count", "1", "Approximated with local drive/soft clipping rather than a Zyn effect slot.")
|
||||
],
|
||||
[
|
||||
new("kit_item_authority", "Zyn per-kit-item engine/effect routing", "Aquarium has layered voices but no named kit-item/layer contract with per-layer effect sends."),
|
||||
new("formant_motion", "Zyn formant/vowel morph details", "Aquarium can mix static formants, but richer vowel morphing remains pressure.")
|
||||
new("kit_item_authority", "Zyn per-kit-item engine/effect routing", "AquaSynth has layered voices but no named kit-item/layer contract with per-layer effect sends."),
|
||||
new("formant_motion", "Zyn formant/vowel morph details", "AquaSynth can mix static formants, but richer vowel morphing remains pressure.")
|
||||
],
|
||||
"This rebuild keeps the useful part: layered source plus formant intent. It also exposes that repeated Zyn-style kit targets will need explicit layer naming and routing rather than anonymous voice piles.")
|
||||
];
|
||||
|
|
@ -78,55 +78,55 @@ public static class ReferenceRebuildCatalog
|
|||
public static readonly IReadOnlyList<ReferenceRebuild> Dx7Rebuilds =
|
||||
[
|
||||
new(
|
||||
"dx7/algo32-additive-organ/aquarium",
|
||||
"dx7/algo32-additive-organ/aquasynth",
|
||||
"dx7",
|
||||
"Algorithm 32 additive organ",
|
||||
"dx7/algo32-additive-organ",
|
||||
BuiltInScripts.Dx7StyleAlgorithm32AdditiveOrgan,
|
||||
[
|
||||
new("carrier_operators", "1,2,3,4,5,6", "Six independent carriers map cleanly to six Aquarium voices."),
|
||||
new("carrier_operators", "1,2,3,4,5,6", "Six independent carriers map cleanly to six AquaSynth voices."),
|
||||
new("modulation_edge_count", "0", "No operator-to-operator modulation is needed for the additive shape."),
|
||||
new("self_feedback_operators", "6", "Approximated with fold/drive on the highest partial."),
|
||||
new("operator_envelope_approximation", "DX7 EG -> ADSR", "DX7 four-rate/four-level envelopes can now be lowered to labeled ADSR approximations.")
|
||||
],
|
||||
[
|
||||
new("operator_envelope_exactness", "per-operator four-stage DX7 EG", "Aquarium has an ADSR approximation helper, not exact DX7 rate/level envelope execution."),
|
||||
new("output_compensation", "algorithm ROM COM", "Aquarium voice gains are explicit and not derived from DX7 COM scaling.")
|
||||
new("operator_envelope_exactness", "per-operator four-stage DX7 EG", "AquaSynth has an ADSR approximation helper, not exact DX7 rate/level envelope execution."),
|
||||
new("output_compensation", "algorithm ROM COM", "AquaSynth voice gains are explicit and not derived from DX7 COM scaling.")
|
||||
],
|
||||
"This is the honest easy case: DX7 algorithm 32 is mostly additive synthesis, so the current voice DSL can represent the carrier layout without pretending to own a full operator graph."),
|
||||
new(
|
||||
"dx7/algo8-bright-pair/aquarium",
|
||||
"dx7/algo8-bright-pair/aquasynth",
|
||||
"dx7",
|
||||
"Algorithm 8 bright pair",
|
||||
"dx7/algo8-bright-pair",
|
||||
BuiltInScripts.Dx7StyleAlgorithm8BrightPair,
|
||||
[
|
||||
new("carrier_operators", "1,3", "Represented as carriers in a first-class Aquarium operator graph."),
|
||||
new("carrier_operators", "1,3", "Represented as carriers in a first-class AquaSynth operator graph."),
|
||||
new("modulation_edges", "6->5,4+5->3,2->1", "Represented as explicit operator edges in the graph."),
|
||||
new("feedback_sources", "4", "Represented as operator-local feedback approximation on operator 4."),
|
||||
new("runtime_macros", "brightness,strike", "Field-site parameters expose useful sound controls without recompilation."),
|
||||
new("operator_envelope_approximation", "DX7 EG -> ADSR", "DX7 four-rate/four-level envelopes can now be lowered to labeled ADSR approximations.")
|
||||
],
|
||||
[
|
||||
new("dx7_feedback_register", "DX7 feedback scaling/register details", "Aquarium operator feedback is now renderable as a one-sample delayed self-reference, but not calibrated to exact DX7 feedback scaling."),
|
||||
new("operator_envelope_exactness", "independent DX7 rate/level envelopes", "Aquarium has per-operator ADSR approximation, not exact DX7 EG execution.")
|
||||
new("dx7_feedback_register", "DX7 feedback scaling/register details", "AquaSynth operator feedback is now renderable as a one-sample delayed self-reference, but not calibrated to exact DX7 feedback scaling."),
|
||||
new("operator_envelope_exactness", "independent DX7 rate/level envelopes", "AquaSynth has per-operator ADSR approximation, not exact DX7 EG execution.")
|
||||
],
|
||||
"This patch is deliberately a pressure test. The new operator graph owns the topology; exact DX7 envelope and feedback-register behavior remain pressure for later refinement."),
|
||||
new(
|
||||
"dx7/public-domain-mc-mm-5-3/aquarium",
|
||||
"dx7/public-domain-mc-mm-5-3/aquasynth",
|
||||
"dx7",
|
||||
"Public-domain MC-MM 5-3",
|
||||
"dx7/public-domain/analog1/13",
|
||||
BuiltInScripts.Dx7StylePublicDomainMcMm53,
|
||||
[
|
||||
new("reference_fixture", "analog1.syx#13", "Public-domain DX7 SysEx fixture from Musical Artifacts artifact 152."),
|
||||
new("audio_parity", "score>=0.75 log_mel<0.12 envelope<0.10", "First rendered DX7 parity target using dexed-py reference audio and Faust-rendered Aquarium audio."),
|
||||
new("audio_parity", "score>=0.75 log_mel<0.12 envelope<0.10", "First rendered DX7 parity target using dexed-py reference audio and Faust-rendered AquaSynth audio."),
|
||||
new("dominant_pitch", "654.0639Hz", "The rendered reference behaves as a short C3-derived 5x-ratio sine-like tone."),
|
||||
new("operator_envelope_approximation", "DX7 EG -> ADSR", "ADSR timing is fitted to the rendered reference envelope.")
|
||||
],
|
||||
[
|
||||
new("operator_topology_exactness", "2->1 FM pair", "The first parity candidate matches the rendered behavior as a sine-like tone; it does not claim exact DX7 operator-level execution."),
|
||||
new("operator_envelope_exactness", "DX7 rate/level EG", "The candidate uses Aquarium ADSR timing matched to rendered audio.")
|
||||
new("operator_envelope_exactness", "DX7 rate/level EG", "The candidate uses AquaSynth ADSR timing matched to rendered audio.")
|
||||
],
|
||||
"This is the first thresholded audio parity rung. It proves the render/compare loop on a lawful fixture without pretending the DX7 internals are solved.")
|
||||
];
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public sealed record PatchScriptMetrics(
|
||||
int ByteCount,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public sealed record SfxrParams
|
||||
{
|
||||
|
|
@ -5,7 +5,7 @@ using System.Security.Cryptography;
|
|||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace AquariumSynth.Dsl;
|
||||
namespace AquaSynth.Dsl;
|
||||
|
||||
public sealed record ZynInstrument(
|
||||
string Name,
|
||||
|
|
@ -117,25 +117,25 @@ public static class ZynInstrumentReader
|
|||
public static ReferenceSource SourceForBytes(string uri, string license, ReadOnlySpan<byte> bytes, string notes = "") =>
|
||||
new("zyn-xiz", uri, license, Convert.ToHexString(SHA256.HashData(bytes)).ToLowerInvariant(), notes);
|
||||
|
||||
public static ZynPadRebuild RebuildFirstPadAsAquariumScript(
|
||||
public static ZynPadRebuild RebuildFirstPadAsAquaSynthScript(
|
||||
string path,
|
||||
float tableRootFrequencyHz,
|
||||
float playbackFrequencyHz = 261.6256f) =>
|
||||
RebuildFirstPadAsAquariumScript(File.ReadAllBytes(path), tableRootFrequencyHz, playbackFrequencyHz);
|
||||
RebuildFirstPadAsAquaSynthScript(File.ReadAllBytes(path), tableRootFrequencyHz, playbackFrequencyHz);
|
||||
|
||||
public static ZynPadRebuild RebuildEnabledPadsAsAquariumScript(
|
||||
public static ZynPadRebuild RebuildEnabledPadsAsAquaSynthScript(
|
||||
string path,
|
||||
IReadOnlyDictionary<int, float> tableRootFrequencyHzByKitItem,
|
||||
float playbackFrequencyHz = 261.6256f) =>
|
||||
RebuildEnabledPadsAsAquariumScript(File.ReadAllBytes(path), tableRootFrequencyHzByKitItem, playbackFrequencyHz);
|
||||
RebuildEnabledPadsAsAquaSynthScript(File.ReadAllBytes(path), tableRootFrequencyHzByKitItem, playbackFrequencyHz);
|
||||
|
||||
public static ZynPadRebuild RebuildEnabledPadsAsAquariumScript(
|
||||
public static ZynPadRebuild RebuildEnabledPadsAsAquaSynthScript(
|
||||
string path,
|
||||
IReadOnlyDictionary<int, ZynPadTableRoot> tableRootFrequencyHzByKitItem,
|
||||
float playbackFrequencyHz = 261.6256f) =>
|
||||
RebuildEnabledPadsAsAquariumScript(File.ReadAllBytes(path), tableRootFrequencyHzByKitItem, playbackFrequencyHz);
|
||||
RebuildEnabledPadsAsAquaSynthScript(File.ReadAllBytes(path), tableRootFrequencyHzByKitItem, playbackFrequencyHz);
|
||||
|
||||
public static ZynPadRebuild RebuildFirstPadAsAquariumScript(
|
||||
public static ZynPadRebuild RebuildFirstPadAsAquaSynthScript(
|
||||
ReadOnlySpan<byte> bytes,
|
||||
float tableRootFrequencyHz,
|
||||
float playbackFrequencyHz = 261.6256f)
|
||||
|
|
@ -150,19 +150,19 @@ public static class ZynInstrumentReader
|
|||
.Descendants("INSTRUMENT_KIT_ITEM")
|
||||
.FirstOrDefault(IsEnabledPadItem)
|
||||
?? throw new ArgumentException("Zyn instrument XML has no enabled PAD kit item");
|
||||
return RebuildPadItemsAsAquariumScript(
|
||||
return RebuildPadItemsAsAquaSynthScript(
|
||||
document,
|
||||
[item],
|
||||
new Dictionary<int, ZynPadTableRoot> { [IntAttribute(item, "id")] = new(tableRootFrequencyHz) },
|
||||
playbackFrequencyHz);
|
||||
}
|
||||
|
||||
public static ZynPadRebuild RebuildEnabledPadsAsAquariumScript(
|
||||
public static ZynPadRebuild RebuildEnabledPadsAsAquaSynthScript(
|
||||
ReadOnlySpan<byte> bytes,
|
||||
IReadOnlyDictionary<int, float> tableRootFrequencyHzByKitItem,
|
||||
float playbackFrequencyHz = 261.6256f)
|
||||
{
|
||||
return RebuildEnabledPadsAsAquariumScript(
|
||||
return RebuildEnabledPadsAsAquaSynthScript(
|
||||
bytes,
|
||||
tableRootFrequencyHzByKitItem.ToDictionary(
|
||||
pair => pair.Key,
|
||||
|
|
@ -170,7 +170,7 @@ public static class ZynInstrumentReader
|
|||
playbackFrequencyHz);
|
||||
}
|
||||
|
||||
public static ZynPadRebuild RebuildEnabledPadsAsAquariumScript(
|
||||
public static ZynPadRebuild RebuildEnabledPadsAsAquaSynthScript(
|
||||
ReadOnlySpan<byte> bytes,
|
||||
IReadOnlyDictionary<int, ZynPadTableRoot> tableRootFrequencyHzByKitItem,
|
||||
float playbackFrequencyHz = 261.6256f)
|
||||
|
|
@ -190,10 +190,10 @@ public static class ZynInstrumentReader
|
|||
throw new ArgumentException("Zyn instrument XML has no enabled PAD kit item");
|
||||
}
|
||||
|
||||
return RebuildPadItemsAsAquariumScript(document, items, tableRootFrequencyHzByKitItem, playbackFrequencyHz);
|
||||
return RebuildPadItemsAsAquaSynthScript(document, items, tableRootFrequencyHzByKitItem, playbackFrequencyHz);
|
||||
}
|
||||
|
||||
private static ZynPadRebuild RebuildPadItemsAsAquariumScript(
|
||||
private static ZynPadRebuild RebuildPadItemsAsAquaSynthScript(
|
||||
XDocument document,
|
||||
IReadOnlyList<XElement> items,
|
||||
IReadOnlyDictionary<int, ZynPadTableRoot> tableRootFrequencyHzByKitItem,
|
||||
|
|
@ -234,7 +234,7 @@ public static class ZynInstrumentReader
|
|||
throw new ArgumentException($"Missing PAD table root for kit item {kitId}.", nameof(tableRootFrequencyHzByKitItem));
|
||||
}
|
||||
|
||||
var tableRootFrequencyHz = ZynPadRootForAquarium(item, tableRoot);
|
||||
var tableRootFrequencyHz = ZynPadRootForAquaSynth(item, tableRoot);
|
||||
if (tableRootFrequencyHz <= 0)
|
||||
{
|
||||
throw new ArgumentException($"Invalid PAD table root for kit item {kitId}.", nameof(tableRootFrequencyHzByKitItem));
|
||||
|
|
@ -255,7 +255,7 @@ public static class ZynInstrumentReader
|
|||
return new ZynPadRebuild(name, items.Count == 1 ? IntAttribute(items[0], "id") : -1, script.ToString(), matched, missing);
|
||||
}
|
||||
|
||||
private static float ZynPadRootForAquarium(XElement item, ZynPadTableRoot tableRoot)
|
||||
private static float ZynPadRootForAquaSynth(XElement item, ZynPadTableRoot tableRoot)
|
||||
{
|
||||
var oscillator = item
|
||||
.Element("PAD_SYNTH_PARAMETERS")
|
||||
|
|
@ -319,7 +319,7 @@ public static class ZynInstrumentReader
|
|||
var partialText = string.Join(",", harmonics.Select(partial => $"{F(partial.Ratio)}:{F(partial.Gain)}"));
|
||||
|
||||
var featurePrefix = includeKitSuffix ? $"pad_kit_{kitId}_" : "pad_";
|
||||
matched.Add(new($"{featurePrefix}oscillator_harmonics", harmonics.Count.ToString(CultureInfo.InvariantCulture), "Mapped OSCIL/HARMONICS magnitudes into Aquarium spectrum partials."));
|
||||
matched.Add(new($"{featurePrefix}oscillator_harmonics", harmonics.Count.ToString(CultureInfo.InvariantCulture), "Mapped OSCIL/HARMONICS magnitudes into AquaSynth spectrum partials."));
|
||||
matched.Add(new($"{featurePrefix}oscillator_base_function", IntParam(oscillator, "base_function", 0).ToString(CultureInfo.InvariantCulture), "Expanded Zyn OscilGen base function into harmonic partials before PAD synthesis."));
|
||||
if (IntParam(oscillator, "base_function_modulation", 0) != 0)
|
||||
{
|
||||
|
|
@ -331,30 +331,30 @@ public static class ZynInstrumentReader
|
|||
}
|
||||
matched.Add(new($"{featurePrefix}oscillator_spectrum_adjust", $"{IntParam(oscillator, "spectrum_adjust_type", 0)}:{IntParam(oscillator, "spectrum_adjust_par", 64)}", "Applied Zyn OscilGen spectrum adjustment to generated harmonic partials."));
|
||||
matched.Add(new($"{featurePrefix}table_root", F(tableRootFrequencyHz), "Root frequency comes from the Zyn oracle generated sample basefreq."));
|
||||
matched.Add(new($"{featurePrefix}note_frequency", F(noteFrequencyHz), "Mapped Zyn PAD coarse/fine detune into Aquarium table playback frequency."));
|
||||
matched.Add(new($"{featurePrefix}volume", volume.ToString(CultureInfo.InvariantCulture), "Mapped PAD amplitude volume into Aquarium layer gain."));
|
||||
matched.Add(new($"{featurePrefix}bandwidth", bandwidth.ToString(CultureInfo.InvariantCulture), "Mapped Zyn PAD bandwidth into Aquarium spectral table generation."));
|
||||
matched.Add(new($"{featurePrefix}note_frequency", F(noteFrequencyHz), "Mapped Zyn PAD coarse/fine detune into AquaSynth table playback frequency."));
|
||||
matched.Add(new($"{featurePrefix}volume", volume.ToString(CultureInfo.InvariantCulture), "Mapped PAD amplitude volume into AquaSynth layer gain."));
|
||||
matched.Add(new($"{featurePrefix}bandwidth", bandwidth.ToString(CultureInfo.InvariantCulture), "Mapped Zyn PAD bandwidth into AquaSynth spectral table generation."));
|
||||
matched.Add(new($"{featurePrefix}bandwidth_scale", bandwidthScale.ToString(CultureInfo.InvariantCulture), "Mapped Zyn PAD bandwidth scaling exponent selection."));
|
||||
matched.Add(new($"{featurePrefix}harmonic_profile", profile, "Mapped Zyn PAD harmonic profile shape into Aquarium spectral table generation."));
|
||||
matched.Add(new($"{featurePrefix}harmonic_position", position, "Mapped Zyn PAD harmonic position warp into Aquarium spectral table generation."));
|
||||
matched.Add(new($"{featurePrefix}harmonic_profile", profile, "Mapped Zyn PAD harmonic profile shape into AquaSynth spectral table generation."));
|
||||
matched.Add(new($"{featurePrefix}harmonic_position", position, "Mapped Zyn PAD harmonic position warp into AquaSynth spectral table generation."));
|
||||
if (lowPass < 1)
|
||||
{
|
||||
matched.Add(new($"{featurePrefix}filter_lpf", F(lowPass), "Mapped static Zyn PAD global low-pass frequency into Aquarium layer filtering."));
|
||||
matched.Add(new($"{featurePrefix}filter_lpf_q", F(lowPassQ), "Mapped Zyn analog low-pass Q into Aquarium filter damping."));
|
||||
matched.Add(new($"{featurePrefix}filter_lpf_order", lowPassOrder.ToString(CultureInfo.InvariantCulture), "Mapped Zyn analog LP1/LP2 and stage count into Aquarium low-pass order."));
|
||||
matched.Add(new($"{featurePrefix}filter_lpf", F(lowPass), "Mapped static Zyn PAD global low-pass frequency into AquaSynth layer filtering."));
|
||||
matched.Add(new($"{featurePrefix}filter_lpf_q", F(lowPassQ), "Mapped Zyn analog low-pass Q into AquaSynth filter damping."));
|
||||
matched.Add(new($"{featurePrefix}filter_lpf_order", lowPassOrder.ToString(CultureInfo.InvariantCulture), "Mapped Zyn analog LP1/LP2 and stage count into AquaSynth low-pass order."));
|
||||
}
|
||||
if (highPass > 0)
|
||||
{
|
||||
matched.Add(new($"{featurePrefix}filter_hpf", F(highPass), "Mapped static Zyn PAD global high-pass frequency into Aquarium layer filtering."));
|
||||
matched.Add(new($"{featurePrefix}filter_hpf_order", highPassOrder.ToString(CultureInfo.InvariantCulture), "Mapped Zyn analog HP1/HP2 and stage count into Aquarium high-pass order."));
|
||||
matched.Add(new($"{featurePrefix}filter_hpf", F(highPass), "Mapped static Zyn PAD global high-pass frequency into AquaSynth layer filtering."));
|
||||
matched.Add(new($"{featurePrefix}filter_hpf_order", highPassOrder.ToString(CultureInfo.InvariantCulture), "Mapped Zyn analog HP1/HP2 and stage count into AquaSynth high-pass order."));
|
||||
}
|
||||
if (lowPassEnvelope is not null)
|
||||
{
|
||||
matched.Add(new($"{featurePrefix}filter_lpf_envelope", "ratelevel", "Mapped Zyn PAD filter envelope octave offsets into Aquarium low-pass cutoff motion."));
|
||||
matched.Add(new($"{featurePrefix}filter_lpf_envelope", "ratelevel", "Mapped Zyn PAD filter envelope octave offsets into AquaSynth low-pass cutoff motion."));
|
||||
}
|
||||
if (highPassEnvelope is not null)
|
||||
{
|
||||
matched.Add(new($"{featurePrefix}filter_hpf_envelope", "ratelevel", "Mapped Zyn PAD filter envelope octave offsets into Aquarium high-pass cutoff motion."));
|
||||
matched.Add(new($"{featurePrefix}filter_hpf_envelope", "ratelevel", "Mapped Zyn PAD filter envelope octave offsets into AquaSynth high-pass cutoff motion."));
|
||||
}
|
||||
if (filter?.Element("FILTER_LFO") is { } lfo && IntParam(lfo, "intensity", 0) != 0)
|
||||
{
|
||||
Loading…
Reference in a new issue