Пример #1
0
 public static int ConvertToHertz(NoteCode note)
 {
     float f0 = 16.35f;
     float a = 1.05946309436f;
     //Equation is fn = f0 * (a)^n
     int n = Convert.ToInt32(note);
     return (int)(f0 * (Math.Pow(a, n)));
 }
Пример #2
0
        public static int ConvertToHertz(NoteCode note)
        {
            float f0 = 16.35f;
            float a  = 1.05946309436f;
            //Equation is fn = f0 * (a)^n
            int n = Convert.ToInt32(note);

            return((int)(f0 * (Math.Pow(a, n))));
        }
Пример #3
0
        public static void Play(NoteCode name, NoteType length)
        {
            int noteValue = Convert.ToInt32(length);

            if(noteValue < 0 && !stop)
            {
                System.Threading.Thread.Sleep(Math.Abs(noteValue));
            }
            else if (noteValue >= 0 && !stop)
            {
                Console.Beep(ConvertToHertz(name), noteValue);
            }
            else
            {
                return;
            }
        }
Пример #4
0
        public static void Play(NoteCode name, NoteType length)
        {
            int noteValue = Convert.ToInt32(length);

            if (noteValue < 0 && !stop)
            {
                System.Threading.Thread.Sleep(Math.Abs(noteValue));
            }
            else if (noteValue >= 0 && !stop)
            {
                Console.Beep(ConvertToHertz(name), noteValue);
            }
            else
            {
                return;
            }
        }
Пример #5
0
 public void UploadNote(string locID, string note, string prefix = "VTNotes : ", NoteCode code = NoteCode.GEN)
 {
     this.UploadNote(
         new NoteModel(
             locID, prefix + note, code.ToString()
             )
         );
 }
Пример #6
0
 public List <NoteListModel> GetNotes(string locID, NoteCode filter)
 {
     return(this.GetNotes(locID, filter.ToString()));
 }
Пример #7
0
 public List <NoteListModel> GetNotes(string locID, NoteCode filter, DateTime startdate)
 {
     return(this.GetNotes(locID, filter.ToString(), startdate));
 }