コード例 #1
0
        private static void DumpScores(StreamWriter xsw, int showcount, clsKey mkey, clsMTime.clsBBT bbt,
                                       List <clsScore> ret, string inchordstr)
        {
            //int ShowCount = 9;
            if (showcount < 0)
            {
                showcount = int.MaxValue;
            }
            xsw.WriteLine(""); //delimit bbt entries
            if (bbt != null)
            {
                xsw.WriteLine("BBT: " + bbt.ToString());
            }
            xsw.WriteLine("InChord: " + inchordstr);
            xsw.WriteLine("Key: " + mkey.KeyStrLong);
            xsw.WriteLine("MaxType: " + MaxType);
            xsw.WriteLine("MaxNotes: " + MaxNotes);

            //* print header
            xsw.WriteLine(Fmt, "Agg", "Scr", "RKD", "Typ", "Len", "Chr", "TI", "RT", "Name", "Notes");
            if (indFlush)
            {
                xsw.Flush();
            }

            for (int i = 0; i < showcount && i < ret.Count; i++)
            {
                clsScore sc = ret[i];
                //foreach (clsScore sc in ret) {
                xsw.Write(Fmt,
                          sc.Agg,
                          sc.Score,
                          sc.COFRootKeyDistance,
                          //Templates[sc.TIndex].Rank,
                          //Templates[sc.TIndex].Length,
                          FileSeqToTemplate[sc.TIndex].Rank,
                          FileSeqToTemplate[sc.TIndex].Length,
                          sc.ChromaticNotes,
                          sc.TIndex,
                          GetNoteName(sc.Root, mkey),
                          sc.Desc,
                          "");

                for (int n = 0; n < 12; n++)
                {
                    //if (Templates[sc.TIndex].PC[n]) {
                    if (FileSeqToTemplate[sc.TIndex].PC[n])
                    {
                        xsw.Write(GetNoteName(n + sc.Root, mkey) + " ");
                    }
                }
                //if (sc.Dup) xsw.Write("***");
                xsw.WriteLine("");
            }
            if (indFlush)
            {
                xsw.Flush();
            }
        }
コード例 #2
0
ファイル: clsCF.clsEv.cs プロジェクト: derrickgm/ChordCadenza
 //internal string ChordName(sNote[] notes) {  //eg C, Am, F#dim
 internal string ChordName(eKBTrans kbtranspc, bool kbtranskey) //eg C, Am, F#dim
 //* show in txt boxes
 {
     if (Notes == null || Notes.Length == 0)
     {
         return("null");
     }
     if (Root)
     {
         //int pitch = (kbtrans) ? Notes[0].PC_KBTrans : Notes[0].PC_NoKBTrans;
         int pitch = Notes[0].PC[kbtranspc];
         //int midikey = P.F.Keys[OnTime].KBTrans_MidiKey;
         clsKey key = P.F.Keys[OnTime, kbtranskey];
         //return NoteName.ToSharpFlat(NoteName._Names[midikey + 7][pitch].TrimEnd()) + ChordQualifier;
         return(NoteName.ToSharpFlat(NoteName.GetName(key, pitch).TrimEnd()) + ChordQualifier);
     }
     else
     {
         return("xxxx");
     }
 }
コード例 #3
0
ファイル: NoteName.cs プロジェクト: derrickgm/ChordCadenza
 internal static string GetNoteName(clsKey key, int note) //midikey = -7 to +7
 {
     return(_Names[key.MajMin, key.MidiKey + 7, note]);
 }
コード例 #4
0
ファイル: NoteName.cs プロジェクト: derrickgm/ChordCadenza
 internal static string GetName(clsKey key, int note)
 {
     note = note.Mod12();
     return(_Names[key.MajMin, key.MidiKey + 7, note]);
 }
コード例 #5
0
ファイル: clsKeys.cs プロジェクト: derrickgm/ChordCadenza
 internal clsKeyTicks(clsKey key, int ticks) : this(key.MidiKey, key.Scale, ticks)
 {
 }
コード例 #6
0
 private static string GetNoteName(int note, clsKey mkey)
 {
     return(NoteName.ToSharpFlat(NoteName.GetNoteName(mkey, note.Mod12())));
 }