KIK 01 Prototype 05
Dependencies: AverageMCP3008 mbed-rtos mbed mcp3008
Fork of KIK01_Proto03 by
Diff: main.cpp
- Revision:
- 19:d9e4c66cb49b
- Parent:
- 18:1bf4abf6895b
- Child:
- 20:70a05941db8c
--- a/main.cpp Fri Sep 15 23:58:44 2017 +0000 +++ b/main.cpp Sat Sep 16 00:01:49 2017 +0000 @@ -173,71 +173,6 @@ volatile int envelopeLength; volatile int stepLength; -#if 0 -//-----------------------------------------------------------------------------// -// Internal DCA -// -void generateWave_DcaInternal() -{ - phi += phiDelta; - if (phi >= 1.0f) { - phi -= 2.0f; - } - float level = cosf(PI_F * phi) * amplitude; - - Dac1.write((level * 0.7f + 1.0f) / 2.0f); -} - -void generateEnvelope_DcaInternal() -{ - // Frequency Envelope - frequency = envelopeFrequency.getAmplitude(envelopeTicks); - phiDelta = 2.0f * frequency / SAMPLING_RATE; - - // Amplitude Envelope - amplitude = envelopeAmplitude.getAmplitude(envelopeTicks); - - envelopeTicks++; - if (envelopeTicks >= envelopeLength) { - envelopeTicks = 0; - phi = PI_F / 2.0f; - } -} - -//-----------------------------------------------------------------------------// -// External DCA -// -void generateWave_DcaExternal() -{ - phi += phiDelta; - if (phi >= 1.0f) { - phi -= 2.0f; - } - //float level = cosf(PI_F * phi) * amplitude; - float level = cosf(PI_F * phi); - - Dac1.write((level * 0.7f + 1.0f) / 2.0f); -} - -void generateEnvelope_DcaExternal() -{ - // Frequency Envelope - frequency = envelopeFrequency.getAmplitude(envelopeTicks); - phiDelta = 2.0f * frequency / SAMPLING_RATE; - - // Amplitude Envelope - amplitude = envelopeAmplitude.getAmplitude(envelopeTicks); - - ampController.outDca(amplitude * 4096); - - envelopeTicks++; - if (envelopeTicks >= envelopeLength) { - envelopeTicks = 0; - phi = PI_F / 2.0f; - } -} -#endif - void AD8402Write(uint8_t address, uint8_t value) { AD8402Cs = 0;