Browse Source

Fix Scope param range. Update to Rack v1 API.

tags/v1.0.1
Andrew Belt 5 years ago
parent
commit
02e7ef6877
2 changed files with 15 additions and 27 deletions
  1. +3
    -3
      src/Scope.cpp
  2. +12
    -24
      src/VCO.cpp

+ 3
- 3
src/Scope.cpp View File

@@ -86,8 +86,8 @@ void Scope::step() {
lights[EXTERNAL_LIGHT].value = external ? 1.0f : 0.0f;

// Compute time
float deltaTime = powf(2.0f, params[TIME_PARAM].value);
int frameCount = (int)ceilf(deltaTime * engineGetSampleRate());
float deltaTime = std::pow(2.0f, -params[TIME_PARAM].value);
int frameCount = (int) std::ceil(deltaTime * engineGetSampleRate());

// Add frame to buffer
if (bufferIndex < BUFFER_SIZE) {
@@ -325,7 +325,7 @@ ScopeWidget::ScopeWidget(Scope *module) : ModuleWidget(module) {
addParam(createParam<RoundBlackKnob>(Vec(15, 263), module, Scope::X_POS_PARAM, -10.0f, 10.0f, 0.0f));
addParam(createParam<RoundBlackSnapKnob>(Vec(61, 209), module, Scope::Y_SCALE_PARAM, -2.0f, 8.0f, 0.0f));
addParam(createParam<RoundBlackKnob>(Vec(61, 263), module, Scope::Y_POS_PARAM, -10.0f, 10.0f, 0.0f));
addParam(createParam<RoundBlackKnob>(Vec(107, 209), module, Scope::TIME_PARAM, -6.0f, -16.0f, -14.0f));
addParam(createParam<RoundBlackKnob>(Vec(107, 209), module, Scope::TIME_PARAM, 6.0f, 16.0f, 14.0f));
addParam(createParam<CKD6>(Vec(106, 262), module, Scope::LISSAJOUS_PARAM, 0.0f, 1.0f, 0.0f));
addParam(createParam<RoundBlackKnob>(Vec(153, 209), module, Scope::TRIG_PARAM, -10.0f, 10.0f, 0.0f));
addParam(createParam<CKD6>(Vec(152, 262), module, Scope::EXTERNAL_PARAM, 0.0f, 1.0f, 0.0f));


+ 12
- 24
src/VCO.cpp View File

@@ -195,20 +195,13 @@ struct VCO : Module {

VCO() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
params[MODE_PARAM].config(0.f, 1.f, 1.f);
paramInfos[MODE_PARAM].config("Mode");
params[SYNC_PARAM].config(0.f, 1.f, 1.f);
paramInfos[SYNC_PARAM].config("Sync");
params[FREQ_PARAM].config(-54.0f, 54.0f, 0.0f);
paramInfos[FREQ_PARAM].config("Frequency", " Hz", std::pow(2, 1/12.f), dsp::FREQ_C4);
params[FINE_PARAM].config(-1.0f, 1.0f, 0.0f);
paramInfos[FINE_PARAM].config("Fine frequency");
params[FM_PARAM].config(0.0f, 1.0f, 0.0f);
paramInfos[FM_PARAM].config("Frequency modulation");
params[PW_PARAM].config(0.0f, 1.0f, 0.5f);
paramInfos[PW_PARAM].config("Pulse width", "%", 0.f, 100.f);
params[PWM_PARAM].config(0.0f, 1.0f, 0.0f);
paramInfos[PWM_PARAM].config("Pulse width modulation", "%", 0.f, 100.f);
params[MODE_PARAM].config(0.f, 1.f, 1.f, "Mode");
params[SYNC_PARAM].config(0.f, 1.f, 1.f, "Sync");
params[FREQ_PARAM].config(-54.0f, 54.0f, 0.0f, "Frequency", " Hz", std::pow(2, 1/12.f), dsp::FREQ_C4);
params[FINE_PARAM].config(-1.0f, 1.0f, 0.0f, "Fine frequency");
params[FM_PARAM].config(0.0f, 1.0f, 0.0f, "Frequency modulation");
params[PW_PARAM].config(0.0f, 1.0f, 0.5f, "Pulse width", "%", 0.f, 100.f);
params[PWM_PARAM].config(0.0f, 1.0f, 0.0f, "Pulse width modulation", "%", 0.f, 100.f);
}
void step() override;
};
@@ -311,16 +304,11 @@ struct VCO2 : Module {

VCO2() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
params[MODE_PARAM].config(0.f, 1.f, 1.f);
paramInfos[MODE_PARAM].config("Mode");
params[SYNC_PARAM].config(0.f, 1.f, 1.f);
paramInfos[SYNC_PARAM].config("Sync");
params[FREQ_PARAM].config(-54.0f, 54.0f, 0.0f);
paramInfos[FREQ_PARAM].config("Frequency", " Hz", std::pow(2, 1/12.f), dsp::FREQ_C4);
params[WAVE_PARAM].config(0.0f, 3.0f, 1.5f);
paramInfos[WAVE_PARAM].config("Wave");
params[FM_PARAM].config(0.0f, 1.0f, 0.0f);
paramInfos[FM_PARAM].config("Frequency modulation");
params[MODE_PARAM].config(0.f, 1.f, 1.f, "Mode");
params[SYNC_PARAM].config(0.f, 1.f, 1.f, "Sync");
params[FREQ_PARAM].config(-54.0f, 54.0f, 0.0f, "Frequency", " Hz", std::pow(2, 1/12.f), dsp::FREQ_C4);
params[WAVE_PARAM].config(0.0f, 3.0f, 1.5f, "Wave");
params[FM_PARAM].config(0.0f, 1.0f, 0.0f, "Frequency modulation");
}
void step() override;
};


Loading…
Cancel
Save