MusicBox options

The following table lists user-configurable options for the MusicBox interface. These can be set in various ways, which are described after the list of options.
option name default value description
anticipationTime -20 The time-to-quarter-note alignment table is polled periodically for event updated. Typically this happens at about 40 Hz (every 25 milliseconds). If a future event is very close to the current event, it may be better to include the future event with the current events. In addition, there may be a time lag between detecting that an event occurs and when the notes are highlighted in a score. Therefore this parameter gives an absolute time adjustment with respect the the current media time. For example -20 means that any event occuring up to 20 millseconds into the future will be activated now. Also see the pollFrequency option.
idPostfix This option is used to generate unique IDs when more than one MusicBox interface is given on a webpage. Each MusicBox on a page must have a unique idPostfix option value so that the MusicBoxes can work independently. All selector options which are IDs will have this tag appended to the ID. For example, #musicbox-score-container with idPostFix=-mvmt1 will generate a final ID of #musicbox-score-container-mvmt1.
pollFrequency 20 This is the repeat rate in milliseconds for the polling function which monitors the current time in the video, and then checks the timemap for any new events to process. The default value is 20 millseconds, although the common minimum time for setInterval() is about 23 milliseconds. Also see the anticipationtime option.
scoreDataSelector #musicbox-score-data When the score definition data is stored on the page, or within a script loaded into the page, this is the ID of the script element which stores the data for the score definition.
scoreSelector #musicbox-score-container This is the selector ID for the div element on the page into which the score should be placed.
scrollAnimationTime 800 This is the time to take when scrolling from one musical system to another while playing the score. The default time is 800 milliseconds.
timemapsDataSelector #musicbox-timemaps-data When timemaps are embedded into the HTML page, or loaded as scripts onto the page, this is the ID of the script in which the timemap data is located.
titleSelector .musicbox-title If a webpage contains an element with the class name given by this option, then any title found in the JSON score data will be displayed within that element.
systemViewCount 1 In the default video display mode as well as the boxed audio or plain score modes, this number indicates the number of musical systems to display at one time. The default value of 1 indicates that only one system will be displayed at a time. The height of the box will be set to the maximum system height times the number of systems to view.
videoSelector #musicbox-video-container This is the ID for the element into which a video element should be inserted on the page.

MusicBox options can be set in several ways:

  1. by MusicBox.setOption(), such as: musicbox.setOption(pollFrequency, 50), which would set the pollFrequency option to 50 milliseconds.