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

    SNES-style atmospheric music generator with customizable environments and scales. More...

    Import Statement: import Clayground.Sound

    Detailed Description

    MoodPlayer creates procedural atmospheric music inspired by classic SNES RPG soundtracks like Chrono Trigger, Secret of Mana, and Zelda: A Link to the Past.

    The generator is fully deterministic - the same seed with identical parameters will always produce the exact same music, enabling easy sharing of compositions.

    Basic Usage

    import Clayground.Sound
    
    MoodPlayer {
        id: music
        environment: "cave"
        scale: "dorian"
        seed: 42
        volume: 0.7
        intensity: 0.5
        onReadyChanged: if (ready) play()
    }

    Share Codes

    Share compositions using the shareCode property:

    // Get shareable code
    console.log(music.shareCode)  // "cave-dor-ampb-50-30-85-42"
    
    // Apply shared code
    music.shareCode = "mountain-pent-amb-80-20-90-1337"

    Available Environments

    EnvironmentCharacterDefault Scale
    forestMysterious, flowing arpeggios (Secret of Mana style)dorian
    dungeonDark, pulsing tension (Dark World style)phrygian
    villagePeaceful, bright melodies (Kakariko Village style)major
    caveDeep, echoing drones with water dripsminor
    mountainMajestic, airy atmospherelydian
    oceanRolling wave patterns, flowing movementmixolydian
    desertExotic, shimmering heat hazephrygian
    snowCrystalline, ethereal coldpentatonic

    Available Scales

    Layer Control

    Control which musical layers are active:

    MoodPlayer {
        environment: "cave"
        layers: ["arp", "pad", "bass"]  // melody disabled for ambient feel
    }

    Available layers:

    See also Sound and Music.