Пример #1
0
        public Silence(double duration = 1, noteplayer np = null)
        {
            Duration = duration;

            if (np != null)
            {
                NotePlayer = np;
            }
            else
            {
                NotePlayer = PlayWithText;
            }
        }
Пример #2
0
        public Note(NoteName noteName, double duration = 1, int octave = BaseOctave, NoteTuning tuning = NoteTuning.LA_440)
        {
            if (octave < 1 || (octave == 1 && noteName < NoteName.RE))
            {
                throw new Exception("Can't create a note lower than RE1");
            }

            Name   = Enum.GetName(typeof(NoteName), noteName).ToLower().Replace("_sharp", "#");
            Octave = octave;
            Tuning = tuning;

            Frequency = GetFrequency(noteName, octave, tuning);
            Duration  = duration;

            NotePlayer = PlayWithTextAndSound;
        }