Class Ultrastar
Ultrastar synchronized lyrics parser. Parses Ultrastar synchronized lyrics into a JSON-like object to make life easier for anyone who wants to use them on a web application. The current version is incomplete with some missing features, but it works fine for lyrics defined using absolute offset beats.
TODO
- Support RELATIVE offset beats
- Support for VIDEO* tags
- Line separator parsing
- http://karaoke.kjams.com/forum/viewtopic.php?f=3&t=395
- http://www.dwe-games.com/web/ultrastar/ayuda/html/tut1.htm
Defined in: ultrastar.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Ultrastar(text, options)
|
| Method Attributes | Method Name and Description |
|---|---|
|
The parsed text in a JSON-like object.
|
Class Detail
Ultrastar(text, options)
- Parameters:
- {String} text
- The synchronized lyrics as read from the .txt file.
- {Object} options Optional
- Currently not in use.
- See:
- #getLyrics for the documentation of the JSON-like object structure.
Method Detail
{Object}
getLyrics()
The parsed text in a JSON-like object.
Format of the returned object:
{
(<tag>: {String},)*
sentences:
[({
start: {Integer, miliseconds},
text: {String},
syllables:
[({
start: {Integer, miliseconds},
length: {Integer, miliseconds},
pitch: {Integer},
text: {String}
},)*]
},)*]
}
All values in miliseconds are absolute.<tag> are meta data values found in the header of the .txt file.
Example
{
title: "All Star",
artist: "Smash Mouth",
mp3: "05-All Star.mp3",
bpm: "104",
gap: "500",
sentences:
[{
start: 500,
text: "Somebody once told me ",
syllables:
[{
start: 500,
length: 432,
pitch: 54,
text: "Some"
},
{
start: 1076,
length: 288,
pitch: 61,
text: "bo"
},
{
start: 1365,
length: 288,
pitch: 58,
text: "dy "
},
{
start: 1653,
length: 432,
pitch: 58,
text: "once "
},
{
start: 2230,
length: 288,
pitch: 56,
text: "told "
},
{
start: 2519,
length: 288,
pitch: 54,
text: "me "
}]
},
{
start: 2807,
text: "the world is gonna roll me, ",
syllables: [...]
}]
}
- Returns:
- {Object} The JSON-like object.