Пример #1
0
 // -----------------------------------------------------------------
 //  Dequeues, takes the average of it and the sample, then multiplies
 //  by .944 to create an energy decay factor
 // -----------------------------------------------------------------
 public void tic() {
   try {
     double note = chord.dequeue();
     double newnote = ((note + chord.first()) * 0.994) / 2;
     chord.enqueue(newnote);
   } catch (NullPointerException exception) {
     System.out.println("Empty array");
   }
 }
Пример #2
0
 // -----------------------------------------------------------------
 //  Returns the first value in the queue
 // -----------------------------------------------------------------
 public double sample() {
   return chord.first();
 }