public void MakeChordListUsingGA()
        {
            ChordListUsingGA = new ChordTableEnum[GABarList.Count][];
            int thisOffSet = 0;
            int thisIndex  = 0;

            for (int i = 0; i < GABarList.Count; i++)
            {
                ChordListUsingGA[i] = new ChordTableEnum[StaticRepo.ConfigRepository.MaxNumOfNote];
                for (int j = 0; j < StaticRepo.ConfigRepository.MaxNumOfNote; j++)
                {
                    if (ChordList[thisIndex].OffSet <= thisOffSet)
                    {
                        thisIndex++;
                        if (thisIndex >= ChordList.Count)
                        {
                            break;
                        }
                    }

                    ChordListUsingGA[i][j] = ChordToGeneticChord(ChordList[thisIndex - 1].Chord);
                    thisOffSet            += StaticRepo.ConfigRepository.TickPerMinNote;
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 코드 테이블의 대상 타겟을 특정 스케일로 초기화 한다
        /// </summary>
        /// <param name="targetChord">코드 테이블에서 초기화 할 코드</param>
        /// <param name="targetScale">초기화 할 스케일</param>
        private void InitChordTableValue(ChordTableEnum targetChord, Scale targetScale)
        {
            #region 1차 : 코드의 스케일 구성원인지

            for (int i = 0; i < 12; i++)
            {
                if (targetScale.Contains((Pitch)i))
                {
                    SavedTable.Chordtable[targetChord.Index()][0][i] = 100;
                }
                else
                {
                    SavedTable.Chordtable[targetChord.Index()][0][i] = -50;
                }
            }

            #endregion

            #region 2차 : 그 다음 노트 구성원 인지

            for (int i = 0; i < 12; i++)
            {
                for (int j = 0; j < 12; j++)
                {
                    if (targetScale.Contains((Pitch)i))
                    {
                        SavedTable.Chordtable[targetChord.Index()][i + 1][j] += 50;
                    }
                    else
                    {
                        SavedTable.Chordtable[targetChord.Index()][i + 1][j] -= 75;
                    }

                    if (targetScale.Contains((Pitch)j))
                    {
                        SavedTable.Chordtable[targetChord.Index()][i + 1][j] += 50;
                    }
                    else
                    {
                        SavedTable.Chordtable[targetChord.Index()][i + 1][j] -= 75;
                    }
                }
            }

            #endregion
        }
Beispiel #3
0
 public double[][] GetChordTableFromChordName(ChordTableEnum cenum)
 {
     return(SavedTable.Chordtable[(int)cenum]);
 }
Beispiel #4
0
 public static int Index(this ChordTableEnum chord)
 {
     return((int)chord);
 }