Parses .SM and .SSC files for external songs
[heading: "Description"]ExternalSMParser handles user-imported songs stored in an external directory. Unlike LocalSMParser it works entirely from an in-memory file map and creates blob/object URLs for media playback. It supports both the classic .SM format and the extended .SSC format which allows per-chart BPM overrides and additional metadata.
[heading: "Key Features"] [list] * Supports both .SM and .SSC StepMania file formats * Resolves media URLs from an in-memory file map via object URLs * Handles SSC multi-chart sections with per-chart difficulty metadata * Converts beat-based note timing to seconds [/list] [heading: "Methods"] [table header] [ Method | Parameters | Description ] [ parseSM | (files, smContent) | Parses raw .SM or .SSC content, delegating to parseSSC when appropriate. ] [ readFileContent | (file) | Reads a File object as text via FileTools. ] [ parseSSC | (files, sscContent) | Parses .SSC format content with header and per-chart section support. ] [ convertSSCNotes | (noteData, bpmChanges, stops) | Converts SSC note measure data into the internal note array format. ] [ getLastBpm | (bpmChanges, time, valueType) | Finds the BPM change entry active at a given time value. ] [ beatToSec | (bpmChanges, stops, beat) | Converts a beat position to seconds accounting for BPM changes and stops. ] [/table] [heading: "Example Usage (Modding)"] [codeblock javascript] // Parsing an externally imported .SM file const parser = new ExternalSMParser(); const files = {}; // map of lowercase filenames to File objects const smText = await FileTools.readTextFile(smFileObject); const songData = await parser.parseSM(files, smText); console.log(songData.title, Object.keys(songData.notes).length, 'charts'); [/codeblock] [footer: "© Retora 2026"]