PanoramicData.MusicGeneration.SoundFonts
0.1.33
dotnet add package PanoramicData.MusicGeneration.SoundFonts --version 0.1.33
NuGet\Install-Package PanoramicData.MusicGeneration.SoundFonts -Version 0.1.33
<PackageReference Include="PanoramicData.MusicGeneration.SoundFonts" Version="0.1.33" />
<PackageVersion Include="PanoramicData.MusicGeneration.SoundFonts" Version="0.1.33" />
<PackageReference Include="PanoramicData.MusicGeneration.SoundFonts" />
paket add PanoramicData.MusicGeneration.SoundFonts --version 0.1.33
#r "nuget: PanoramicData.MusicGeneration.SoundFonts, 0.1.33"
#:package PanoramicData.MusicGeneration.SoundFonts@0.1.33
#addin nuget:?package=PanoramicData.MusicGeneration.SoundFonts&version=0.1.33
#tool nuget:?package=PanoramicData.MusicGeneration.SoundFonts&version=0.1.33
PanoramicData.MusicGeneration.SoundFonts
Optional sampled-instrument rendering for scores generated by
PanoramicData.MusicGeneration, using MeltySynth 2.4.1 (MIT).
dotnet add package PanoramicData.MusicGeneration.SoundFonts
Supply an SF2 bank whose terms permit your intended use. No bank is bundled in this package and the adapter performs no network requests.
using PanoramicData.MusicGeneration;
using PanoramicData.MusicGeneration.SoundFonts;
var score = SongGenerator.Generate(42, 60, 11025);
var renderer = new SoundFontRenderer(File.ReadAllBytes("my-bank.sf2"), "my-bank");
var result = await renderer.RenderAsync(score);
File.WriteAllBytes("song.wav", result.Song.ToWav());
Inspect renderer.Presets and set SoundFontRenderOptions.Parts to choose bank,
zero-based program and MIDI velocity for each role. Defaults require GM strings,
acoustic bass, piano and a standard percussion kit. Missing presets fail explicitly.
The input bank limit is 64 MiB; output rates are 16,000–96,000 Hz, default 22,050.
The returned song retains the written notes and section boundaries, adds raw stems for mute/solo, and supplies one full-mix normalisation gain. Output is mono, with effects disabled and release tails clipped at the requested duration. The metadata records the bank SHA-256, renderer version, settings and instrument assignments.
Native .NET and browser WebAssembly use the same managed adapter. Repeatability is scoped to the bank, renderer, settings and runtime; cross-platform bit-identical PCM is not promised. The procedural core and its golden output remain unchanged.
See API/design, asset terms and resource budgets and the same-score demonstration.
Live keyboard notes
renderer.CreateKeyboardVoice(program, midi, velocity, sampleRate) starts a bank-0 note. Call Render(sampleCount) sequentially for small mono PCM blocks, then Release() when the key is lifted and keep rendering its release tail. Release is idempotent and uses the SF2 instrument's own note-off envelope; no per-block peak normalisation is applied. Each voice is independent, including repeated overlapping pitches. The caller owns scheduling, mixing and voice cleanup. The demo keyboard uses this path for held notes and piano damping; score rendering remains unchanged.
| 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
- MeltySynth (>= 2.4.1)
- PanoramicData.MusicGeneration (>= 0.1.33)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.