@Test public void testTic() { GuitarString s = new GuitarString(11025); s.pluck(); double s1 = s.sample(); s.tic(); double s2 = s.sample(); s.tic(); double s3 = s.sample(); s.tic(); double s4 = s.sample(); s.tic(); double s5 = s.sample(); double expected = 0.996 * 0.5 * (s1 + s2); assertEquals(expected, s5, 0.001); }
public void tic() { double first = buffer.dequeue(); buffer.enqueue((first + buffer.peek()) * DECAY / 2); }
GuitarString { public void tic() { double first = buffer.dequeue(); buffer.enqueue((first + buffer.peek()) * DECAY / 2); } }
GuitarString { public void tic() { double first = buffer.dequeue(); buffer.enqueue((first + buffer.peek()) * DECAY / 2); } GuitarString(double frequency); }
GuitarString { public void tic() { double first = buffer.dequeue(); buffer.enqueue((first + buffer.peek()) * DECAY / 2); } GuitarString(double frequency); void pluck(); void tic(); double sample(); }
GuitarString { public void tic() { double first = buffer.dequeue(); buffer.enqueue((first + buffer.peek()) * DECAY / 2); } GuitarString(double frequency); void pluck(); void tic(); double sample();  }