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)); }
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); } }
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())); }