LibXmp.Managed
4.7.4.1
dotnet add package LibXmp.Managed --version 4.7.4.1
NuGet\Install-Package LibXmp.Managed -Version 4.7.4.1
<PackageReference Include="LibXmp.Managed" Version="4.7.4.1" />
<PackageVersion Include="LibXmp.Managed" Version="4.7.4.1" />
<PackageReference Include="LibXmp.Managed" />
paket add LibXmp.Managed --version 4.7.4.1
#r "nuget: LibXmp.Managed, 4.7.4.1"
#:package LibXmp.Managed@4.7.4.1
#addin nuget:?package=LibXmp.Managed&version=4.7.4.1
#tool nuget:?package=LibXmp.Managed&version=4.7.4.1
LibXmp.Managed
A platform-agnostic build of libxmp 4.7.4
— the module player behind XMP — as a pure-IL 64-bit .NET assembly, with a
small C# wrapper. The package contains no native code and makes no P/Invoke
calls: LibXmp.Managed.dll is IL only and platform-neutral (CorFlags.ILOnly,
Machine.I386, PE32), so one file runs on x64 and arm64 — Windows, Linux or
macOS — with no runtime dependency beyond the framework. A 64-bit process is
required: the wrapper checks IntPtr.Size at startup.
It plays tracker modules (MOD, XM, IT, S3M, MED, DBM, FAR, MTM, PTM, 669, ULT, MDL, GDM, IMF, OKT, STM, STX, PT3, SFX, AMF, RTM, LIQ, MMD, and the rest of libxmp's built-in loaders) and renders 16-bit stereo PCM at 44.1 kHz.
Install
dotnet add package LibXmp.Managed
Targets net9.0 (x64). The assembly references System.Runtime 9.0.0.0; it
does not run on .NET Framework or AnyCPU.
Quick start
using LibXmp.Managed.Wrapper;
byte[] data = File.ReadAllBytes("song.mod");
using LibXmpContext ctx = LibXmpContext.Load(data); // xmp_load_module_from_memory
ModuleInfo info = ctx.GetModuleInfo();
Console.WriteLine($"{info.Name} ({info.Type}) {info.Channels}ch {info.Orders} orders");
ctx.Start(44100, 0); // 16-bit stereo
byte[] pcm = new byte[4096];
while (ctx.Render(pcm) == 0)
{
// write pcm to an audio device or a WAV file
}
LibXmpContext also exposes Probe (xmp_test_module_from_memory),
GetFrameInfo, SetPlayer, ChannelMute, ChannelVolume, SeekTime,
SetPosition, GetEventHash, DumpEvents, and both Render overloads
(bytes and short[]). Errors throw LibXmpException with an XmpError
value.
What works
- All built-in loaders and effects, memory loading and probing, playback, seeking, channel control, module/frame info.
- Deterministic output: the RNG is seeded to a fixed value, and a native build
of the same sources produces byte-identical PCM for every module both
builds load (the project's differential suite covers the whole libxmp
corpus, including all 396 malformed
f/fixtures). - Linux and Windows run the same assembly and produce the same PCM.
What does not
- Archive depackers and ProWizard are compiled out. Compressed modules
(
.xz,.bz2,.gz,S404, …) and PowerPack-packed modules are rejected withXmpError.Format. - No file-system loading.
xmp_load_module/xmp_test_moduleand external sample/instrument lookup are unavailable; use the memory APIs (Load,Probe). Some loaders that are selected by file name rather than content (MFP, and MED files that are really plain data) cannot be probed from memory. - 64-bit .NET 9 only.
License
MIT. libxmp is Copyright (C) 1996-2026 Claudio Matsuoka and Hipolito Carraro
Jr; portions of the portable runtime are ported from musl libc, Copyright (c)
2005-2020 Rich Felker, et al. The full text is in LICENSE, and the
third-party attributions are in THIRD-PARTY-NOTICES.md; both files are in
the package root.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
libxmp 4.7.4 compiled to IL with llvm-msil. 4.7.4.1 ships the platform-neutral header (Machine=I386, PE32, ILOnly) so the same assembly loads on x64 and arm64, and adds the 64-bit guard, arm64 and 32-bit test coverage. cf. THIRD-PARTY-NOTICES.md for the exact source revision and patches.