Пример #1
0
        private Tone GetNextToneToDisplay()
        {
            int actualNoteIndex = Convert.ToInt32(this.ActualNoteIndex.Value);

            if (this.ActualNoteIndex.Value.Equals(""))
            {
                return(null);
            }

            if (this.PreviousTone.Value.Equals(""))
            {
                return(this.ActualScale.StartingTone);
            }

            Tone tonePrev = ToneGraph.GetToneByName(this.PreviousTone.Value);

            int halftoneNumber;

            if (this.ActualScale.Type.Equals("dur"))
            {
                halftoneNumber = durIntervals[actualNoteIndex - 2];
            }
            else
            {
                halftoneNumber = molIntervals[actualNoteIndex - 2];
            }

            IntervalGenerator intervalGenerator = new IntervalGenerator();
            GeneralInterval   interval          = intervalGenerator.GetIntervalByNumeralAndNumberOfHalftones(2, halftoneNumber);

            return(intervalGenerator.ComputeSecondToneOfInterval(tonePrev, interval));
        }
Пример #2
0
        private void NextExercise()
        {
            this.clearAnswerLabels();
            this.ChangeBackgroundOfAnswerButtons("#8C8C8C");
            IntervalGenerator intervalGenerator = new IntervalGenerator();

            ActualInterval = intervalGenerator.GenerateIntervalWithTones();

            StaveObjectsPosition sop = new StaveObjectsPosition(226, 30);

            Tuple <Point, Point, Point>[] notesPosition = sop.DrawInterval(ActualInterval, 240);

            this.ChangePositionOfNote(notesPosition[0], this.Note1, this.LedgerLine1, this.SharpFlatSymbol1,
                                      this.ActualInterval.Tone1);
            this.ChangePositionOfNote(notesPosition[1], this.Note2, this.LedgerLine2, this.SharpFlatSymbol2,
                                      this.ActualInterval.Tone2);
        }
Пример #3
0
        private void NextExercise()
        {
            this.HideSecondNote();
            this.AddPointerToFirstNote();

            IntervalGenerator intervalGenerator = new IntervalGenerator();

            this.ActualInterval             = intervalGenerator.GenerateIntervalWithTones();
            this.QuestionInterval.InnerText = this.ActualInterval.GeneralInterval.ToString();
            this.QuestionInterval.Attributes.Add("title",
                                                 this.WholeIntervalAdjective(this.ActualInterval.GeneralInterval.adjective) + " " +
                                                 this.WholeIntervalNumeral(this.ActualInterval.GeneralInterval.numeral));
            this.Tone1Index.Value = ToneGraph.GetReferenceToneIndex(this.ActualInterval.Tone1).ToString();

            StaveObjectsPosition        sop          = new StaveObjectsPosition(226, 30);
            Tuple <Point, Point, Point> notePosition = sop.DrawNote(this.ActualInterval.Tone1, 240);

            this.ChangePositionOfNote(notePosition, this.Note1, this.LedgerLine1, this.SharpFlatSymbol1,
                                      this.ActualInterval.Tone1);
        }