Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. /*
  2.     Carrier harmonics calculation.
  3.     Only used by saw and square oscillators which in turn are only used for tone generation.
  4. */
  5.  
  6. const float kHarmonicsPrecHZ = 20.f;
  7.  
  8. VIZ_INLINE unsigned GetNumCarrierHarmonics(float frequency)
  9. {
  10.     VIZ_ASSERT(frequency >= 20.f);
  11.     const float lower = (frequency/kAudibleNyquist)/kHarmonicsPrecHZ;
  12.     return unsigned(lower);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement