Skip to content

API Reference

The Flat Embed SDK provides 66 methods to control and interact with embedded sheet music.

Quick Navigation

Press ⌘ + K (Mac) or Ctrl + K (Windows/Linux) to search for specific methods.

Browse by Category

Core Methods

Essential methods for embed initialization and configuration (3 methods)

MethodDescription
ready()Wait for the embed to be ready
getEmbedConfig()Get the embed configuration
setEditorConfig()Set the editor configuration

Event System

Subscribe to and handle embed events (2 methods)

MethodDescription
on()Subscribe to a specific event
off()Unsubscribe to a specific event

Score Management

Methods for loading and exporting scores in various formats (14 methods)

MethodDescription
loadFlatScore()Load a score hosted on Flat
loadMusicXML()Load a MusicXML score
loadMIDI()Load a MIDI score
loadJSON()Load a Flat JSON score
loadABC()Load an ABC notation score
getJSON()Get the score in Flat JSON format
getMusicXML()Convert the displayed score to MusicXML
getPNG()Convert the displayed score to PNG image
getMIDI()Convert the displayed score to MIDI
getMP3()Convert the displayed score to MP3 audio
getWAV()Convert the displayed score to WAV audio
getPDF()Convert the displayed score to PDF
getSVG()Convert the displayed score to SVG
getFlatScoreMetadata()Get the metadata of the score (for scores hosted on Flat)

Display & View

Control the visual presentation of the score (6 methods)

MethodDescription
fullscreen()Toggle fullscreen mode
print()Print the score
getZoom()Get the current zoom ratio
setZoom()Set the zoom ratio
getAutoZoom()Get the auto-zoom status
setAutoZoom()Enable or disable auto-zoom

Playback Control

Control playback, volume, speed, and metronome settings (10 methods)

MethodDescription
play()Start playback
pause()Pause playback
stop()Stop playback
mute()Mute playback
getMasterVolume()Get the current master volume
setMasterVolume()Set the master volume
getMetronomeMode()Get the metronome mode
setMetronomeMode()Set the metronome mode
getPlaybackSpeed()Get the playback speed
setPlaybackSpeed()Set the playback speed

Parts & Instruments

Manage individual parts, instruments, and their audio settings (12 methods)

MethodDescription
getPartVolume()Get the volume of a specific part
setPartVolume()Set the volume of a specific part
mutePart()Mute a specific part
unmutePart()Unmute a specific part
setPartSoloMode()Enable solo mode for a part
unsetPartSoloMode()Disable solo mode for a part
getPartSoloMode()Get the solo mode status of a part
getPartReverb()Get the reverb level of a part
setPartReverb()Set the reverb level of a part
getParts()Get information about all parts
getDisplayedParts()Get the currently displayed parts
setDisplayedParts()Set which parts to display

Audio/Video Tracks

Synchronize external audio or video with the score (3 methods)

MethodDescription
setTrack()Configure an audio or video track
useTrack()Enable a previously configured track
seekTrackTo()Seek to a position in the audio track

Navigate through the score and control cursor position (6 methods)

MethodDescription
focusScore()Set focus to the score
getCursorPosition()Get the cursor position
setCursorPosition()Set the cursor position
goLeft()Move cursor left
goRight()Move cursor right
scrollToCursor()Scroll to cursor position

Score Data & Structure

Access and query score structure, measures, notes, and metadata (10 methods)

MethodDescription
getNbMeasures()Get the number of measures in the score
getMeasuresUuids()Get the measure UUIDs of the score
getMeasureDetails()Get detailed measure information
getNbParts()Get the number of parts in the score
getPartsUuids()Get the part UUIDs of the score
getMeasureVoicesUuids()Get voice UUIDs for a specific measure
getMeasureNbNotes()Get the number of notes in a voice
getNoteData()Get information about a specific note
playbackPositionToNoteIdx()Convert playback position to note index
getNoteDetails()Get note details at cursor position

All Methods

MethodDescription
focusScore()Set focus to the score
fullscreen()Toggle fullscreen mode
getAutoZoom()Get the auto-zoom status
getCursorPosition()Get the cursor position
getDisplayedParts()Get the currently displayed parts
getEmbedConfig()Get the embed configuration
getFlatScoreMetadata()Get the metadata of the score (for scores hosted on Flat)
getJSON()Get the score in Flat JSON format
getMasterVolume()Get the current master volume
getMeasureDetails()Get detailed measure information
getMeasureNbNotes()Get the number of notes in a voice
getMeasuresUuids()Get the measure UUIDs of the score
getMeasureVoicesUuids()Get voice UUIDs for a specific measure
getMetronomeMode()Get the metronome mode
getMIDI()Convert the displayed score to MIDI
getMP3()Convert the displayed score to MP3 audio
getMusicXML()Convert the displayed score to MusicXML
getNbMeasures()Get the number of measures in the score
getNbParts()Get the number of parts in the score
getNoteData()Get information about a specific note
getNoteDetails()Get note details at cursor position
getPartReverb()Get the reverb level of a part
getParts()Get information about all parts
getPartSoloMode()Get the solo mode status of a part
getPartsUuids()Get the part UUIDs of the score
getPartVolume()Get the volume of a specific part
getPDF()Convert the displayed score to PDF
getPlaybackSpeed()Get the playback speed
getPNG()Convert the displayed score to PNG image
getSVG()Convert the displayed score to SVG
getWAV()Convert the displayed score to WAV audio
getZoom()Get the current zoom ratio
goLeft()Move cursor left
goRight()Move cursor right
loadABC()Load an ABC notation score
loadFlatScore()Load a score hosted on Flat
loadJSON()Load a Flat JSON score
loadMIDI()Load a MIDI score
loadMusicXML()Load a MusicXML score
mute()Mute playback
mutePart()Mute a specific part
off()Unsubscribe to a specific event
on()Subscribe to a specific event
pause()Pause playback
play()Start playback
playbackPositionToNoteIdx()Convert playback position to note index
print()Print the score
ready()Wait for the embed to be ready
scrollToCursor()Scroll to cursor position
seekTrackTo()Seek to a position in the audio track
setAutoZoom()Enable or disable auto-zoom
setCursorPosition()Set the cursor position
setDisplayedParts()Set which parts to display
setEditorConfig()Set the editor configuration
setMasterVolume()Set the master volume
setMetronomeMode()Set the metronome mode
setPartReverb()Set the reverb level of a part
setPartSoloMode()Enable solo mode for a part
setPartVolume()Set the volume of a specific part
setPlaybackSpeed()Set the playback speed
setTrack()Configure an audio or video track
setZoom()Set the zoom ratio
stop()Stop playback
unmutePart()Unmute a specific part
unsetPartSoloMode()Disable solo mode for a part
useTrack()Enable a previously configured track

Copyright © Tutteo Limited