Beispiel #1
0
        public static void Reader(string Path, Option @Option)
        {
            var Buffer = ReadByte(Path);

            if (Buffer.Length == FxbLength() && IsValid(Buffer))
            {
                Tone vTone = new Tone();

                var BufferMuc     = "";
                var BufferDat     = Dat.New();
                var BufferFmp     = "";
                var BufferPmd     = "";
                var BufferFMtrial = FMtrial.New();

                for (int i = 0; i < ToneLength(); ++i)
                {
                    Get(ref vTone, Buffer, i);

                    if (Option.bMuc)
                    {
                        Muc.Put(vTone, ref BufferMuc);
                    }
                    if (Option.bDat)
                    {
                        Dat.Put(vTone, ref BufferDat);
                    }
                    if (Option.bFmp)
                    {
                        Fmp.Put(vTone, ref BufferFmp);
                    }
                    if (Option.bPmd)
                    {
                        Pmd.Put(vTone, ref BufferPmd);
                    }
                    if (Option.bFMtrial)
                    {
                        FMtrial.Put(vTone, ref BufferFMtrial);
                    }
                }

                if (Option.bMuc)
                {
                    Muc.Writer(Path, BufferMuc);
                }
                if (Option.bDat)
                {
                    Dat.Writer(Path, BufferDat);
                }
                if (Option.bFmp)
                {
                    Fmp.Writer(Path, BufferFmp);
                }
                if (Option.bPmd)
                {
                    Pmd.Writer(Path, BufferPmd);
                }
                if (Option.bFMtrial)
                {
                    FMtrial.Writer(Path, BufferFMtrial);
                }
            }
        }
Beispiel #2
0
        public static void Reader(string Path, Option @Option)
        {
            var  vTone        = new Tone();
            bool bLineComment = false;

            var BufferMuc     = "";
            var BufferDat     = Dat.New();
            var BufferFmp     = "";
            var BufferVopm    = Vopm.New();
            var BufferFMtrial = FMtrial.New();

            var State = eState.Entry;
            var aLine = ReadLine(Path);

            foreach (var Line in aLine)
            {
                if (String.IsNullOrWhiteSpace(Line))
                {
                    continue;
                }

                var bLine = (Line[0] == '`');
                if (bLine)
                {
                    bLineComment = !bLineComment;
                    continue;
                }
                if (bLineComment)
                {
                    continue;
                }

                var bPartCommnet = false;
                var bTailCommnet = false;
                var aChar        = Line.ToCharArray();
                var oChar        = 0;
                foreach (var Char in aChar)
                {
                    if (bTailCommnet)
                    {
                        aChar[oChar] = ' ';
                    }

                    var bPart = (Char == '`');
                    if (bPartCommnet)
                    {
                        aChar[oChar] = ' ';
                    }
                    if (bPart)
                    {
                        bPartCommnet = !bPartCommnet;
                    }
                    if (bPartCommnet)
                    {
                        aChar[oChar] = ' ';
                    }

                    if (Char == ';')
                    {
                        bTailCommnet = true;
                    }
                    if (bTailCommnet)
                    {
                        aChar[oChar] = ' ';
                    }
                    ++oChar;
                }
                var Text = new string(aChar);
                if (String.IsNullOrEmpty(Text.Trim(' ')))
                {
                    continue;
                }

                switch (State)
                {
                case eState.Entry:
                {
                    if (Text[0] == ' ' || Text[0] == '\t')
                    {
                        continue;
                    }

                    var bHead = Text.StartsWith("@");
                    var oName = Text.IndexOf('=');
                    if (bHead)
                    {
                        var aTok = Text.Split(new char[] { ' ', '\t', '=', }, StringSplitOptions.RemoveEmptyEntries);
                        if (aTok.Length >= 3)
                        {
                            aTok[0] = aTok[0].Substring(1);

                            int.TryParse(aTok[0], out vTone.Number);
                            int.TryParse(aTok[1], out vTone.AL);
                            int.TryParse(aTok[2], out vTone.FB);
                            vTone.Name = (aTok.Length >= 4 && oName > 0) ? aTok[3] : "";
                            State      = eState.Op0;
                            break;
                        }
                    }
                    break;
                }

                case eState.Op0:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= 10)
                    {
                        GetOp(aTok, ref vTone.aOp[0]);
                        State = eState.Op1;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op1:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= 10)
                    {
                        GetOp(aTok, ref vTone.aOp[1]);
                        State = eState.Op2;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op2:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= 10)
                    {
                        GetOp(aTok, ref vTone.aOp[2]);
                        State = eState.Op3;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op3:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= 10)
                    {
                        GetOp(aTok, ref vTone.aOp[3]);

                        if (Option.bMuc)
                        {
                            Muc.Put(vTone, ref BufferMuc);
                        }
                        if (Option.bDat)
                        {
                            Dat.Put(vTone, ref BufferDat);
                        }
                        if (Option.bFmp)
                        {
                            Fmp.Put(vTone, ref BufferFmp);
                        }
                        if (Option.bVopm)
                        {
                            Vopm.Put(vTone, ref BufferVopm);
                        }
                        if (Option.bFMtrial)
                        {
                            FMtrial.Put(vTone, ref BufferFMtrial);
                        }
                    }
                    State = eState.Entry;
                    break;
                }
                }
            }

            if (Option.bMuc)
            {
                Muc.Writer(Path, BufferMuc);
            }
            if (Option.bDat)
            {
                Dat.Writer(Path, BufferDat);
            }
            if (Option.bFmp)
            {
                Fmp.Writer(Path, BufferFmp);
            }
            if (Option.bVopm)
            {
                Vopm.Writer(Path, BufferVopm);
            }
            if (Option.bFMtrial)
            {
                FMtrial.Writer(Path, BufferFMtrial);
            }
        }
