Esempio n. 1
0
        private void ClassifyMinorTriadsZ12(Triad triad)
        {
            long firstNotePitchClass  = MusicHelper.ReduceToPitchClass(triad.FirstNote.EulerPoint.P.Numerator, 12);
            long secondNotePitchClass = MusicHelper.ReduceToPitchClass(triad.SecondNote.EulerPoint.P.Numerator, 12);
            long thirdNotePitchClass  = MusicHelper.ReduceToPitchClass(triad.ThirdNote.EulerPoint.P.Numerator, 12);

            if (triad.triadType == TriadType.NoTriad)              //Abbrechen wenn Dreiklangtyp gefunden wurde
            {
                long lowerInterval = secondNotePitchClass - firstNotePitchClass;
                lowerInterval = MusicHelper.ReduceToPitchClass(lowerInterval, 12);
                long upperInterval = thirdNotePitchClass - secondNotePitchClass;
                upperInterval = MusicHelper.ReduceToPitchClass(upperInterval, 12);

                CheckIfExpectedEqualsValueAndSetType(MusicHelper.MinorThird, lowerInterval, MusicHelper.MajorThird, upperInterval, TriadType.MinorTriad, TriadInversion.NoInversion, FundamentalTone.FirstNote, triad);
                CheckIfExpectedEqualsValueAndSetType(MusicHelper.MajorThird, lowerInterval, MusicHelper.Fourth, upperInterval, TriadType.MinorTriad, TriadInversion.FirstInversion, FundamentalTone.ThirdNote, triad);
                CheckIfExpectedEqualsValueAndSetType(MusicHelper.Fourth, lowerInterval, MusicHelper.MinorThird, upperInterval, TriadType.MinorTriad, TriadInversion.SecondInversion, FundamentalTone.SecondNote, triad);
                CheckIfExpectedEqualsValueAndSetType(MusicHelper.Fifth, lowerInterval, MusicHelper.MinorSixth, upperInterval, TriadType.MinorTriad, TriadInversion.StatisticalInversionFundamentalToneFirst, FundamentalTone.FirstNote, triad);
                CheckIfExpectedEqualsValueAndSetType(MusicHelper.MajorSixth, lowerInterval, MusicHelper.Fourth, upperInterval, TriadType.MinorTriad, TriadInversion.StatisticalInversionFundamentalToneSecond, FundamentalTone.SecondNote, triad);
                CheckIfExpectedEqualsValueAndSetType(MusicHelper.MinorSixth, lowerInterval, MusicHelper.MajorSixth, upperInterval, TriadType.MinorTriad, TriadInversion.StatisticalInversionFundamentalToneThird, FundamentalTone.ThirdNote, triad);
            }
            else
            {
                return;
            }
        }
Esempio n. 2
0
        private void ClassifyDiminishedTriadsZ12(Triad triad)
        {
            //Reduce note value to pitch class
            long firstNotePitchClass  = MusicHelper.ReduceToPitchClass(triad.FirstNote.EulerPoint.P.Numerator, 12);
            long secondNotePitchClass = MusicHelper.ReduceToPitchClass(triad.SecondNote.EulerPoint.P.Numerator, 12);
            long thirdNotePitchClass  = MusicHelper.ReduceToPitchClass(triad.ThirdNote.EulerPoint.P.Numerator, 12);

            if (triad.triadType == TriadType.NoTriad)              //Abbrechen wenn Dreiklangtyp gefunden wurde
            {
                //Calculate difference between notes
                long lowerInterval = secondNotePitchClass - firstNotePitchClass;
                lowerInterval = MusicHelper.ReduceToPitchClass(lowerInterval, 12);
                long upperInterval = thirdNotePitchClass - secondNotePitchClass;
                upperInterval = MusicHelper.ReduceToPitchClass(upperInterval, 12);

                //check if difference between notes (interval) equals the intervals for diminished triads
                //all options need to be tested

                CheckIfExpectedEqualsValueAndSetType(MusicHelper.MinorThird, lowerInterval, MusicHelper.MinorThird, upperInterval, TriadType.DiminishedTriad, TriadInversion.NoInversion, FundamentalTone.Default, triad);
                //CheckIfExpectedEqualsValueAndSetType( MusicHelper.MinorThird, lowerInterval, MusicHelper.MinorThird, upperInterval, TriadType.AugmentedTriad, TriadInversion.FirstInversion, triad );
                //CheckIfExpectedEqualsValueAndSetType( MusicHelper.MinorThird, lowerInterval, MusicHelper.MinorThird, upperInterval, TriadType.AugmentedTriad, TriadInversion.SecondInversion, triad );
                CheckIfExpectedEqualsValueAndSetType(MusicHelper.MajorSixth, lowerInterval, MusicHelper.Tritone, upperInterval, TriadType.DiminishedTriad, TriadInversion.NoInversion, FundamentalTone.Default, triad);
                CheckIfExpectedEqualsValueAndSetType(MusicHelper.Tritone, lowerInterval, MusicHelper.MajorSixth, upperInterval, TriadType.DiminishedTriad, TriadInversion.NoInversion, FundamentalTone.Default, triad);
            }
            else
            {
                return;
            }
        }