parsehero
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

parsehero

A small, permissive library used to parse .chart and .midi files made for GuitarHero or CloneHero into usable JSON.

  • Permissive - doesn't throw away a whole chart because of a handful of invalid lines
  • MIDI - supports the parsing of MIDI files directly from arbirtrary buffer data via midi-file
  • Cross-platform - built to work out of the box in the browser and in Node environments
  • Built-in timing - parsed charts will their events automatically timestamped by default

Installing

npm install parsehero

Usage

import { parseChart } from "parsehero";

const basicChart = `[Song]
{
  Resolution = 192
}
[SyncTrack]
{
	0 = B 120000
	0 = TS 4
}
[EasySingle]
{
	0 = N 0 0
}`;

const { chart, warnings } = parseChart(basicChart);
// Use your chart object...

References

  • chart2json - robust strict chart parser with a built-in CLI
  • chart2mid2chart - Java implementation of a chart/MIDI converter translated for use in parsehero
  • Moonscraper-Chart-Editor - popular CloneHero chart editor on which much of the timing calculations in parsehero are based

/parsehero/

    Package Sidebar

    Install

    npm i parsehero

    Weekly Downloads

    0

    Version

    0.0.2

    License

    none

    Unpacked Size

    61.5 kB

    Total Files

    5

    Last publish

    Collaborators

    • awphi