Struct gabc_parser::Syllable [−][src]
Struct representing a gabc syllable with text and music, e.g. "Po(eh/hi)"
Fields
text: &'a str
Text part of the syllable
music: Vec<NoteElem<'a>>
Music part of the syllable
Methods
impl<'a> Syllable<'a>
[src]
impl<'a> Syllable<'a>
pub fn new<'b>(gabc_input: &'b str, current_clef: &'b str) -> Syllable<'b>
[src]
pub fn new<'b>(gabc_input: &'b str, current_clef: &'b str) -> Syllable<'b>
Create a new syllable from well-formed gabc input.
Examples
let s = Syllable::new("Po(eh/hi)", "c3"); assert_eq!(s.text, "Po"); assert_eq!(s.music.len(), 5);
pub fn ly_notes(&self) -> String
[src]
pub fn ly_notes(&self) -> String
Translate this syllable's music string into a tied sequence of Lilypond notes.
Examples
let s = Syllable::new("Po(eh/hi)", "c3"); assert_eq!(s.ly_notes(), "g(c' c' d')");
pub fn ly_text(&self) -> String
[src]
pub fn ly_text(&self) -> String
Translate this syllable's text into valid Lilypond lyrics. If there are no Notes in this syllable's music string, add "\set stanza = " to prevent Lilypond matching this text to a note.
Examples
let s = Syllable::new("*()", "c3"); assert_eq!(s.ly_text(), " \\set stanza = \"*\" ");