mirror of
https://github.com/AquaMorph/Droplets.git
synced 2025-04-30 17:46:59 +00:00
VCO displays wave name
This commit is contained in:
parent
1ce6820633
commit
d7e6b6f6e7
@ -5,7 +5,7 @@ VCODroplet::VCODroplet(DaisyPatch* m_patch,
|
||||
DropletState m_state) {
|
||||
UpdateState(m_state);
|
||||
patch = m_patch;
|
||||
int num_waves = Oscillator::WAVE_LAST - 1;
|
||||
int num_waves = Oscillator::WAVE_LAST;
|
||||
osc.Init(sample_rate);
|
||||
freqctrl.Init(patch->controls[patch->CTRL_1], 10.0,
|
||||
110.0f, Parameter::LINEAR);
|
||||
@ -46,4 +46,27 @@ void VCODroplet::Process(float** in, float** out, size_t size) {
|
||||
|
||||
void VCODroplet::Draw() {
|
||||
DrawName(patch, "VCO");
|
||||
WriteString(*patch, 0, 54, Font_6x8, WaveToString(wavectrl.Process()));
|
||||
}
|
||||
|
||||
std::string VCODroplet::WaveToString(uint8_t wf) {
|
||||
switch(wf){
|
||||
case Oscillator::WAVE_TRI:
|
||||
return "Triangle";
|
||||
case Oscillator::WAVE_SQUARE:
|
||||
return "Square";
|
||||
case Oscillator::WAVE_SIN:
|
||||
return "Sine";
|
||||
case Oscillator::WAVE_SAW:
|
||||
return "Saw";
|
||||
case Oscillator::WAVE_RAMP:
|
||||
return "Ramp";
|
||||
case Oscillator::WAVE_POLYBLEP_TRI:
|
||||
return "Poly Triangle";
|
||||
case Oscillator::WAVE_POLYBLEP_SQUARE:
|
||||
return "Poly Square";
|
||||
case Oscillator::WAVE_POLYBLEP_SAW:
|
||||
return "Poly Saw";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ class VCODroplet: public Droplet {
|
||||
private:
|
||||
Oscillator osc;
|
||||
Parameter freqctrl, wavectrl, ampctrl, finectrl;
|
||||
std::string WaveToString(uint8_t);
|
||||
public:
|
||||
VCODroplet(DaisyPatch*, float, DropletState);
|
||||
void Control();
|
||||
|
@ -66,7 +66,6 @@ Droplet* GetDroplet() {
|
||||
return new VCODroplet(&patch,
|
||||
samplerate,
|
||||
DropletState::kFull);
|
||||
break;
|
||||
case MenuState::kNoise:
|
||||
default:
|
||||
return new NoiseDroplet(&patch,
|
||||
|
@ -1,3 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef CASCADE_MAIN_H_
|
||||
#define CASCADE_MAIN_H_
|
||||
|
||||
#include "daisysp.h"
|
||||
#include "daisy_patch.h"
|
||||
|
||||
@ -14,3 +19,5 @@ void ProcessOled();
|
||||
void ProcessOutputs();
|
||||
static void AudioThrough(float **, float **, size_t);
|
||||
Droplet* GetDroplet();
|
||||
|
||||
#endif // CASCADE_MAIN_H_
|
||||
|
Loading…
x
Reference in New Issue
Block a user