コード例 #1
0
        public ActionResult OnScaleSelected(string scaleName)
        {
            // TODO: Need to understand why view isn't loading properly

            Scale scale = ScalesBook.GetAllScales().Find(x => x.ScaleName.Equals(scaleName));

            return(this.View("scaledetails", scale));
        }
コード例 #2
0
        private void DetermineScaleFromNotes()
        {
            List <Note> distinctNotes = GetDistinctNotesFromChordList();

            List <Scale> matchingScales = ScalesBook.GetMatchingScales(distinctNotes);

            this.MatchingScales.Clear();
            foreach (Scale scale in matchingScales)
            {
                this.MatchingScales.Add(scale);
            }
        }
コード例 #3
0
        public JsonResult GetMatchingScales(List <string> chords)
        {
            List <Chord> chordsList = new List <Chord>();


            foreach (string chord in chords)
            {
                chordsList.Add(new Chord(chord));
            }

            List <Note>  distinctNotes  = chordsList.GetDistinctNotesFromChordList();
            List <Scale> matchingScales = ScalesBook.GetMatchingScales(distinctNotes);

            return(Json(matchingScales.Select(x => x.ScaleName).ToList()));
        }