Parses .SM 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 which allows per-chart BPM overrides and additional metadata.
[heading: "Methods"] [table header] [ Method | Parameters | Description ] [ parseSM | (files, smContent) | Parses raw .SM content and returns a song object ] [ readFileContent | (file) | Reads a File object as text via FileTools. ] [ 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"]