Skip to content
This repository was archived by the owner on Jun 27, 2026. It is now read-only.

Adding Key Counts

ImVeryBad edited this page May 25, 2025 · 11 revisions

There are 3 methods for adding key counts to songs with MultiKeys, listed in order of priority:

  1. ScriptedSong Class Code (Highest Priority)
  2. Song Metadata (Medium Priority)
  3. Song MultiMeta (Lowest Priority)

ScriptedSong Class code

For adding key counts to a ScriptedSong, create a setupMultikey() function, for example:

class TutorialSong extends ScriptedSong {
    function new() {
        super("tutorial");
    }

    function setupMultikey() {
        // Add other logic if needed...
        Strumline.KEY_COUNT = 8;
    }
}

Key Points:

  • This method has the highest priority and will override other methods
  • Key count must be between 1-9 (defaults to 4 if outside this range)
  • Can be modified with scripts if needed

Song Metadata

There are two approaches for modifying song metadata:

Direct Metadata Modification

Add a "keyCounts" field within the "playData" field of your song's metadata:

{
  "playData": {
    "keyCounts": { "easy": 1, "normal": 5, "hard": 9 },
  }
}

JSON Patch Method (Recommended)

Use this method when the song metadata already exists to avoid overwriting existing data.

Create a file at _merge/data/songs//-metadata.json:

[
  { "op": "add", "path": "/playData/keyCounts", "value": { "easy": 5, "normal": 6, "hard": 7 } }
]

| ⚠️ Important: Always use the JSON Patch method if the song metadata already exists to prevent overwriting existing data.

For more details on JSON Patch, see the official documentation.

Song MultiMeta

This is the simplest method and allows you to create a separate file alongside the metadata.

Create a file at data/songs//-multidata.json:

{
  "keyCounts": {
    "variation": {
      "default": { "easy": 1, "normal": 5, "hard": 9 },
      "pico": { "easy": 5 }
    }
  }
}

Benefits:

  • Keeps multikey data separate from main metadata
  • Supports multiple variations
  • Easy to manage and modify

File Naming Conventions

Metadata Files:

  • Direct: data/songs/<songID>/<songID>-metadata.json
  • JSON Patch: _merge/data/songs/<songID>/<songID>-metadata.json

MultiMeta Files:

  • data/songs/<songID>/<songID>-multidata.json

ScriptedSong Files:

  • data/songs/<songID>/<SongName>Song.hx

Important Notes

  • Key Count Range: Only 1-9 keys are supported. Values outside this range default to 4 keys
  • File Naming: Ensure consistent naming with matching your song's identifier
  • JSON Syntax: Validate your JSON files to prevent parsing errors
  • Variation Support: MultiMeta supports multiple song variations (default, pico, etc.)

Clone this wiki locally