MapWizard.BeatmapParser 1.0.6

dotnet add package MapWizard.BeatmapParser --version 1.0.6
                    
NuGet\Install-Package MapWizard.BeatmapParser -Version 1.0.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="MapWizard.BeatmapParser" Version="1.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MapWizard.BeatmapParser" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="MapWizard.BeatmapParser" />
                    
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 MapWizard.BeatmapParser --version 1.0.6
                    
#r "nuget: MapWizard.BeatmapParser, 1.0.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 MapWizard.BeatmapParser@1.0.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=MapWizard.BeatmapParser&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=MapWizard.BeatmapParser&version=1.0.6
                    
Install as a Cake Tool

BeatmapParser

A lightweight C# library for decoding, editing, and re-encoding osu! .osu beatmap files. It models every major section of the file format so you can inspect or programmatically modify metadata, timing information, events, colours, and hit objects before writing the map back to disk.

Features

  • Parses osu! file format versions 14 and 128 into strongly typed section objects (General, Metadata, Difficulty, TimingPoints, HitObjects, etc.).
  • Encodes a Beatmap back to a valid .osu document via Beatmap.Encode().
  • Section helpers to query timing points, BPM, volume, backgrounds, and specific hit objects.
  • Nullability-aware API so optional sections (Editor, Colours, TimingPoints) are easy to detect and guard against.
  • Pure library design with no runtime dependencies outside the .NET SDK.

Requirements

  • .NET SDK 10.0 (preview) or newer. The project’s TargetFramework is net10.0; earlier SDKs will fail to restore/build.

Getting Started

Get it from NuGet:

dotnet add package MapWizard.BeatmapParser --version 1.0.0

Usage

Decode an existing beatmap

using System.IO;
using BeatmapParser;

var beatmap = Beatmap.Decode(new FileInfo("/maps/example.osu"));
Console.WriteLine($"Title: {beatmap.MetadataSection.Title}");
Console.WriteLine($"HP: {beatmap.DifficultySection.HPDrainRate}");

Inspect timing and events

var bpm = beatmap.GetBpmAt(45_000);
var volume = beatmap.GetVolumeAt(60_000);
var bg = beatmap.GetBackgroundFilename();
Console.WriteLine($"BPM @45s: {bpm}, Volume @60s: {volume}%, Background: {bg}");

Modify and re-encode

beatmap.GeneralSection.AudioFilename = "remix.mp3";
beatmap.MetadataSection.Version = "Hard";
beatmap.SetBackgroundFileName("cool-bg.jpg");

var newContents = beatmap.Encode();
File.WriteAllText("/maps/example-remix.osu", newContents);

Decoding from raw text

If you already have the .osu contents loaded, call Beatmap.Decode(string beatmapString) instead of the FileInfo overload.

Project Structure

  • Beatmap.cs – entry point with Beatmap.Decode/Beatmap.Encode plus convenience helpers.
  • Sections/ – strongly typed representations for each numbered section in an osu! file.
  • HitObjects/ – models for circles, sliders, spinners, mania holds, and helper classes to work with curve points and samples.
  • TimingPoints/ – handling for inherited/uninherited timing points and BPM/volume calculations.
  • Events/ & Colours/ – storyboard primitives and combo colour definitions.

Development Workflow

  • dotnet build compiles the library.
  • dotnet test runs the unit tests in BeatmapParser.Tests.
  • Keep changes targeting .NET 10 unless the BeatmapParser.csproj is updated to multi-target.

Contributing

  1. Fork and branch from main.
  2. Keep PRs focused; add/adjust section decoders with accompanying unit tests where possible.
  3. Run dotnet build and dotnet test before submitting.
  4. Document new public APIs and update this README with additional usage notes if appropriate.

Roadmap & Known Limitations

  • Encoding is only guaranteed for format versions 14 and 128.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • 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.

Version Downloads Last Updated
1.0.6 152 3/27/2026
1.0.5 131 3/3/2026
1.0.3 220 12/31/2025
1.0.2 113 12/30/2025
1.0.1 222 11/24/2025
1.0.0 201 11/23/2025