barelymusician/dsp/polyphonic_voice_test.cpp
// Tests that playing a single voice produces the expected output.
Tests that playing a single voice produces the expected output.
Tests that playing a single voice produces the expected output .
TEST(PolyphonicVoiceTest, SingleVoice) {
  const double kPitch = 0.0;
  FakeVoice base_voice;
  base_voice.SetOutput(kOutput);
  PolyphonicVoice<FakeVoice> polyphonic_voice(std::move(base_voice));
  polyphonic_voice.Resize(kNumVoices);
  EXPECT_DOUBLE_EQ(polyphonic_voice.Next(kChannel), 0.0);
  polyphonic_voice.Start(kPitch);
  EXPECT_DOUBLE_EQ(polyphonic_voice.Next(kChannel), kOutput);
  polyphonic_voice.Stop(kPitch);
  EXPECT_DOUBLE_EQ(polyphonic_voice.Next(kChannel), 0.0);
}
TEST ( PolyphonicVoiceTest , SingleVoice ) { const double kPitch = 0.0 ; FakeVoice base_voice ; base_voice . SetOutput ( kOutput ) ; PolyphonicVoice < FakeVoice > polyphonic_voice ( std :: move ( base_voice ) ) ; polyphonic_voice . Resize ( kNumVoices ) ; EXPECT_DOUBLE_EQ ( polyphonic_voice . Next ( kChannel ) , 0.0 ) ; polyphonic_voice . Start ( kPitch ) ; EXPECT_DOUBLE_EQ ( polyphonic_voice . Next ( kChannel ) , kOutput ) ; polyphonic_voice . Stop ( kPitch ) ; EXPECT_DOUBLE_EQ ( polyphonic_voice . Next ( kChannel ) , 0.0 ) ; }
Tests that playing a single voice produces the expected output.
Tests that playing a single voice produces the expected output .