Example #1
0
        private Note FindNote(LilypondToken currentToken)
        {
            string text = currentToken.Value;
            Regex  re   = new Regex(@"^([a-g])([eis]*)([,']*)(\d+)([.]*)$");

            Match result = re.Match(text);

            noteBuilder.SetPitch(result.Groups[1].Value);
            noteBuilder.SetSemitone(pitchModifiers[result.Groups[2].Value]);
            noteBuilder.ModifyOctave(FindOctaveModifier(result.Groups[3].Value) + RelativeOctaveModifier(result.Groups[1].Value));
            noteBuilder.SetDuriation(int.Parse(result.Groups[4].Value));
            noteBuilder.SetDotted(result.Groups[5].Value.Length);
            return(noteBuilder.BuildNote());
        }