Exemple #1
0
        /// <summary>
        /// Distance based on the number of common underlying Scales
        /// </summary>
        public int DistanceScales(TwelveToneSet other)
        {
            int           count = 0;
            TwelveToneSet copy  = new TwelveToneSet(majorScale);

            for (int i = 0; i < TWELVE; i++)
            {
                if (this.CoveredBy(copy) && other.CoveredBy(copy))
                {
                    count++;
                }
                copy.ShiftRight(1);
            }

            int ret = Math.Min(CountMajorScales(), other.CountMajorScales()) - count;

            return(ret);
        }
Exemple #2
0
        public bool CoveredByAnySimilar(TwelveToneSet other)
        {
            if (this.CoveredBy(other))
            {
                return(true);
            }

            TwelveToneSet copy = new TwelveToneSet(this);

            for (int i = 1; i < TWELVE; i++)
            {
                copy = copy.ShiftRight(1);
                if (copy.CoveredBy(other))
                {
                    return(true);
                }
            }

            return(false);
        }