GeneticMIDI.Fractal.NoteRangeRestrictor.GetNumDurations C# (CSharp) Method

GetNumDurations() public method

public GetNumDurations ( ) : int
return int
        public int GetNumDurations()
        {
            return lengthRange.Count();
        }

Usage Example

Exemplo n.º 1
0
        /**
         *
         * @param nrr             The restrictor to use for note generation.
         * @param lowPitchChange  The smallest allowed step for pitch changes.
         * @param highPitchChange The largest allowed step for pitch changes.
         * @param lowLengthStep   The smallest allowed step for duration changes.
         * @param highLengthStep  The largest allowed step for duration changes.
         */
        public BrownNoteGenerator(
            NoteRangeRestrictor nrr,
            int lowPitchChange, int highPitchChange, 
            int lowLengthStep, int highLengthStep
            )
        {
            restrictor = nrr;

            lowPC = lowPitchChange;
            highPC = highPitchChange;
            lowLC = lowLengthStep;
            highLC = highLengthStep;

            // Set first note to midpoint of ranges
            nextPitchIndex = (int) ( restrictor.GetNumPitches() / 2 );
            nextLengthIndex = (int) ( restrictor.GetNumDurations() / 2 );
        }