Skip to content

Commit

Permalink
Midi-Cat - fixes for response curves #258
Browse files Browse the repository at this point in the history
  • Loading branch information
stoermelder committed Apr 24, 2024
1 parent 3369bec commit 0eb051e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/MidiCat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ struct MidiCatModule : Module, StripIdFixModule {
midiParam[learningId].setSlew(midiParam[learningId - 1].getSlew());
midiParam[learningId].setMin(midiParam[learningId - 1].getMin());
midiParam[learningId].setMax(midiParam[learningId - 1].getMax());
midiParam[learningId].setCurve(midiParam[learningId - 1].getCurve());
midiParam[learningId].clockMode = midiParam[learningId - 1].clockMode;
midiParam[learningId].clockSource = midiParam[learningId - 1].clockSource;
}
Expand Down Expand Up @@ -985,6 +986,7 @@ struct MidiCatModule : Module, StripIdFixModule {
p->slew = midiParam[i].getSlew();
p->min = midiParam[i].getMin();
p->max = midiParam[i].getMax();
p->curve = midiParam[i].getCurve();
m->paramMap.push_back(p);
}
m->pluginName = module->model->plugin->name;
Expand Down Expand Up @@ -1028,6 +1030,7 @@ struct MidiCatModule : Module, StripIdFixModule {
midiParam[i].setSlew(it->slew);
midiParam[i].setMin(it->min);
midiParam[i].setMax(it->max);
midiParam[i].setCurve(it->curve);
i++;
}
updateMapLen();
Expand Down
1 change: 1 addition & 0 deletions src/MidiCat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct MemParam {
float slew = 0.f;
float min = 0.f;
float max = 1.f;
float curve = 0.f;
};

struct MemModule {
Expand Down
3 changes: 3 additions & 0 deletions src/MidiCatMem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ struct MidiCatMemModule : Module {
json_object_set_new(paramMapJJ, "slew", json_real(p->slew));
json_object_set_new(paramMapJJ, "min", json_real(p->min));
json_object_set_new(paramMapJJ, "max", json_real(p->max));
json_object_set_new(paramMapJJ, "curve", json_real(p->curve));
json_array_append_new(paramMapJ, paramMapJJ);
}
json_object_set_new(midiMapJJ, "paramMap", paramMapJ);
Expand Down Expand Up @@ -147,6 +148,8 @@ struct MidiCatMemModule : Module {
if (minJ) p->min = json_real_value(minJ);
json_t* maxJ = json_object_get(paramMapJJ, "max");
if (maxJ) p->max = json_real_value(maxJ);
json_t* curveJ = json_object_get(paramMapJJ, "curve");
if (curveJ) p->curve = json_real_value(curveJ);
a->paramMap.push_back(p);
}
midiMap[std::pair<std::string, std::string>(pluginSlug, moduleSlug)] = a;
Expand Down
1 change: 1 addition & 0 deletions src/digital/ScaledMapParam.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct ScaledMapParam {
filterSlew = 0.f;
min = 0.f;
max = 1.f;
curve = 0.f;
}
}

Expand Down

0 comments on commit 0eb051e

Please sign in to comment.