Sigil.Sound.Repl.Core
0.1.0
dotnet add package Sigil.Sound.Repl.Core --version 0.1.0
NuGet\Install-Package Sigil.Sound.Repl.Core -Version 0.1.0
<PackageReference Include="Sigil.Sound.Repl.Core" Version="0.1.0" />
<PackageVersion Include="Sigil.Sound.Repl.Core" Version="0.1.0" />
<PackageReference Include="Sigil.Sound.Repl.Core" />
paket add Sigil.Sound.Repl.Core --version 0.1.0
#r "nuget: Sigil.Sound.Repl.Core, 0.1.0"
#:package Sigil.Sound.Repl.Core@0.1.0
#addin nuget:?package=Sigil.Sound.Repl.Core&version=0.1.0
#tool nuget:?package=Sigil.Sound.Repl.Core&version=0.1.0
Sigil.Sound
A fluent API for sound synthesis in your .NET app. Build an instrument or an effect in a few lines, then record it to a file or play it live.
Status: 0.1.0, the first public release. The public API is tracked and every example is tested, but it may still change before 1.0; see the changelog. Licensed under the MIT License.
Quick Start
using static Sigil.Sound.Sounds;
// Audio-rate parameter modulation
var sweep = Sine(0.25).Range(200, 2000);
var pad = Saw(110)
.LowPass(cutoff: sweep, q: 2.0)
.Adsr(0.01, 0.2, 0.6, 1.5)
.Chorus()
.Reverb(size: 0.8, mix: 0.3);
var melody = Notes.Parse("C4 E4 G4 B4").Transpose(12)
.Every(Beats.Eighth, gate: 2)
.Loop();
var lead = melody.Play(v => Square(v.Frequency).Adsr(0.005, 0.1, 0.7, 0.2), polyphony: 8);
var mix = (pad * 0.5 + lead * 0.3).Limit();
mix.RenderToWav("demo.wav", seconds: 8, sampleRate: 48_000);
- Sources:
Sine,SawandSquare(PolyBLEP band-limited, variable pulse width),Triangle(band-limited, with a variable skew),Noise(seeded),Constant,Fn(t => ...), andSample(plays anAudioBufferat any speed, or at a pitch, with one-shot, loop and ping-pong modes). Low-frequency modulation is ordinary math: a slowSineorTrianglethroughRange, or anFnfor stepped values. - Samples:
AudioBuffer.FromWav(path),FromWav(stream)andFromWav(bytes)decode 8, 16, 24 and 32-bit PCM and 32-bit float WAV, mono or stereo, andWavReader.ReadInfo(bytes)reads a file's format and length without decoding it. Snippets do not give file paths: they name a sample,Samples.Load("kick.wav"), and the host decides where samples live (SampleLibraryover anISampleSource;FolderSampleSourceinSigil.Sound.Replfor a folder). In the browser REPL, drop.wavfiles on the page; the editor offers the names as you type the quotes. The path overload is blocked in snippets. - Operators:
Gain/*, mix /+, offset /+ 12, ring modulation (sound * sound),Range,Adsr,LowPass,HighPass,BandPass,Notch(topology-preserving state-variable filter),Pan,Limit. - Tone:
Peak(bell),LowShelf,HighShelf(RBJ biquads),Equalize(three-band tone control),Vowel(four formants, morphs A to U),Fold(West Coast wavefolder). - Dynamics:
Compress(soft knee, sidechain, lookahead),FollowEnvelope(loudness as a control signal),Spread(mid/side stereo width). - Impulse responses:
Convolveruns a sound through anAudioBuffer, such as a guitar cabinet or a concert hall recorded as a WAV file. Zero latency, mono or stereo, up to 10 seconds, any sample rate. - Effects:
Delay,TapeDelay(slewed read head, saturating and damped feedback),Reverb(Schroeder stereo decorrelated),FdnReverb(eight-line feedback network, optional shimmer),Comb(tuned resonator; Karplus-Strong string),Distort(soft, hard, fold, fuzz),BitCrush,Chorus,Phaser. Each takesmixwhere applicable, and continuous parameters accept numbers, sounds, orFn(t => ...). - Parameters: Every
Paramaccepts a number, anotherSound(audio-rate modulation), or aFunc<double, float>of time. Constant parameters are evaluated with zero per-block overhead. - Sequences & Notes:
Notes.Parse("C4 Eb4 G4"), LINQ transformations (Where,Select,Transpose), timing (Every,Beats), and zero-allocation polyphonic playback (Play). - Rendering:
Render(seconds)returns an in-memoryAudioBuffer;RenderToWavwrites 16-bit, 24-bit, or 32-bit float WAV to a path or aStream. - Live Playback and Hot Swap:
SoundContextis a running output:Play(sound)crossfades from the current audio, and audio callbacks pull frames withRender(span).new Slot(sound)inserts a swappable location into any graph;slot.Swap(next)compiles off-thread and crossfades atomically.
Architecture
Sound: An immutable, stateless description. Composing never renders or mutates anything, so a sound can be reused, nested, and rendered repeatedly. If aSoundnode appears multiple times in a graph,Compileshares the rendered block automatically.IOperator: The stateful running instance produced bysound.Compile(RenderContext). Its singleRenderBlock(Span<StereoFrame>)method is hard real-time safe (zero managed allocations, zero locks, non-blocking).IResettable: Built-in operators can reset to their initial state, enabling polyphonic voice pooling with zero allocations during note triggering.
sound.Through(input => new MyOperator(input)) and Sound.FromOperator(ctx => ...) connect custom operators to the fluent API.
Packages
| Package | Contents | Status |
|---|---|---|
Sigil.Sound |
Sound, Param, RenderContext, IOperator, oscillators, envelopes, TP-SVF filters, effects, samples, offline render, WAV reading and writing. Zero dependencies, browser-wasm clean. |
0.1.0 |
Sigil.Sound.Notes |
Notes, pitch parsing, note sequences, timing patterns, polyphonic voice engine. | 0.1.0 |
Sigil.Sound.Testing |
SignalAnalysis and AudioAssert for tolerance-based audio assertions |
0.1.0 |
Sigil.Sound.Repl.Core |
The snippet compiler behind the browser REPL: Roslyn compiles Sigil.Sound C# behind a security validator, with completion, signatures and diagnostics. For apps that let users run Sigil.Sound scripts. The validator is a strong filter, not a sandbox: a host that runs scripts it does not trust should also isolate them (see SECURITY.md). .NET 10 only; the API may change before 1.0. | 0.1.0 |
Sigil.Sound.SoundFont |
SoundFont playback | Planned |
Sigil.Sound.Playback |
Real-time audio driver integrations | Planned |
Browser REPL
apps/Sigil.Sound.Repl runs a full C# audio synthesizer workspace in the browser: Blazor WebAssembly hosts .NET, Roslyn compiles C# on the fly, and the engine streams into Web Audio via an AudioWorklet.
dotnet run --project apps/Sigil.Sound.Repl
For production builds: dotnet publish apps/Sigil.Sound.Repl -c Release -o artifacts/repl.
Start with Church organ in the examples menu: sixty-four sine partials in eight ranks, kept in tune by rotating phasors instead of 64 calls to Sin per sample, written as a single custom operator. It shows what the library lets you build; Custom operators explains how it works.
Versioning
Versions are MAJOR.MINOR.PATCH. What to expect:
| Part | Means | Example |
|---|---|---|
| MAJOR | 0 is beta: the API may change between minor versions. 1+ promises the API and the sound will not break within that major version. |
0.x is beta |
| MINOR | New operators and features. Before 1.0 it may also break the API or retune a default, always listed in the changelog. | 0.2.0 |
| PATCH | Fixes only. No API change and no intentional change to the sound. Always safe to take. | 0.1.1 |
0.1.0 is the first public release: complete enough to build real instruments and effects, and the start of the feedback phase. Until 1.0, pin to a minor version (Version="[0.1.0,0.2.0)") to take fixes and move on purpose. All packages share one version. The full policy, including what counts as "the sound", is in Versioning.
Build & Test
Supports .NET 8.0 (LTS) and .NET 10.0.
dotnet build
dotnet test
Contributing
Contributions are welcome: see CONTRIBUTING.md, which says what to open an issue for before writing code. Questions and bugs: open an issue. Security problems: report privately, see SECURITY.md. Please keep to the Code of Conduct.
Heritage
Sigil.Sound is a clean, modern rewrite of the engine powering Sigilgraph Audio Workbench (AudioWorkbench.Core), eliminating legacy singletons, per-sample abstractions, and desktop coupling in favor of a fluent, functional, allocation-free architecture.
License & Trademarks
This project is licensed under the MIT License. Bundled audio, loaded assets and dependencies, with their sources and terms, are listed in THIRD-PARTY-NOTICES.md.
Trademarks
The "Sigil", "Sigil.Sound", and "AudioWorkbench" names, logos, and iconography are trademarks. You may fork and build on the code under the MIT license, but you may not use our brand assets or represent third-party forks as official Sigil products.
Canonical Distribution Channels
- Official NuGet Packages: Available exclusively under the verified
Sigil.Soundnamespace on nuget.org. - Official Live REPL: Hosted at sigilaud.io and official project domains.
- Official Source Repository: github.com/sigilllc/SigilSound.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.CodeAnalysis.CSharp (>= 5.0.0)
- Sigil.Sound (>= 0.1.0)
- Sigil.Sound.Notes (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 0 | 11/10/2026 |