Make Your Music Dance with Verse: The Note Progressor
Tutorial beginner compiles

Make Your Music Dance with Verse: The Note Progressor

Updated beginner Code verified

Make Your Music Dance with Verse: The Note Progressor

Do you want your island music to change mood like a movie? Maybe it starts happy and then gets spooky? We can do that with code! We will use a special device called the Note Progressor. It helps our music follow a pattern. You will learn how to make notes move together. Let's make some magic music!

What You'll Learn

  • What a Note Progressor does.
  • How to connect devices with Verse.
  • How to make music change keys.
  • How to turn the music on and off.

How It Works

Imagine you are playing a piano. You press keys. But what if you want all keys to change at once? That is what this device does. It is like a magic helper. It takes a melody and moves it to a new key. A key is like the "home" note of a song.

Think of it like a train track. The notes are the train. The Note Progressor is the switch. It sends the train to a new track. This keeps the music sounding good. It follows a chord progression. A chord progression is a set of chords that go together. It sounds pleasing to the ear.

We use Verse to talk to the device. Verse is the language of Fortnite islands. We write a script. The script tells the device what to do. We will use a function. A function is a set of instructions. It is like a recipe. You give it a name. You call the name to run the recipe.

We will also use a switch. A switch is like a light switch. It is either On or Off. We will use it to start the music.

Let's Build It

First, place these devices in your island.

  1. Music Manager. This sets the tempo and key.
  2. Note Sequencer. This is your sheet music.
  3. Note Progressor. This changes the chords.
  4. Audio Generator. This makes the sound.
  5. Patchwork Speaker. This plays the sound.

Connect them in the editor. Connect the Sequencer to the Progressor. Connect the Progressor to the Audio Generator. Connect the Generator to the Speaker.

Now, let's write the Verse code. This code will turn the music on.

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

# This is our main device.
# It holds our music devices.
music_device := class(creative_device):
    # We add the devices here.
    # They are like parts of a robot.
    @editable
    NoteSequencer : note_sequencer_device = note_sequencer_device{}

    @editable
    NoteProgressor : note_progressor_device = note_progressor_device{}

    @editable
    AudioGenerator : omega_synthesizer_device = omega_synthesizer_device{}

    @editable
    Speaker : speaker_device = speaker_device{}

    # This is our function.
    # It is like a button you press.
    StartMusic() : void =
        # First, we turn on the sequencer.
        # It starts playing notes.
        NoteSequencer.Enable()

        # Next, we turn on the progressor.
        # It changes the chords.
        NoteProgressor.Enable()

        # Finally, we turn on the speaker.
        # You can hear the music!
        Speaker.Enable()

    # This runs when the game starts.
    OnBegin<override>()<suspends> : void =
        # We call our function.
        # The music starts automatically!
        StartMusic()```

Let's look at the code. The `class` is our island. It holds the devices. The `NoteSequencer` is the sheet music. The `NoteProgressor` is the magic helper. The `AudioGenerator` makes the noise. The `Speaker` is your ears.

The `StartMusic` function is important. It turns everything on. We use `Enable()`. This means "turn on." We use `Disable()` to turn off.

The `OnBegin` function runs first. It is like the start of a video game. It calls `StartMusic`. So the music begins right away.

## Try It Yourself

Can you make the music stop after five seconds? Try adding a timer. Or try turning the music off with a button. You can use a `Switch` device. Connect it to the `Disable()` function.

Hint: Look at the `Enable()` function again. What happens if you swap it out for `Disable()`?

## Recap

You made music with Verse! You used a Note Progressor. It changed the chords. You used functions to start the music. You used devices to make sound. Great job! Keep coding and making music.

## References

*   https://dev.epicgames.com/documentation/en-us/fortnite/using-patchwork-note-progressor-devices-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-patchwork-note-progressor-devices-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite/using-patchwork-note-sequencer-devices-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite/using-patchwork-devices-in-fortnite-creative
*   https://dev.epicgames.com/documentation/en-us/fortnite/fortnite-glossary

Verse source files

Turn this into a guided course

Add using-patchwork-note-progressor-devices-in-fortnite-creative to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.

Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in