Example #1
0
 public Note(int offset, int length, LetterName letterName, int octave, int volume)
 {
     this.offset     = offset;
     this.length     = length;
     this.letterName = letterName;
     this.octave     = octave;
     this.volume     = volume;
 }
        /// <summary>
        /// ピッチをrhsと比較する。
        /// </summary>
        /// <param name="rhs"></param>
        /// <returns>
        /// rhsよりも自分のほうが低い: 負
        /// rhsよりも自分のほうが高い: 正
        /// 自分とrhsとが同じピッチ: 0
        /// </returns>
        public int CompareTo(LetterName rhs)
        {
            int me  = ToFreqIndex();
            int you = rhs.ToFreqIndex();

            if (me < you)
            {
                return(-1);
            }
            else if (you < me)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Example #3
0
        public void ExportAsMusicXml(TextWriter w)
        {
            w.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            w.WriteLine("<!DOCTYPE score-partwise PUBLIC \"-//Recordare//DTD MusicXML 2.0 Partwise//EN\"");
            w.WriteLine("    \"http://www.musicxml.org/dtds/partwise.dtd\">");
            w.WriteLine("<score-partwise version=\"2.0\">");
            w.WriteLine("  <part-list>");
            w.WriteLine("    <part-group number=\"1\" type=\"start\">");
            w.WriteLine("      <group-symbol>bracket</group-symbol>");
            w.WriteLine("      <group-barline>yes</group-barline>");
            w.WriteLine("    </part-group>");
            w.WriteLine("    <score-part id=\"P1\">");
            w.WriteLine("      <part-name>Sop</part-name>");
            w.WriteLine("      <part-abbreviation>S</part-abbreviation>");
            w.WriteLine("    </score-part>");
            w.WriteLine("    <score-part id=\"P2\">");
            w.WriteLine("      <part-name>Alt</part-name>");
            w.WriteLine("      <part-abbreviation>A</part-abbreviation>");
            w.WriteLine("    </score-part>");
            w.WriteLine("    <score-part id=\"P3\">");
            w.WriteLine("      <part-name>Ten</part-name>");
            w.WriteLine("      <part-abbreviation>T</part-abbreviation>");
            w.WriteLine("    </score-part>");
            w.WriteLine("    <score-part id=\"P4\">");
            w.WriteLine("      <part-name>Bas</part-name>");
            w.WriteLine("      <part-abbreviation>B</part-abbreviation>");
            w.WriteLine("    </score-part>");
            w.WriteLine("    <part-group number=\"1\" type=\"stop\"/>");
            w.WriteLine("  </part-list>");
            w.WriteLine("  <!--=========================================================-->");

            // Sop
            MXOutputPartHeader(w, "P1", ClefType.G2);
            int duration = 0;
            int measure  = 0;

            foreach (var chord in chordSaves)
            {
                if (duration != 0 && (duration % 16) == 0)
                {
                    ++measure;
                    w.WriteLine("  </measure>");
                    w.WriteLine("  <!--=========================================================-->");
                    w.WriteLine("  <measure number=\"{0}\">", measure);
                }
                var sopNote = new LetterName(chord.sop.letterName);
                w.WriteLine("    <note>");
                w.WriteLine("      <pitch>");
                w.WriteLine("        <step>{0}</step>", sopNote.NaturalLetterName());
                w.WriteLine("        <alter>{0}</alter>", ((int)sopNote.GetKeySigType()) - (int)KeySigType.Natural);
                w.WriteLine("        <octave>{0}</octave>", chord.sop.octave);
                w.WriteLine("      </pitch>");
                w.WriteLine("      <duration>2</duration>");
                w.WriteLine("      <type>half</type>");
                w.WriteLine("    </note>");

                duration += 8;
            }
            MXOutputPartFooter(w);

            w.WriteLine("  <!--=========================================================-->");

            // Alt
            MXOutputPartHeader(w, "P2", ClefType.G2);
            duration = 0;
            measure  = 0;
            foreach (var chord in chordSaves)
            {
                if (duration != 0 && (duration % 16) == 0)
                {
                    ++measure;
                    w.WriteLine("  </measure>");
                    w.WriteLine("  <!--=========================================================-->");
                    w.WriteLine("  <measure number=\"{0}\">", measure);
                }
                var altNote = new LetterName(chord.alt.letterName);
                w.WriteLine("    <note>");
                w.WriteLine("      <pitch>");
                w.WriteLine("        <step>{0}</step>", altNote.NaturalLetterName());
                w.WriteLine("        <alter>{0}</alter>", ((int)altNote.GetKeySigType()) - (int)KeySigType.Natural);
                w.WriteLine("        <octave>{0}</octave>", chord.alt.octave);
                w.WriteLine("      </pitch>");
                w.WriteLine("      <duration>2</duration>");
                w.WriteLine("      <type>half</type>");
                w.WriteLine("    </note>");

                duration += 8;
            }
            MXOutputPartFooter(w);

            w.WriteLine("  <!--=========================================================-->");

            // へ音記号の五線 Ten
            MXOutputPartHeader(w, "P3", ClefType.F4);
            duration = 0;
            measure  = 0;
            foreach (var chord in chordSaves)
            {
                if (duration != 0 && (duration % 16) == 0)
                {
                    ++measure;
                    w.WriteLine("  </measure>");
                    w.WriteLine("  <!--=========================================================-->");
                    w.WriteLine("  <measure number=\"{0}\">", measure);
                }
                // Ten
                var tenNote = new LetterName(chord.ten.letterName);
                w.WriteLine("    <note>");
                w.WriteLine("      <pitch>");
                w.WriteLine("        <step>{0}</step>", tenNote.NaturalLetterName());
                w.WriteLine("        <alter>{0}</alter>", ((int)tenNote.GetKeySigType()) - (int)KeySigType.Natural);
                w.WriteLine("        <octave>{0}</octave>", chord.ten.octave);
                w.WriteLine("      </pitch>");
                w.WriteLine("      <duration>2</duration>");
                w.WriteLine("      <type>half</type>");
                w.WriteLine("    </note>");

                duration += 8;
            }
            MXOutputPartFooter(w);

            w.WriteLine("  <!--=========================================================-->");

            // へ音記号の五線 Bas
            MXOutputPartHeader(w, "P4", ClefType.F4);
            duration = 0;
            measure  = 0;
            foreach (var chord in chordSaves)
            {
                if (duration != 0 && (duration % 16) == 0)
                {
                    ++measure;
                    w.WriteLine("  </measure>");
                    w.WriteLine("  <!--=========================================================-->");
                    w.WriteLine("  <measure number=\"{0}\">", measure);
                }
                // Bas
                var basNote = new LetterName(chord.bas.letterName);
                w.WriteLine("    <note>");
                w.WriteLine("      <pitch>");
                w.WriteLine("        <step>{0}</step>", basNote.NaturalLetterName());
                w.WriteLine("        <alter>{0}</alter>", ((int)basNote.GetKeySigType()) - (int)KeySigType.Natural);
                w.WriteLine("        <octave>{0}</octave>", chord.bas.octave);
                w.WriteLine("      </pitch>");
                w.WriteLine("      <duration>2</duration>");
                w.WriteLine("      <type>half</type>");
                w.WriteLine("    </note>");

                duration += 8;
            }
            MXOutputPartFooter(w);
            w.WriteLine("  <!--=========================================================-->");
            w.WriteLine("</score-partwise>");
        }
Example #4
0
        private readonly int         degree;    //< 音度。1=主音。1~9が音度を表す。0の場合音度情報が無意味。-1の場合無効。

        public LnDeg(LN aLetterName, int aDegree)
        {
            letterName = new LetterName(aLetterName);
            degree     = aDegree;
        }
Example #5
0
 /// <summary>
 /// Cとの「度」(同度==0) 0~6
 /// ただしオクターブは考慮していない
 /// </summary>
 public int NoteDistanceFromC()
 {
     return(LetterName.NoteDistanceFromC());
 }
Example #6
0
 /// <summary>
 /// オクターブを考慮したC-1からの半音の数。
 /// </summary>
 public int GetMidiPitchValue()
 {
     return((octave + 1) * 12 + LetterName.ToFreqIndex());
 }
Example #7
0
 public LN NaturalLetterName()
 {
     return(LetterName.NaturalLetterName());
 }
Example #8
0
        static MusicKeyInfo()
        {
            // 主調と内部調→内属記号の表を作成。
            CreateMainKeyInternalKeyToKeyRelationTable();


            // 音名と旋法→調名
            lnModeKey = new MusicKey[(int)LN.NUM * (int)Mode.NUM];
            for (int i = 0; i < (int)LN.NUM; ++i)
            {
                for (int j = 0; j < (int)Mode.NUM; ++j)
                {
                    lnModeKey[i * (int)Mode.NUM + j] = MusicKey.Invalid;
                }
            }
            lnModeKey[(int)LN.FESES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.FESESdur;
            lnModeKey[(int)LN.FESES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.FESESmoll;
            lnModeKey[(int)LN.CESES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.CESESdur;
            lnModeKey[(int)LN.CESES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.CESESmoll;
            lnModeKey[(int)LN.GESES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.GESESdur;
            lnModeKey[(int)LN.GESES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.GESESmoll;
            lnModeKey[(int)LN.DESES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.DESESdur;
            lnModeKey[(int)LN.DESES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.DESESmoll;
            lnModeKey[(int)LN.ASES * (int)Mode.NUM + (int)Mode.Dur]   = MusicKey.ASESdur;
            lnModeKey[(int)LN.ASES * (int)Mode.NUM + (int)Mode.Moll]  = MusicKey.ASESmoll;
            lnModeKey[(int)LN.ESES * (int)Mode.NUM + (int)Mode.Dur]   = MusicKey.ESESdur;
            lnModeKey[(int)LN.ESES * (int)Mode.NUM + (int)Mode.Moll]  = MusicKey.ESESmoll;
            lnModeKey[(int)LN.HESES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.BESdur;
            lnModeKey[(int)LN.HESES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.BESmoll;

            lnModeKey[(int)LN.FES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.FESdur;
            lnModeKey[(int)LN.FES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.FESmoll;
            lnModeKey[(int)LN.CES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.CESdur;
            lnModeKey[(int)LN.CES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.CESmoll;
            lnModeKey[(int)LN.GES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.GESdur;
            lnModeKey[(int)LN.GES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.GESmoll;
            lnModeKey[(int)LN.DES * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.DESdur;
            lnModeKey[(int)LN.DES * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.DESmoll;
            lnModeKey[(int)LN.AS * (int)Mode.NUM + (int)Mode.Dur]   = MusicKey.ASdur;
            lnModeKey[(int)LN.AS * (int)Mode.NUM + (int)Mode.Moll]  = MusicKey.ASmoll;
            lnModeKey[(int)LN.ES * (int)Mode.NUM + (int)Mode.Dur]   = MusicKey.ESdur;
            lnModeKey[(int)LN.ES * (int)Mode.NUM + (int)Mode.Moll]  = MusicKey.ESmoll;
            lnModeKey[(int)LN.B * (int)Mode.NUM + (int)Mode.Dur]    = MusicKey.Bdur;
            lnModeKey[(int)LN.B * (int)Mode.NUM + (int)Mode.Moll]   = MusicKey.Bmoll;

            lnModeKey[(int)LN.F * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.Fdur;
            lnModeKey[(int)LN.F * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.Fmoll;
            lnModeKey[(int)LN.C * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.Cdur;
            lnModeKey[(int)LN.C * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.Cmoll;
            lnModeKey[(int)LN.G * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.Gdur;
            lnModeKey[(int)LN.G * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.Gmoll;
            lnModeKey[(int)LN.D * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.Ddur;
            lnModeKey[(int)LN.D * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.Dmoll;
            lnModeKey[(int)LN.A * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.Adur;
            lnModeKey[(int)LN.A * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.Amoll;
            lnModeKey[(int)LN.E * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.Edur;
            lnModeKey[(int)LN.E * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.Emoll;
            lnModeKey[(int)LN.H * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.Hdur;
            lnModeKey[(int)LN.H * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.Hmoll;

            lnModeKey[(int)LN.FIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.FISdur;
            lnModeKey[(int)LN.FIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.FISmoll;
            lnModeKey[(int)LN.CIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.CISdur;
            lnModeKey[(int)LN.CIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.CISmoll;
            lnModeKey[(int)LN.GIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.GISdur;
            lnModeKey[(int)LN.GIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.GISmoll;
            lnModeKey[(int)LN.DIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.DISdur;
            lnModeKey[(int)LN.DIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.DISmoll;
            lnModeKey[(int)LN.AIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.AISdur;
            lnModeKey[(int)LN.AIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.AISmoll;
            lnModeKey[(int)LN.EIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.EISdur;
            lnModeKey[(int)LN.EIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.EISmoll;
            lnModeKey[(int)LN.HIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.HISdur;
            lnModeKey[(int)LN.HIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.HISmoll;

            lnModeKey[(int)LN.FISIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.FISISdur;
            lnModeKey[(int)LN.FISIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.FISISmoll;
            lnModeKey[(int)LN.CISIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.CISISdur;
            lnModeKey[(int)LN.CISIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.CISISmoll;
            lnModeKey[(int)LN.GISIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.GISISdur;
            lnModeKey[(int)LN.GISIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.GISISmoll;
            lnModeKey[(int)LN.DISIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.DISISdur;
            lnModeKey[(int)LN.DISIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.DISISmoll;
            lnModeKey[(int)LN.AISIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.AISISdur;
            lnModeKey[(int)LN.AISIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.AISISmoll;
            lnModeKey[(int)LN.EISIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.EISISdur;
            lnModeKey[(int)LN.EISIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.EISISmoll;
            lnModeKey[(int)LN.HISIS * (int)Mode.NUM + (int)Mode.Dur]  = MusicKey.HISISdur;
            lnModeKey[(int)LN.HISIS * (int)Mode.NUM + (int)Mode.Moll] = MusicKey.HISISmoll;

            keyProps = new MusicKeyProperties[(int)MusicKey.NUM];

            //                                                                                     F  S
            keyProps[(int)MusicKey.FESESdur].Init(MusicKey.FESESdur, LN.FESES, "Feses", Mode.Dur, 15, 0);
            keyProps[(int)MusicKey.CESESdur].Init(MusicKey.CESESdur, LN.CESES, "Ceses", Mode.Dur, 14, 0);
            keyProps[(int)MusicKey.GESESdur].Init(MusicKey.GESESdur, LN.GESES, "Geses", Mode.Dur, 13, 0);
            keyProps[(int)MusicKey.DESESdur].Init(MusicKey.DESESdur, LN.DESES, "Deses", Mode.Dur, 12, 0);
            keyProps[(int)MusicKey.ASESdur].Init(MusicKey.ASESdur, LN.ASES, "Ases", Mode.Dur, 11, 0);
            keyProps[(int)MusicKey.ESESdur].Init(MusicKey.ESESdur, LN.ESES, "Eses", Mode.Dur, 10, 0);
            keyProps[(int)MusicKey.BESdur].Init(MusicKey.BESdur, LN.HESES, "Heses", Mode.Dur, 9, 0);

            //                                                                            F  S
            keyProps[(int)MusicKey.FESdur].Init(MusicKey.FESdur, LN.FES, "Fes", Mode.Dur, 8, 0);
            keyProps[(int)MusicKey.CESdur].Init(MusicKey.CESdur, LN.CES, "Ces", Mode.Dur, 7, 0);
            keyProps[(int)MusicKey.GESdur].Init(MusicKey.GESdur, LN.GES, "Ges", Mode.Dur, 6, 0);
            keyProps[(int)MusicKey.DESdur].Init(MusicKey.DESdur, LN.DES, "Des", Mode.Dur, 5, 0);
            keyProps[(int)MusicKey.ASdur].Init(MusicKey.ASdur, LN.AS, "As", Mode.Dur, 4, 0);
            keyProps[(int)MusicKey.ESdur].Init(MusicKey.ESdur, LN.ES, "Es", Mode.Dur, 3, 0);
            keyProps[(int)MusicKey.Bdur].Init(MusicKey.Bdur, LN.B, "B", Mode.Dur, 2, 0);

            //                                                                    F  S
            keyProps[(int)MusicKey.Fdur].Init(MusicKey.Fdur, LN.F, "F", Mode.Dur, 1, 0);
            keyProps[(int)MusicKey.Cdur].Init(MusicKey.Cdur, LN.C, "C", Mode.Dur, 0, 0);
            keyProps[(int)MusicKey.Gdur].Init(MusicKey.Gdur, LN.G, "G", Mode.Dur, 0, 1);
            keyProps[(int)MusicKey.Ddur].Init(MusicKey.Ddur, LN.D, "D", Mode.Dur, 0, 2);
            keyProps[(int)MusicKey.Adur].Init(MusicKey.Adur, LN.A, "A", Mode.Dur, 0, 3);
            keyProps[(int)MusicKey.Edur].Init(MusicKey.Edur, LN.E, "E", Mode.Dur, 0, 4);
            keyProps[(int)MusicKey.Hdur].Init(MusicKey.Hdur, LN.H, "H", Mode.Dur, 0, 5);

            //                                                                            F  S
            keyProps[(int)MusicKey.FISdur].Init(MusicKey.FISdur, LN.FIS, "Fis", Mode.Dur, 0, 6);
            keyProps[(int)MusicKey.CISdur].Init(MusicKey.CISdur, LN.CIS, "Cis", Mode.Dur, 0, 7);
            keyProps[(int)MusicKey.GISdur].Init(MusicKey.GISdur, LN.GIS, "Gis", Mode.Dur, 0, 8);
            keyProps[(int)MusicKey.DISdur].Init(MusicKey.DISdur, LN.DIS, "Dis", Mode.Dur, 0, 9);
            keyProps[(int)MusicKey.AISdur].Init(MusicKey.AISdur, LN.AIS, "Ais", Mode.Dur, 0, 10);
            keyProps[(int)MusicKey.EISdur].Init(MusicKey.EISdur, LN.EIS, "Eis", Mode.Dur, 0, 11);
            keyProps[(int)MusicKey.HISdur].Init(MusicKey.HISdur, LN.HIS, "His", Mode.Dur, 0, 12);

            //                                                                                    F  S
            keyProps[(int)MusicKey.FISISdur].Init(MusicKey.FISISdur, LN.FISIS, "Fisis", Mode.Dur, 0, 13);
            keyProps[(int)MusicKey.CISISdur].Init(MusicKey.CISISdur, LN.CISIS, "Cisis", Mode.Dur, 0, 14);
            keyProps[(int)MusicKey.GISISdur].Init(MusicKey.GISISdur, LN.GISIS, "Gisis", Mode.Dur, 0, 15);
            keyProps[(int)MusicKey.DISISdur].Init(MusicKey.DISISdur, LN.DISIS, "Disis", Mode.Dur, 0, 16);
            keyProps[(int)MusicKey.AISISdur].Init(MusicKey.AISISdur, LN.AISIS, "Aisis", Mode.Dur, 0, 17);
            keyProps[(int)MusicKey.EISISdur].Init(MusicKey.EISISdur, LN.EISIS, "Eisis", Mode.Dur, 0, 18);
            keyProps[(int)MusicKey.HISISdur].Init(MusicKey.HISISdur, LN.HISIS, "Hisis", Mode.Dur, 0, 19);

            //                                                                                        F  S
            keyProps[(int)MusicKey.FESESmoll].Init(MusicKey.FESESmoll, LN.FESES, "feses", Mode.Moll, 18, 0);
            keyProps[(int)MusicKey.CESESmoll].Init(MusicKey.CESESmoll, LN.CESES, "ceses", Mode.Moll, 17, 0);
            keyProps[(int)MusicKey.GESESmoll].Init(MusicKey.GESESmoll, LN.GESES, "geses", Mode.Moll, 16, 0);
            keyProps[(int)MusicKey.DESESmoll].Init(MusicKey.DESESmoll, LN.DESES, "deses", Mode.Moll, 15, 0);
            keyProps[(int)MusicKey.ASESmoll].Init(MusicKey.ASESmoll, LN.ASES, "ases", Mode.Moll, 14, 0);
            keyProps[(int)MusicKey.ESESmoll].Init(MusicKey.ESESmoll, LN.ESES, "eses", Mode.Moll, 13, 0);
            keyProps[(int)MusicKey.BESmoll].Init(MusicKey.BESmoll, LN.HESES, "heses", Mode.Moll, 12, 0);

            //                                                                                F  S
            keyProps[(int)MusicKey.FESmoll].Init(MusicKey.FESmoll, LN.FES, "fes", Mode.Moll, 11, 0);
            keyProps[(int)MusicKey.CESmoll].Init(MusicKey.CESmoll, LN.CES, "ces", Mode.Moll, 10, 0);
            keyProps[(int)MusicKey.GESmoll].Init(MusicKey.GESmoll, LN.GES, "ges", Mode.Moll, 9, 0);
            keyProps[(int)MusicKey.DESmoll].Init(MusicKey.DESmoll, LN.DES, "des", Mode.Moll, 8, 0);
            keyProps[(int)MusicKey.ASmoll].Init(MusicKey.ASmoll, LN.AS, "as", Mode.Moll, 7, 0);
            keyProps[(int)MusicKey.ESmoll].Init(MusicKey.ESmoll, LN.ES, "es", Mode.Moll, 6, 0);
            keyProps[(int)MusicKey.Bmoll].Init(MusicKey.Bmoll, LN.B, "b", Mode.Moll, 5, 0);

            //                                                                       F  S
            keyProps[(int)MusicKey.Fmoll].Init(MusicKey.Fmoll, LN.F, "f", Mode.Moll, 4, 0);
            keyProps[(int)MusicKey.Cmoll].Init(MusicKey.Cmoll, LN.C, "c", Mode.Moll, 3, 0);
            keyProps[(int)MusicKey.Gmoll].Init(MusicKey.Gmoll, LN.G, "g", Mode.Moll, 2, 0);
            keyProps[(int)MusicKey.Dmoll].Init(MusicKey.Dmoll, LN.D, "d", Mode.Moll, 1, 0);
            keyProps[(int)MusicKey.Amoll].Init(MusicKey.Amoll, LN.A, "a", Mode.Moll, 0, 0);
            keyProps[(int)MusicKey.Emoll].Init(MusicKey.Emoll, LN.E, "e", Mode.Moll, 0, 1);
            keyProps[(int)MusicKey.Hmoll].Init(MusicKey.Hmoll, LN.H, "h", Mode.Moll, 0, 2);

            //                                                                               F  S
            keyProps[(int)MusicKey.FISmoll].Init(MusicKey.FISmoll, LN.FIS, "fis", Mode.Moll, 0, 3);
            keyProps[(int)MusicKey.CISmoll].Init(MusicKey.CISmoll, LN.CIS, "cis", Mode.Moll, 0, 4);
            keyProps[(int)MusicKey.GISmoll].Init(MusicKey.GISmoll, LN.GIS, "gis", Mode.Moll, 0, 5);
            keyProps[(int)MusicKey.DISmoll].Init(MusicKey.DISmoll, LN.DIS, "dis", Mode.Moll, 0, 6);
            keyProps[(int)MusicKey.AISmoll].Init(MusicKey.AISmoll, LN.AIS, "ais", Mode.Moll, 0, 7);
            keyProps[(int)MusicKey.EISmoll].Init(MusicKey.EISmoll, LN.EIS, "eis", Mode.Moll, 0, 8);
            keyProps[(int)MusicKey.HISmoll].Init(MusicKey.HISmoll, LN.HIS, "his", Mode.Moll, 0, 9);

            //                                                                                       F  S
            keyProps[(int)MusicKey.FISISmoll].Init(MusicKey.FISISmoll, LN.FISIS, "fisis", Mode.Moll, 0, 10);
            keyProps[(int)MusicKey.CISISmoll].Init(MusicKey.CISISmoll, LN.CISIS, "cisis", Mode.Moll, 0, 11);
            keyProps[(int)MusicKey.GISISmoll].Init(MusicKey.GISISmoll, LN.GISIS, "gisis", Mode.Moll, 0, 12);
            keyProps[(int)MusicKey.DISISmoll].Init(MusicKey.DISISmoll, LN.DISIS, "disis", Mode.Moll, 0, 13);
            keyProps[(int)MusicKey.AISISmoll].Init(MusicKey.AISISmoll, LN.AISIS, "aisis", Mode.Moll, 0, 14);
            keyProps[(int)MusicKey.EISISmoll].Init(MusicKey.EISISmoll, LN.EISIS, "eisis", Mode.Moll, 0, 15);
            keyProps[(int)MusicKey.HISISmoll].Init(MusicKey.HISISmoll, LN.HISIS, "hisis", Mode.Moll, 0, 16);

            // I~VIIの各音度、固有和音調。
            for (int i = (int)MusicKey.FESESdur; i <= (int)MusicKey.HISISdur; ++i)
            {
                MusicKeyProperties prop = keyProps[i];
                LetterName         l1, l2, l3, l4, l5, l6, l7;
                l1 = new LetterName(prop.GetFirstDegreeLN());
                l2 = l1.NextSemi2();
                l3 = l2.NextSemi2();
                l4 = l3.NextSemi1();
                l5 = l4.NextSemi2();
                l6 = l5.NextSemi2();
                l7 = l6.NextSemi2();
                keyProps[i].SetLnList(l2.LN, l3.LN, l4.LN, l5.LN, l6.LN, l7.LN);

                MusicKey k2, k3, k4, k5, k6;
                k2 = lnModeKey[(int)l2.LN * (int)Mode.NUM + (int)Mode.Moll];
                k3 = lnModeKey[(int)l3.LN * (int)Mode.NUM + (int)Mode.Moll];
                k4 = lnModeKey[(int)l4.LN * (int)Mode.NUM + (int)Mode.Dur];
                k5 = lnModeKey[(int)l5.LN * (int)Mode.NUM + (int)Mode.Dur];
                k6 = lnModeKey[(int)l6.LN * (int)Mode.NUM + (int)Mode.Moll];
                keyProps[i].SetRelatedKeys(k2, k3, k4, k5, k6, MusicKey.Invalid);

                MusicKey p1, p3, p4, p5, p6, p7;
                p1 = lnModeKey[(int)l1.LN * (int)Mode.NUM + (int)Mode.Moll];
                p3 = lnModeKey[(int)l3.LN * (int)Mode.NUM + (int)Mode.Dur];
                p4 = lnModeKey[(int)l4.LN * (int)Mode.NUM + (int)Mode.Moll];
                p5 = lnModeKey[(int)l5.LN * (int)Mode.NUM + (int)Mode.Moll];
                p6 = lnModeKey[(int)l6.LN * (int)Mode.NUM + (int)Mode.Dur];
                p7 = lnModeKey[(int)l6.LN * (int)Mode.NUM + (int)Mode.Dur];
                keyProps[i].SetParallelRelatedKeys(p1, MusicKey.Invalid, p3, p4, p5, p6, p7);
            }

            for (int i = (int)MusicKey.FESESmoll; i <= (int)MusicKey.HISISmoll; ++i)
            {
                MusicKeyProperties prop = keyProps[i];
                LetterName         l1, l2, l3, l4, l5, l6, l7;
                l1 = new LetterName(prop.GetFirstDegreeLN());
                l2 = l1.NextSemi2();
                l3 = l2.NextSemi1();
                l4 = l3.NextSemi2();
                l5 = l4.NextSemi2();
                l6 = l5.NextSemi1();
                l7 = l6.NextSemi2();
                keyProps[i].SetLnList(l2.LN, l3.LN, l4.LN, l5.LN, l6.LN, l7.LN);

                MusicKey p3, p4, p5, p6, p7;
                p3 = lnModeKey[(int)l3.LN * (int)Mode.NUM + (int)Mode.Dur];
                p4 = lnModeKey[(int)l4.LN * (int)Mode.NUM + (int)Mode.Moll];
                p5 = lnModeKey[(int)l5.LN * (int)Mode.NUM + (int)Mode.Moll];
                p6 = lnModeKey[(int)l6.LN * (int)Mode.NUM + (int)Mode.Dur];
                p7 = lnModeKey[(int)l6.LN * (int)Mode.NUM + (int)Mode.Dur];
                keyProps[i].SetRelatedKeys(MusicKey.Invalid, p3, p4, p5, p6, p7);

                MusicKey k1, k2, k3, k4, k5, k6;
                k1 = lnModeKey[(int)l1.LN * (int)Mode.NUM + (int)Mode.Dur];
                k2 = lnModeKey[(int)l2.LN * (int)Mode.NUM + (int)Mode.Moll];
                k3 = lnModeKey[(int)l3.LN * (int)Mode.NUM + (int)Mode.Moll];
                k4 = lnModeKey[(int)l4.LN * (int)Mode.NUM + (int)Mode.Dur];
                k5 = lnModeKey[(int)l5.LN * (int)Mode.NUM + (int)Mode.Dur];
                k6 = lnModeKey[(int)l6.LN * (int)Mode.NUM + (int)Mode.Moll];
                keyProps[i].SetParallelRelatedKeys(k1, k2, k3, k4, k5, k6, MusicKey.Invalid);
            }
        }