Example #1
0
        private CommandData ReadValue(TrackData Track, MmlFileReader m, CommandType Type)
        {
            var cmd = Track.AddCommand(Type);

            cmd.Value = ReadNumber(m);
            return(cmd);
        }
Example #2
0
        private CommandData ReadName(TrackData Track, MmlFileReader m, CommandType Type)
        {
            var cmd = Track.AddCommand(Type);
            var t   = m.ReadName();

            cmd.Text = t;
            return(cmd);
        }
Example #3
0
        private void Rest(SongData Song, TrackData Track, Command Command, MmlFileReader m)
        {
            var cmd = Track.AddCommand(CommandType.Rest);

            Track.SetLastNote(cmd);
            var Tick = ReadNoteLength(Track.DefaultTick, Song.MasterTick, m);

            cmd.Tick = Tick;
        }
Example #4
0
        private void Note(SongData Song, TrackData Track, Command Command, MmlFileReader m)
        {
            var NoteNumber = NoteToNumber[Command.Name];
            var cmd        = Track.AddCommand(CommandType.Note);

            Track.SetLastNote(cmd);
            var ct = m.FetchType();

            if (m.IsNextLine())
            {
                cmd.Value = NoteNumber;
                cmd.Tick  = Track.DefaultTick;
                return;
            }

            var  ch    = m.FetchCharacter();
            bool Shift = false;

            if (ch == '-')
            {
                Shift = true; NoteNumber++;
            }
            if (ch == '+')
            {
                Shift = true; NoteNumber++;
            }
            if (Shift)
            {
                m.StepNextCharacter();
            }

            cmd.Value = NoteNumber;
            var Tick = ReadNoteLength(Track.DefaultTick, Song.MasterTick, m);

            cmd.Tick = Tick;
        }
Example #5
0
        private void Staccato(SongData Song, TrackData Track, Command Command, MmlFileReader m)
        {
            var cmd = Track.AddCommand(CommandType.Staccato);

            cmd.Value = ReadNumber(m);
        }
Example #6
0
        private void Slur(SongData Song, TrackData Track, Command Command, MmlFileReader m)
        {
            var cmd = Track.AddCommand(CommandType.Slur);

            cmd.Value = 1;
        }
Example #7
0
 private void RelativeOctave(SongData Song, TrackData Track, Command Command, MmlFileReader m)
 {
     Track.AddCommand(Command.Name == ">" ? CommandType.OctaveGt : CommandType.OctaveLt);
 }
Example #8
0
 private void Loop(SongData Song, TrackData Track, Command Command, MmlFileReader m)
 {
     Track.AddCommand(CommandType.Loop);
 }
Example #9
0
 private void RepeatStart(SongData Song, TrackData Track, Command Command, MmlFileReader m)
 {
     Track.AddCommand(CommandType.RepeatStart);
 }
Example #10
0
        private void RepeatEnd(SongData Song, TrackData Track, Command Command, MmlFileReader m)
        {
            var cmd = Track.AddCommand(CommandType.RepeatEnd);

            cmd.Value = ReadNumber(m, Required: false);
        }