Verse Library verse

01 Standalone

Configures a note sequencer with a scale and connects it to a speaker, playing notes when a button is pressed.

verse-library/note-sequencer-api/01-standalone.verse

using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/Patchwork }

# This is our main script. It lives on a Verse Device.
# We give it a name so we can find it later.
MyMusicBox := class(VerseDevice):
    # We need to tell Verse where our devices are.
    # Think of these as "slots" for your gadgets.
    ButtonInput := property(
        Get():
            return Button
    )
    
    # This is the Note Sequencer. It holds the notes.
    Sequencer := property(
        Get():
            return NoteSeq
    )
    
    # This is the speaker that makes sound.
    Speaker := property(
        Get():
            return InstrumentPlayer
    )
    
    # When the game starts, we set up our music.
    OnBegin<override>()<suspends>:
        # Let's make a simple scale: Do, Re, Mi, Fa.
        # We use the Sequencer to set these notes.
        Sequencer.SetNotes([

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

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