Beispiel #3
0
        public static IEnumerable <Tone> Reader(string Path, Option @Option)
        {
            List <Tone> tones = new List <Tone>();

            var vTone = new Tone();
            int nTok  = 0;

            var BufferMuc  = "";
            var BufferDat  = Dat.New();
            var BufferPmd  = "";
            var BufferVopm = Vopm.New();

            var State = eState.Entry;
            var aLine = ReadLine(Path);

            foreach (var Line in aLine)
            {
                if (String.IsNullOrWhiteSpace(Line))
                {
                    continue;
                }
                if (Line[0] != '\'')
                {
                    continue;
                }

                var bPartCommnet = false;
                var aChar        = Line.ToCharArray();
                var oChar        = 0;
                foreach (var Char in aChar)
                {
                    var bPart = (Char == ';');
                    if (bPartCommnet)
                    {
                        aChar[oChar] = ' ';
                    }
                    if (bPart)
                    {
                        bPartCommnet = !bPartCommnet;
                    }
                    if (bPartCommnet)
                    {
                        aChar[oChar] = ' ';
                    }
                    ++oChar;
                }
                var Text = new string(aChar);

                switch (State)
                {
                case eState.Entry:
                {
                    var bHead = Text.StartsWith("'@");
                    if (bHead)
                    {
                        nTok = 9;
                        var oSub = 0;
                        Text = Text.Substring(2).Trim();
                        if (Text.StartsWith("F"))
                        {
                            nTok = 9; oSub = 1;
                        }
                        if (Text.StartsWith("FA"))
                        {
                            nTok = 10; oSub = 2;
                        }
                        if (Text.StartsWith("FC"))
                        {
                            nTok = 11; oSub = 2;
                        }
                        Text = Text.Substring(oSub);

                        var aTok = Text.Split(new char[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
                        if (aTok.Length >= 1)
                        {
                            int.TryParse(aTok[0], out vTone.Number);
                            State = eState.Op0;
                            break;
                        }
                    }
                    break;
                }

                case eState.Op0:
                {
                    var bHead = Text.StartsWith("'@");
                    if (bHead)
                    {
                        Text = Text.Substring(2);
                        var aTok = Text.Split(new char[] { ' ', '\t', ',' }, StringSplitOptions.RemoveEmptyEntries);
                        if (aTok.Length >= nTok)
                        {
                            GetOp(aTok, ref vTone.aOp[0], nTok);
                            State = eState.Op1;
                            break;
                        }
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op1:
                {
                    var bHead = Text.StartsWith("'@");
                    if (bHead)
                    {
                        Text = Text.Substring(2);
                        var aTok = Text.Split(new char[] { ' ', '\t', ',' }, StringSplitOptions.RemoveEmptyEntries);
                        if (aTok.Length >= nTok)
                        {
                            GetOp(aTok, ref vTone.aOp[1], nTok);
                            State = eState.Op2;
                            break;
                        }
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op2:
                {
                    var bHead = Text.StartsWith("'@");
                    if (bHead)
                    {
                        Text = Text.Substring(2);
                        var aTok = Text.Split(new char[] { ' ', '\t', ',' }, StringSplitOptions.RemoveEmptyEntries);
                        if (aTok.Length >= nTok)
                        {
                            GetOp(aTok, ref vTone.aOp[2], nTok);
                            State = eState.Op3;
                            break;
                        }
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op3:
                {
                    var bHead = Text.StartsWith("'@");
                    if (bHead)
                    {
                        Text = Text.Substring(2);
                        var aTok = Text.Split(new char[] { ' ', '\t', ',' }, StringSplitOptions.RemoveEmptyEntries);
                        if (aTok.Length >= nTok)
                        {
                            GetOp(aTok, ref vTone.aOp[3], nTok);
                            State = eState.Header;
                            break;
                        }
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Header:
                {
                    var bHead = Text.StartsWith("'@");
                    if (bHead)
                    {
                        Text = Text.Substring(2);
                        var aTok = Text.Split(new char[] { ' ', '\t', ',' }, StringSplitOptions.RemoveEmptyEntries);
                        if (aTok.Length >= 2)
                        {
                            int.TryParse(aTok[0], out vTone.AL);
                            int.TryParse(aTok[1], out vTone.FB);
                            vTone.Name = "";

                            if (Option.bMuc)
                            {
                                Muc.Put(vTone, ref BufferMuc);
                            }
                            if (Option.bDat)
                            {
                                Dat.Put(vTone, ref BufferDat);
                            }
                            if (Option.bPmd)
                            {
                                Pmd.Put(vTone, ref BufferPmd);
                            }
                            if (Option.bVopm)
                            {
                                Vopm.Put(vTone, ref BufferVopm);
                            }

                            if (vTone.IsValid())
                            {
                                tones.Add(new Tone(vTone));
                            }
                        }
                    }
                    State = eState.Entry;
                    break;
                }
                }
            }

            if (Option.bMuc)
            {
                Muc.Writer(Path, BufferMuc);
            }
            if (Option.bDat)
            {
                Dat.Writer(Path, BufferDat);
            }
            if (Option.bPmd)
            {
                Pmd.Writer(Path, BufferPmd);
            }
            if (Option.bVopm)
            {
                Vopm.Writer(Path, BufferVopm);
            }

            return(tones);
        }
Beispiel #4
0
        static IEnumerable <Tone> Reader(string Path, Option @Option)
        {
            List <Tone> tones = new List <Tone>();

            var vTone = new Tone();
            var Type  = eType.Mucom;
            var nTok  = 0;

            var BufferDat  = Dat.New();
            var BufferFmp  = "";
            var BufferPmd  = "";
            var BufferVopm = Vopm.New();

            var State = eState.Entry;
            var aLine = ReadLine(Path);

            foreach (var Line in aLine)
            {
                if (String.IsNullOrWhiteSpace(Line))
                {
                    continue;
                }
                if (Line[0] == '\'')
                {
                    continue;
                }

                var oMark = Line.IndexOf(';');
                var Text  = (oMark >= 0)? Line.Remove(oMark): Line;

                switch (State)
                {
                case eState.Entry:
                {
                    Text = Text.Trim();

                    var bHead = Text.StartsWith("@");
                    var bTail = Text.EndsWith(":{");
                    if (bHead)
                    {
                        vTone.Number++;

                        Type = (bTail) ? eType.Mucom : eType.Mmldrv;
                        nTok = (bTail) ? 9 : 11;

                        var aTok = Text.Split(new char[] { ' ', '\t', '@', ':', '{', }, StringSplitOptions.RemoveEmptyEntries);
                        if (aTok.Length >= 1)
                        {
                            int Number;
                            if (int.TryParse(aTok[0], out Number))
                            {
                                vTone.Number = Number;
                            }
                        }
                        State = eState.Header;
                        break;
                    }
                    break;
                }

                case eState.Header:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= 2)
                    {
                        switch (Type)
                        {
                        case eType.Mucom:
                        {
                            int.TryParse(aTok[0], out vTone.FB);
                            int.TryParse(aTok[1], out vTone.AL);
                            break;
                        }

                        case eType.Mmldrv:
                        {
                            int.TryParse(aTok[0], out vTone.AL);
                            int.TryParse(aTok[1], out vTone.FB);
                            break;
                        }
                        }
                        State = eState.Op0;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op0:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= nTok)
                    {
                        GetOp(aTok, ref vTone.aOp[0], Type);
                        State = eState.Op1;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op1:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= nTok)
                    {
                        GetOp(aTok, ref vTone.aOp[1], Type);
                        State = eState.Op2;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op2:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= nTok)
                    {
                        GetOp(aTok, ref vTone.aOp[2], Type);
                        State = eState.Op3;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op3:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    switch (Type)
                    {
                    case eType.Mucom:
                    {
                        if (aTok.Length >= (nTok + 1))
                        {
                            GetOp(aTok, ref vTone.aOp[3], Type);

                            var Tok = "";
                            for (int o = nTok; o < aTok.Length; ++o)
                            {
                                Tok += aTok[o];
                            }

                            var oHead = Tok.IndexOf('\"');
                            var oTail = Tok.IndexOf('\"', oHead + 1);
                            var bTerm = Tok.EndsWith("}");
                            if (oHead >= 0 && oTail >= 0 && bTerm)
                            {
                                vTone.Name = Tok.Substring(oHead + 1, oTail - oHead - 1);

                                if (Option.bDat)
                                {
                                    Dat.Put(vTone, ref BufferDat);
                                }
                                if (Option.bFmp)
                                {
                                    Fmp.Put(vTone, ref BufferFmp);
                                }
                                if (Option.bPmd)
                                {
                                    Pmd.Put(vTone, ref BufferPmd);
                                }
                                if (Option.bVopm)
                                {
                                    Vopm.Put(vTone, ref BufferVopm);
                                }

                                if (vTone.IsValid())
                                {
                                    tones.Add(new Tone(vTone));
                                }
                            }
                        }
                        break;
                    }

                    case eType.Mmldrv:
                    {
                        if (aTok.Length >= nTok)
                        {
                            GetOp(aTok, ref vTone.aOp[3], Type);

                            vTone.Name = "";

                            if (Option.bDat)
                            {
                                Dat.Put(vTone, ref BufferDat);
                            }
                            if (Option.bFmp)
                            {
                                Fmp.Put(vTone, ref BufferFmp);
                            }
                            if (Option.bPmd)
                            {
                                Pmd.Put(vTone, ref BufferPmd);
                            }
                            if (Option.bVopm)
                            {
                                Vopm.Put(vTone, ref BufferVopm);
                            }

                            if (vTone.IsValid())
                            {
                                tones.Add(new Tone(vTone));
                            }
                        }
                        break;
                    }
                    }
                    State = eState.Entry;
                    break;
                }
                }
            }

            if (Option.bDat)
            {
                Dat.Writer(Path, BufferDat);
            }
            if (Option.bFmp)
            {
                Fmp.Writer(Path, BufferFmp);
            }
            if (Option.bPmd)
            {
                Pmd.Writer(Path, BufferPmd);
            }
            if (Option.bVopm)
            {
                Vopm.Writer(Path, BufferVopm);
            }

            return(tones);
        }
Beispiel #5
0
        static IEnumerable <Tone> Reader(string Path, Option @Option)
        {
            List <Tone> tones = new List <Tone>();

            var vTone = new Tone();
            var Type  = eType.FM;
            var nTok  = 0;

            var BufferDat  = Dat.New();
            var BufferFmp  = "";
            var BufferPmd  = "";
            var BufferVopm = Vopm.New();

            var State = eState.Entry;
            var aLine = ReadLine(Path);

            foreach (var Line in aLine)
            {
                if (String.IsNullOrWhiteSpace(Line))
                {
                    continue;
                }
                if (Line[0] != '\'')
                {
                    continue;
                }

                var oMark = Line.IndexOf(';');
                var Text  = (oMark >= 0) ? Line.Remove(oMark) : Line;

                switch (State)
                {
                case eState.Entry:
                {
                    Text = Text.Trim();

                    var bHead = Text.StartsWith("'@ ");
                    if (bHead)
                    {
                        List <string> list = new List <string>();
                        foreach (Match match in headerSplit.Matches(Text))
                        {
                            var curr = match.Value;
                            if (curr.Length != 0)
                            {
                                list.Add(curr.TrimStart(',').Trim());
                            }
                        }
                        var aTok = list.ToArray();

                        if (aTok.Length >= 3)
                        {
                            switch (aTok[1])
                            {
                            case "F":
                                Type = eType.FM;
                                break;

                            case "N":
                                Type = eType.OPN;
                                break;

                            case "M":
                                Type = eType.OPM;
                                break;

                            case "LL":
                                Type = eType.OPLL;
                                break;

                            case "L":
                                Type = eType.OPL3_2;
                                break;

                            case "L4":
                                Type = eType.OPL3_4;
                                break;
                            }

                            //No
                            int Number;
                            if (int.TryParse(aTok[2], out Number))
                            {
                                vTone.Number = Number;
                            }

                            //Name
                            if (aTok.Length >= 4)
                            {
                                vTone.Name = aTok[3].Trim('"');
                            }
                            else
                            {
                                vTone.Name = null;
                            }
                        }
                        State = eState.Header;
                        break;
                    }
                    break;
                }

                case eState.Header:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= nTok)
                    {
                        GetOp(aTok, ref vTone.aOp[0], Type);
                        State = eState.Op0;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op0:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= nTok)
                    {
                        GetOp(aTok, ref vTone.aOp[1], Type);
                        if (Type == eType.OPLL || Type == eType.OPL3_2)
                        {
                            State = eState.Op3;
                        }
                        else
                        {
                            State = eState.Op1;
                        }
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op1:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= nTok)
                    {
                        GetOp(aTok, ref vTone.aOp[2], Type);
                        State = eState.Op2;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op2:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    if (aTok.Length >= nTok)
                    {
                        GetOp(aTok, ref vTone.aOp[3], Type);
                        State = eState.Op3;
                        break;
                    }
                    State = eState.Entry;
                    break;
                }

                case eState.Op3:
                {
                    var aTok = Text.Split(new char[] { ' ', '\t', ',', }, StringSplitOptions.RemoveEmptyEntries);
                    switch (Type)
                    {
                    case eType.FM:
                    case eType.OPN:
                    case eType.OPM:
                    {
                        if (aTok.Length >= 3)
                        {
                            int.TryParse(aTok[1], out vTone.AL);
                            int.TryParse(aTok[2], out vTone.FB);

                            if (vTone.IsValid())
                            {
                                tones.Add(new Tone(vTone));
                            }
                        }
                        break;
                    }

                    case eType.OPLL:
                    {
                        if (aTok.Length >= 3)
                        {
                            int.TryParse(aTok[1], out vTone.aOp[0].TL);
                            vTone.aOp[0].TL *= 2;
                            int.TryParse(aTok[2], out vTone.FB);

                            if (vTone.IsValid2Op())
                            {
                                tones.Add(new Tone(vTone));
                            }
                        }
                        break;
                    }

                    case eType.OPL3_2:
                    {
                        if (aTok.Length >= 3)
                        {
                            int.TryParse(aTok[1], out vTone.CNT);
                            int.TryParse(aTok[2], out vTone.FB);

                            if (vTone.IsValid2Op())
                            {
                                tones.Add(new Tone(vTone));
                            }
                        }
                        break;
                    }

                    case eType.OPL3_4:
                    {
                        if (aTok.Length >= 3)
                        {
                            int cnt1, cnt2;
                            int.TryParse(aTok[1], out cnt1);
                            int.TryParse(aTok[2], out cnt2);
                            vTone.CNT = ((cnt2 << 1) | cnt1) + 2;
                            int.TryParse(aTok[3], out vTone.FB);

                            if (vTone.IsValid())
                            {
                                tones.Add(new Tone(vTone));
                            }
                        }
                        break;
                    }
                    }

                    State = eState.Entry;
                    break;
                }
                }
            }

            if (Option.bDat)
            {
                Dat.Writer(Path, BufferDat);
            }
            if (Option.bFmp)
            {
                Fmp.Writer(Path, BufferFmp);
            }
            if (Option.bPmd)
            {
                Pmd.Writer(Path, BufferPmd);
            }
            if (Option.bVopm)
            {
                Vopm.Writer(Path, BufferVopm);
            }

            return(tones);
        }
Beispiel #6
0
        public static IEnumerable <Tone> Reader(string Path, Option @Option)
        {
            List <Tone> tones = new List <Tone>();

            var Buffer = ReadByte(Path);

            if (Buffer.Length == FxbLength())
            {
                Tone vTone = new Tone();

                var BufferMuc = "";
                var BufferDat = Dat.New();
                var BufferFmp = "";
                var BufferPmd = "";

                for (int i = 0; i < ToneLength(); ++i)
                {
                    Get(ref vTone, Buffer, i);

                    if (Option.bMuc)
                    {
                        Muc.Put(vTone, ref BufferMuc);
                    }
                    if (Option.bDat)
                    {
                        Dat.Put(vTone, ref BufferDat);
                    }
                    if (Option.bFmp)
                    {
                        Fmp.Put(vTone, ref BufferFmp);
                    }
                    if (Option.bPmd)
                    {
                        Pmd.Put(vTone, ref BufferPmd);
                    }

                    if (vTone.IsValid())
                    {
                        tones.Add(new Tone(vTone));
                    }
                }

                if (Option.bMuc)
                {
                    Muc.Writer(Path, BufferMuc);
                }
                if (Option.bDat)
                {
                    Dat.Writer(Path, BufferDat);
                }
                if (Option.bFmp)
                {
                    Fmp.Writer(Path, BufferFmp);
                }
                if (Option.bPmd)
                {
                    Pmd.Writer(Path, BufferPmd);
                }
            }

            return(tones);
        }