A C# library and command-line tool that parses Clone Hero chart files (.msce format) and converts them to Lua table format. This tool is useful for extracting chart data from Clone Hero song charts and exporting them in a format that can be used with Lua-based applications.
Clone Hero is a popular rhythm game that uses chart files to define songs. Chart files contain structured data about the song metadata, sync track information, note placements across different difficulty levels, and events. This project provides tools to parse these chart files and serialize them into Lua tables for use in other applications.
- Chart File Parsing: Reads and parses Clone Hero
.mscechart files - Data Extraction: Extracts song metadata, sync tracks, notes, and events
- Lua Serialization: Converts parsed chart data into Lua table format
- Multiple Difficulty Levels: Supports Guitar and Bass tracks with Easy, Medium, Hard, and Expert difficulty levels
- Command-Line Interface: Easy-to-use console application for batch processing
CloneHeroChartToLuaParser.ClassLibrary/
├── Parser.cs # Main parsing logic for chart files
├── LuaSerializer.cs # Serializes objects to Lua table format
└── Classes/
├── Chart.cs # Main chart data model
├── Song.cs # Song metadata
├── SyncTrack.cs # Sync track information
├── Event.cs # Chart events
└── Note.cs # Individual note data
CloneHeroChartToLuaParser.ConsoleApp/
└── Program.cs # Command-line interface
CloneHeroChartToLuaParser.TestProject/
└── UnitTest1.cs # Unit tests for parser functionality
Main container for all chart data, including:
Song: Metadata about the songSyncTracks: List of tempo/time signature changes- Difficulty tracks:
ExpertSingle,HardSingle,MediumSingle,EasySingle,ExpertDoubleBass,HardDoubleBass,MediumDoubleBass,EasyDoubleBass Events: Special events triggered during gameplay
Song metadata including:
Offset: Audio offset in millisecondsResolution: PPQN (Parts Per Quarter Note)Difficulty: Difficulty ratingPreviewStart/PreviewEnd: Preview timingGenre: Song genreMediaType: Audio file typePlayer2: Player 2 track setting
Individual note data:
Tick: Position in the chartType: Note type identifierFret: Fret number (0-5)Length: Duration of the note
Timing information:
Tick: Position in the chartType: Sync event typeValue: Tempo or time signature value
Chart events:
Tick: Position in the chartType: Event typeValue: Event-specific data
CloneHeroChartToLuaParser.ConsoleApp <path_to_chart_file> <output_path>Example:
CloneHeroChartToLuaParser.ConsoleApp "song_chart.msce" "output.lua"This will parse the chart file and output a Lua table representation to the specified output file.
using CloneHeroChartToLuaParser.ClassLibrary;
using CloneHeroChartToLuaParser.ClassLibrary.Classes;
// Parse a chart file
Parser.Parse("song_chart.msce", "output.lua");
// Or parse sections manually
string chartContent = File.ReadAllText("song_chart.msce");
var sections = Parser.ReadSections(chartContent);
// Parse specific sections
var songData = Parser.ReadSongData(sections["[Song]"]);
var syncTrack = Parser.ReadSyncTrack(sections["[SyncTrack]"]);The parser outputs a Lua table structure that can be directly used in Lua applications:
{
Song = {
Offset = 1000,
Resolution = 192,
Difficulty = 5,
PreviewStart = 0,
PreviewEnd = 30000,
Genre = "Rock",
MediaType = "mp3",
Player2 = "Bass"
},
SyncTracks = { ... },
Events = { ... },
ExpertSingle = { ... },
-- ... other difficulty tracks
}This project uses .NET and can be built with Visual Studio or the .NET CLI:
dotnet buildRun tests with:
dotnet testTest files include sample chart files (e.g., Beast and the Harlot.msce) to verify parsing correctness.
- .NET 6.0 or higher
- FluentAssertions (for testing)
Please check the project for license information.
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.