float vol2 = 0;
float speed2 = 1;
- int m = e.note % Tuba_PitchStep;
+ int m = pymod(e.note, Tuba_PitchStep);
if (m) {
if (e.note - m < TUBA_MIN) {
if (restart) {
}
}
for (int n = TUBA_MIN; n <= TUBA_MAX; ++n) {
- if (!Tuba_PitchStep || (n % Tuba_PitchStep) == 0) {
+ if (!Tuba_PitchStep || pymod(n, Tuba_PitchStep) == 0) {
for (int i = 0; i < TUBA_INSTRUMENTS; ++i) {
precache_sound(TUBA_STARTNOTE(i, n));
}
vector lgamma(float x); // value in _x, sign in _y
float tgamma(float x);
+/**
+ * Pythonic mod:
+ * TODO: %% operator?
+ *
+ * 1 % 2 == 1
+ * -1 % 2 == 1
+ * 1 % -2 == -1
+ * -1 % -2 == -1
+ */
+float pymod(float x, float y);
+
//float ceil(float x);
//float floor(float x);
float nearbyint(float x);