Reference Devices compiles

song_sync_device: Music That Drives Your Gameplay

Building a concert stage, a rhythm minigame, or a level whose lights pulse to the beat? The Patchwork Song Sync device gives every Patchwork device a shared timeline so music, sequences, and gameplay all march to the same drum. In Verse you control when that shared clock is running with two simple calls: Enable and Disable.

Updated Examples verified on the live UEFN compiler

Overview

The song_sync_device is a Patchwork device that helps you synchronize music, visuals, and gameplay so they all follow the same timeline. You combine it with level sequences, MIDI data, and other Patchwork devices (music managers, instrument players, drum sequencers) so that when the music plays, your stage lights, cinematics, and gameplay beats stay locked together.

Reach for it whenever timing matters across multiple systems: a concert stage where the laser show must hit on the downbeat, a rhythm game where damage triggers land on the beat, or a boss arena where attack waves are choreographed to the soundtrack.

Because song_sync_device extends patchwork_device, its Verse surface is intentionally tiny — you mostly configure it in the editor and then turn it on and off from Verse at the right gameplay moment. That's exactly what Enable() and Disable() are for: start the synchronized timeline when the show begins, stop it when the round ends.

API Reference

song_sync_device

Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse). Inherited members are merged from patchwork_device.

song_sync_device<public> := class<concrete><final>(patchwork_device):

Methods (call these to make the device act):

Method Signature Description
Enable Enable<public>():void Enables this device.
Disable Disable<public>():void Disables this device.

Walkthrough

Let's build a concert trigger. A player steps on a pressure plate at the front of the stage; that starts the Song Sync timeline (so the music and the synced light show begin together). When a separate "end show" button is pressed, we stop the sync.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/Patchwork }
using { /Verse.org/Simulation }

# A concert controller: start the synchronized show when a player
# steps on the stage plate, stop it when the end button is pressed.
concert_controller := class(creative_device):

    # The Song Sync device that drives the shared music/visual timeline.
    @editable
    SongSync : song_sync_device = song_sync_device{}

    # Pressure plate at the front of the stage that starts the show.
    @editable
    StartPlate : trigger_device = trigger_device{}

    # Button backstage that ends the show.
    @editable
    EndButton : button_device = button_device{}

    OnBegin<override>()<suspends>:void =
        # Make sure the timeline is NOT running until a player triggers it.
        SongSync.Disable()

        # Subscribe our handler methods to the device events.
        StartPlate.TriggeredEvent.Subscribe(OnStartStepped)
        EndButton.InteractedWithEvent.Subscribe(OnEndPressed)

    # Runs when a player steps on the stage plate.
    OnStartStepped(Agent : ?agent):void =
        if (Player := Agent?):
            # Kick off the shared timeline — music + synced visuals begin.
            SongSync.Enable()

    # Runs when a player presses the end-show button.
    OnEndPressed(Agent : agent):void =
        # Stop the synchronized timeline for everyone.
        SongSync.Disable()

Line by line:

  • The three @editable fields let you drop the actual placed devices into the slots in the UEFN Details panel. SongSync is declared as a song_sync_device so we can call its real methods.
  • In OnBegin, SongSync.Disable() guarantees the show starts in a clean, stopped state.
  • StartPlate.TriggeredEvent.Subscribe(OnStartStepped) wires the plate's event to our method. A trigger hands a ?agent (an optional agent), so the handler signature is (Agent : ?agent).
  • EndButton.InteractedWithEvent.Subscribe(OnEndPressed) wires the button. The button hands a plain agent, so that handler takes (Agent : agent).
  • OnStartStepped unwraps the optional with if (Player := Agent?): before doing work, then calls SongSync.Enable() to start the synchronized timeline.
  • OnEndPressed calls SongSync.Disable() to stop it.

Common patterns

Auto-start the show on map load

Sometimes you want the music timeline running from the moment the round begins — no player input needed. Just enable it in OnBegin.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/Patchwork }
using { /Verse.org/Simulation }

auto_concert := class(creative_device):

    @editable
    SongSync : song_sync_device = song_sync_device{}

    OnBegin<override>()<suspends>:void =
        # Start the synchronized music/visual timeline immediately.
        SongSync.Enable()

Toggle the timeline on a repeating cue

You can drive Enable/Disable from any device event. Here a single button toggles the show on and off, tracking state with a var.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/Patchwork }
using { /Verse.org/Simulation }

stage_toggle := class(creative_device):

    @editable
    SongSync : song_sync_device = song_sync_device{}

    @editable
    ToggleButton : button_device = button_device{}

    # Tracks whether the synchronized timeline is currently running.
    var IsRunning : logic = false

    OnBegin<override>()<suspends>:void =
        SongSync.Disable()
        ToggleButton.InteractedWithEvent.Subscribe(OnToggle)

    OnToggle(Agent : agent):void =
        if (IsRunning?):
            SongSync.Disable()
            set IsRunning = false
        else:
            SongSync.Enable()
            set IsRunning = true

Restart the timeline cleanly

To "restart" the synced show, Disable then Enable. This is handy at the start of each wave or round.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/Patchwork }
using { /Verse.org/Simulation }

show_restarter := class(creative_device):

    @editable
    SongSync : song_sync_device = song_sync_device{}

    @editable
    RestartPlate : trigger_device = trigger_device{}

    OnBegin<override>()<suspends>:void =
        RestartPlate.TriggeredEvent.Subscribe(OnRestart)

    OnRestart(Agent : ?agent):void =
        # Stop, then immediately start so the timeline begins from a known point.
        SongSync.Disable()
        SongSync.Enable()

Gotchas

  • The Verse surface is tiny on purpose. song_sync_device only exposes Enable() and Disable() from its patchwork_device base. The actual tempo, key, and timeline wiring is configured in the editor and via connected Patchwork devices (music manager, sequencers, etc.). Verse is your on/off switch for the shared clock — don't expect Verse methods to set the BPM.
  • You must declare the device as an @editable field. Calling song_sync_device{}.Enable() on a bare literal won't talk to your placed device. Declare @editable SongSync : song_sync_device = song_sync_device{} and assign the real device in the Details panel.
  • Trigger vs button event signatures differ. trigger_device.TriggeredEvent hands you ?agent (optional) — unwrap with if (Player := Agent?):. button_device.InteractedWithEvent hands you a plain agent. Using the wrong handler signature is a compile error.
  • Sync is shared — Disable() stops it for everyone. These methods affect the device's global timeline, not a per-player one. If you Disable mid-show, every connected Patchwork device that follows that timeline stops too.
  • Order matters for a clean start. Calling Disable() in OnBegin before any player triggers Enable() avoids the music being half-way through its timeline when the show is supposed to begin. To restart, call Disable() then Enable().
  • Don't add using {…} mentally and forget it in the filesong_sync_device lives in the Patchwork module, so you need BOTH using { /Fortnite.com/Devices } (for creative_device, triggers, buttons) AND using { /Fortnite.com/Devices/Patchwork } (for the Patchwork device classes), or the compiler reports “Unknown identifier song_sync_device”.

Build your own lesson with song_sync_device

Generate a personalized, step-by-step lesson plan built around this object — grounded in this exact reference and our compile-verified knowledge base.

Build a lesson →