Skip to content
osu! Beatmap API in C#
C#
Branch: master
Clone or download
smoogipooo
smoogipooo Hacky fix to fix duplicate properties when saving multiple times.
BMAPI has to be rewritten. *shudders*
Latest commit 78e988a Dec 10, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Properties (*) Reference cleanup. Jul 9, 2014
v1 Hacky fix to fix duplicate properties when saving multiple times. Dec 10, 2014
.gitignore (*) Too many fixes to document. Jun 18, 2014
Colour.cs (*) Modified structure. Jul 9, 2014
Point2.cs
README.md (*) Retarget towards .NET 3.5. Jun 18, 2014
osu!BMAPI.csproj Fix output path. Sep 10, 2014
osu!BMAPI.csproj.user
osu!BMAPI.sln Initial. Mar 3, 2014
osu!BMAPI.v11.suo (*) Fix timing points set to inherit bpm by default. Mar 29, 2014

README.md

osu! Beatmap API

An API designed for quick and painless parsing of osu! beatmap files in .NET. This API exposes the 'Beatmap' class for .NET applications to use. Currently supports reading, creating and saving osu! beatmap file formats up to v12.

What you need to be able to use it:

.NET Framework 3.5

Directions for use:

To use this API you must add a reference to the DLL file in your project (Project -> Add Reference) and add 'using BMAPI' (or the equivalent for your language) to the top of your project.

If you are working with the source files instead (thus working in C#) and compiling the API along with your program, you do not need to add a reference to the DLL file, however the API files must be added to your project (Right click solution -> Add -> Existing Item).

Usage example:

In VB.NET:

'Load the beatmap into a new object
Dim bm As New BMAPI.Beatmap("C:\osu!\Songs\39804 xi - FREEDOM DiVE\xi - FREEDOM DiVE (Nakagawa-Kanon) [FOUR DIMENSIONS].osu")
'Display the approach rate to the user
Console.WriteLine(bm.ApproachRate)
'Change the approach rate to a more 'appropriate' number
bm.ApproachRate = 10
'Let's also change the version to make the map distinguishable from the other maps in the mapset
bm.Version = "Best AR Version"
'Finally, save the beatmap!
bm.Save("C:\osu!\Songs\39804 xi - FREEDOM DiVE\xi - FREEDOM DiVE (Nakagawa-Kanon) [Best AR Version].osu")

In C#:

//Load the beatmap into a new object
BMAPI.Beatmap bm = new BMAPI.Beatmap(@"C:\osu!\Songs\39804 xi - FREEDOM DiVE\xi - FREEDOM DiVE (Nakagawa-Kanon) [FOUR DIMENSIONS].osu");
//Display the approach rate to the user
Console.Writeline(bm.ApproachRate);
//Change the approach rate to a more 'fitting' number
bm.ApproachRate = 10;
//Let's also change the version to make the map distinguishable from the other maps in the mapset
bm.Version = "Best AR Version";
//Finally, save the beatmap!
bm.Save(@"C:\osu!\Songs\39804 xi - FREEDOM DiVE\xi - FREEDOM DiVE (Nakagawa-Kanon) [Best AR Version].osu");

License

The MIT License (MIT)

Copyright (c) 2014 smoogipooo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.