SpessaSharp 4.3.6

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package SpessaSharp --version 4.3.6
                    
NuGet\Install-Package SpessaSharp -Version 4.3.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SpessaSharp" Version="4.3.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SpessaSharp" Version="4.3.6" />
                    
Directory.Packages.props
<PackageReference Include="SpessaSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SpessaSharp --version 4.3.6
                    
#r "nuget: SpessaSharp, 4.3.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SpessaSharp@4.3.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SpessaSharp&version=4.3.6
                    
Install as a Cake Addin
#tool nuget:?package=SpessaSharp&version=4.3.6
                    
Install as a Cake Tool

<p align='center'><img src='spessasharp_logo_rounded.png' width='300' alt='SpessaSynth logo'></p>

SpessaSharp is a C# port of the SpessaSynth library by Spessasus.

Last commit: Support for Overlapping Notes and better Mono Mode

using SpessaSharp.MIDI;
using SpessaSharp.Sequencer;
using SpessaSharp.SoundBank;
using SpessaSharp.Synthesizer;
using SpessaSharp.Utils;

// Process arguments
if (args is not [var pathSoundBank, var pathMidi, var pathWav, ..])
  throw new Exception("Expected sound bank, midi, and wav path");

// Read MIDI and sound bank
var midi = Midi.From(new FileInfo(pathMidi));
var soundBank = SoundBank.From(new FileInfo(pathSoundBank));

// Initialize the synthesizer
const int sampleRate = 48_000;
var processor = new SpessaSharpProcessor(
    sampleRate, Synthesizer.Options.Default with { EventsEnabled = false });
processor.SoundBankManager.Add(soundBank, "main");

// Initialize the sequencer
var sequencer = new SpessaSharpSequencer(processor);
sequencer.LoadNewSongList([midi]);
sequencer.Play();

// Prepare the output buffers
var sampleCount = (int)Math.Ceiling(sampleRate * (midi.Duration.TotalSeconds + 2));
var outLeft = new float[sampleCount];
var outRight = new float[sampleCount];
var filledSamples = 0;

// Note: buffer size is recommended to be very small, as this is the interval between modulator updates and LFO updates
const int BUFFER_SIZE = 128;

while (filledSamples < sampleCount)
{
    // Process sequencer
    sequencer.ProcessTick();
    // Render
    var bufferSize = Math.Min(BUFFER_SIZE, sampleCount - filledSamples);
    processor.Process(outLeft, outRight, filledSamples, bufferSize);
    filledSamples += bufferSize;
}

var wave = AudioUtil.ToWav([outLeft, outRight], sampleRate);
File.WriteAllBytes(pathWav, wave);
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
4.3.16-nightly-00079 60 8/20/2026
4.3.16-nightly-00078 66 8/19/2026
4.3.16-nightly-00077 71 8/18/2026
4.3.16-nightly-00076 82 8/17/2026
4.3.16-nightly-00075 80 8/16/2026
4.3.16-nightly-00074 80 8/15/2026
4.3.16-nightly-00073 79 8/14/2026
4.3.16-nightly-00072 89 8/13/2026
4.3.16-nightly-00071 86 8/12/2026
4.3.16-nightly-00070 83 8/11/2026
4.3.16-nightly-00069 76 8/10/2026
4.3.16-nightly-00068 81 8/9/2026
4.3.16-nightly-00067 85 8/8/2026
4.3.16-nightly-00066 85 8/7/2026
4.3.16-nightly-00065 82 8/6/2026
4.3.16-nightly-00064 88 8/5/2026
4.3.16-nightly-00063 101 8/4/2026
4.3.16-nightly-00062 101 8/3/2026
4.3.16-nightly-00061 101 8/2/2026
4.3.6 134 5/27/2026
Loading failed