← Back to Docs
  • index.html
  • Clayground
  • Clayground.Sound
  • SongPlayer
  • Clayground 2026.2
  • SongPlayer QML Type

    Plays a parsed .song.json file against a set of instruments. More...

    Import Statement: import Clayground.Sound

    Detailed Description

    Resolves each track's instrument field against the objectName of the provided instruments, then advances playback position in beats on an internal timer, firing triggerNote() on the matching instrument. Watches the source file for changes and hot-reloads without resetting the playhead.

    See the Clayground.Sound Module overview or the plugin README for the JSON format.

    Properties

    Path to a .song.json file.

    List of instrument objects (SynthInstrument / SampleInstrument etc). Each is looked up by its objectName to match track bindings.

    True once the song parsed successfully.

    Read-only. True while actively advancing.

    Current position in beats.

    Tempo in BPM, taken from the song file.

    Total length in beats (sum of section lengths (\times) repeats).

    When true, playback wraps to 0 at end instead of stopping.

    Last parse/IO error, empty when OK.

    Methods

    Signals

    Emitted when the song reaches its end (not when looping).

    Emitted after the source file changed on disk and was re-parsed successfully; playback continues from the current position.

    Emitted when the source file fails to parse. On a mid-playback hot reload, the previous model is preserved and playback keeps going.

    See also SynthInstrument and SampleInstrument.