Exemple #1
0
        public FretBoard()
        {
            m_strings[0] = Notes.E;
            m_strings[1] = Notes.B;
            m_strings[2] = Notes.G;
            m_strings[3] = Notes.D;
            m_strings[4] = Notes.A;
            m_strings[5] = Notes.E;

            for (int i = 0; i <= 5; i++)
            {
                Board[i] = new Fret[] { new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret(), new Fret() }
            }
            ;
        }
Exemple #2
0
        public void CalculateBoard()
        {
            for (int i = 0; i <= 5; i++)
            {
                var note = m_strings[i];
                for (int j = 0; j <= 22; j++)
                {
                    Fret f = new Fret();
                    f.Note           = note;
                    f.Color          = Color.Black;
                    this.Board[i][j] = f;

                    note += 1;
                    if ((int)note % 12 == 0)
                    {
                        note = 0;
                    }
                }
            }
        }
Exemple #3
0
        public void CalculateScales(List <Scale> scales, List <Scale> chords, bool bDisplayAll)
        {
            for (int i = 0; i <= 5; i++)
            {
                var note = m_strings[i];
                for (int j = 0; j <= 22; j++)
                {
                    Fret f = new Fret();

                    f = this.Board[i][j];

                    f.Visible = false;
                    f.Color   = Color.Transparent;

                    if (bDisplayAll)
                    {
                        f.Visible = true;
                    }

                    foreach (Scale sc in scales)
                    {
                        ScaleNote scn = sc.GetScaleNote(f.Note);
                        if (scn != null)
                        {
                            if (sc.OverrideScaleColor)
                            {
                                f.Color = sc.ScaleColor;
                            }
                            else
                            {
                                f.Color = scn.Color;
                            }
                            f.IntervalLabel = "";
                            f.Visible       = true;
                            break;
                        }
                    }

                    foreach (Scale ch in chords)
                    {
                        ScaleNote scn = ch.GetScaleNote(f.Note);
                        if (scn != null)
                        {
                            if (scn.NoteType == NoteType.ROOT)
                            {
                                f.Color = ch.ChordRootColor;
                            }
                            else if (scn.NoteType == NoteType.THIRD)
                            {
                                f.Color = ch.Chord3rdColor;
                            }
                            else if (scn.NoteType == NoteType.FIFTH)
                            {
                                f.Color = ch.Chord5thColor;
                            }
                            else if (scn.NoteType == NoteType.SEVENTH)
                            {
                                f.Color = ch.Chord7thColor;
                            }
                            else if (scn.NoteType == NoteType.NINTH)
                            {
                                f.Color = ch.Chord9thColor;
                            }
                            else if (scn.NoteType == NoteType.THIRTEENTH)
                            {
                                f.Color = ch.Chord13thColor;
                            }
                            else
                            {
                                f.Color = scn.Color;
                            }

                            f.IntervalLabel = scn.IntervalName;

                            f.Visible = true;
                        }
                    }
                }
            }
        }