OSCtoCV Library
Diff: OSCtoCV_Random.cpp
- Revision:
- 4:fe335dc8d53d
- Parent:
- 1:981b62bb5c87
--- a/OSCtoCV_Random.cpp Sun Jan 31 12:55:17 2016 +0000 +++ b/OSCtoCV_Random.cpp Tue Feb 16 11:31:12 2016 +0000 @@ -1,5 +1,5 @@ /* - OSCtoCV_Sequencer.cpp + OSCtoCV_Random.cpp */ #include <math.h> @@ -35,6 +35,7 @@ //------------------------------------------------------------- // generate random number from 0 to 1 + double Rnd(void) /* 0 <= rnd() < 1 */ { return (1.0 / (UINT_MAX + 1.0)) * Xorshift_32(); @@ -65,18 +66,13 @@ int i, modeState; static int _modeState = -1; static bool triggerState = false; - static uint8_t ch, qmode, amode; + static uint8_t ch; static float randomcv[8], glidecv[8]; unsigned int cv; static float qcv; static int jitter, jitterCount; - - qmode = (gCtrl[1] * (SCALE_NUM - 1.0f)); // Sequencer Quantize Mode (gCtrl[1]) - amode = SCALE_AOUT * qmode; - gAOUT.write_u16(amode); - - switch (qmode) + switch (CheckQuantizeMode()) { case Lin: