Function bodies 1,902 total
getDisplayAngle method · cpp · L50-L56 (7 LOC)src/MADDYPlus.cpp
float getDisplayAngle() {
ParamQuantity* pq = getParamQuantity();
if (!pq) return 0.0f;
float normalizedValue = pq->getScaledValue();
return rescale(normalizedValue, 0.0f, 1.0f, -0.75f * M_PI, 0.75f * M_PI);
}draw method · cpp · L57-L93 (37 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs& args) override {
float radius = box.size.x / 2.0f;
float angle = getDisplayAngle();
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgFillColor(args.vg, nvgRGB(30, 30, 30));
nvgFill(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGB(100, 100, 100));
nvgStroke(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 4);
nvgFillColor(args.vg, nvgRGB(50, 50, 50));
nvgFill(args.vg);
float indicatorLength = radius - 8;
float lineX = radius + indicatorLength * std::sin(angle);
float lineY = radius - indicatorLength * std::cos(angle);
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, radius, radius);
nvgLineTo(args.vg, lineX, lineY);
nvgStrokeWidth(args.vg, 2onButton method · cpp · L94-L104 (11 LOC)src/MADDYPlus.cpp
void onButton(const event::Button& e) override {
if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = true;
e.consume(this);
}
else if (e.action == GLFW_RELEASE && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = false;
}
ParamWidget::onButton(e);
}onDragMove method · cpp · L105-L116 (12 LOC)src/MADDYPlus.cpp
void onDragMove(const event::DragMove& e) override {
ParamQuantity* pq = getParamQuantity();
if (!isDragging || !pq) return;
float sensitivity = 0.002f;
float deltaY = -e.mouseDelta.y;
float range = pq->getMaxValue() - pq->getMinValue();
float currentValue = pq->getValue();
float newValue = clamp(currentValue + deltaY * sensitivity * range, pq->getMinValue(), pq->getMaxValue());
pq->setValue(newValue);
}onDoubleClick method · cpp · L117-L123 (7 LOC)src/MADDYPlus.cpp
void onDoubleClick(const event::DoubleClick& e) override {
ParamQuantity* pq = getParamQuantity();
if (!pq) return;
pq->reset();
e.consume(this);
}OldMADDYPlusSnapKnob_UNUSED method · cpp · L130-L133 (4 LOC)src/MADDYPlus.cpp
OldMADDYPlusSnapKnob_UNUSED() {
box.size = Vec(26, 26);
}getDisplayAngle method · cpp · L134-L140 (7 LOC)src/MADDYPlus.cpp
float getDisplayAngle() {
ParamQuantity* pq = getParamQuantity();
if (!pq) return 0.0f;
float normalizedValue = pq->getScaledValue();
return rescale(normalizedValue, 0.0f, 1.0f, -0.75f * M_PI, 0.75f * M_PI);
}Repobility · severity-and-effort ranking · https://repobility.com
draw method · cpp · L141-L177 (37 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs& args) override {
float radius = box.size.x / 2.0f;
float angle = getDisplayAngle();
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgFillColor(args.vg, nvgRGB(30, 30, 30));
nvgFill(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGB(100, 100, 100));
nvgStroke(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 4);
nvgFillColor(args.vg, nvgRGB(130, 130, 130));
nvgFill(args.vg);
float indicatorLength = radius - 8;
float lineX = radius + indicatorLength * std::sin(angle);
float lineY = radius - indicatorLength * std::cos(angle);
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, radius, radius);
nvgLineTo(args.vg, lineX, lineY);
nvgStrokeWidth(args.vgonButton method · cpp · L178-L185 (8 LOC)src/MADDYPlus.cpp
void onButton(const event::Button& e) override {
if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) {
accumDelta = 0.0f;
e.consume(this);
}
ParamWidget::onButton(e);
}onDragMove method · cpp · L186-L206 (21 LOC)src/MADDYPlus.cpp
void onDragMove(const event::DragMove& e) override {
ParamQuantity* pq = getParamQuantity();
if (!pq) return;
accumDelta += (e.mouseDelta.x - e.mouseDelta.y);
float threshold = 30.0f;
if (accumDelta >= threshold) {
float currentValue = pq->getValue();
float newValue = clamp(currentValue + 1.0f, pq->getMinValue(), pq->getMaxValue());
pq->setValue(newValue);
accumDelta = 0.0f;
}
else if (accumDelta <= -threshold) {
float currentValue = pq->getValue();
float newValue = clamp(currentValue - 1.0f, pq->getMinValue(), pq->getMaxValue());
pq->setValue(newValue);
accumDelta = 0.0f;
}
}onDoubleClick method · cpp · L207-L213 (7 LOC)src/MADDYPlus.cpp
void onDoubleClick(const event::DoubleClick& e) override {
ParamQuantity* pq = getParamQuantity();
if (!pq) return;
pq->reset();
e.consume(this);
}OldWhiteKnob_UNUSED method · cpp · L220-L223 (4 LOC)src/MADDYPlus.cpp
OldWhiteKnob_UNUSED() {
box.size = Vec(30, 30);
}getDisplayAngle method · cpp · L224-L230 (7 LOC)src/MADDYPlus.cpp
float getDisplayAngle() {
ParamQuantity* pq = getParamQuantity();
if (!pq) return 0.0f;
float normalizedValue = pq->getScaledValue();
return rescale(normalizedValue, 0.0f, 1.0f, -0.75f * M_PI, 0.75f * M_PI);
}draw method · cpp · L231-L267 (37 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs& args) override {
float radius = box.size.x / 2.0f;
float angle = getDisplayAngle();
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgFillColor(args.vg, nvgRGB(30, 30, 30));
nvgFill(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGB(100, 100, 100));
nvgStroke(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 4);
nvgFillColor(args.vg, nvgRGB(255, 255, 255));
nvgFill(args.vg);
float indicatorLength = radius - 8;
float lineX = radius + indicatorLength * std::sin(angle);
float lineY = radius - indicatorLength * std::cos(angle);
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, radius, radius);
nvgLineTo(args.vg, lineX, lineY);
nvgStrokeWidth(args.vgonButton method · cpp · L268-L278 (11 LOC)src/MADDYPlus.cpp
void onButton(const event::Button& e) override {
if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = true;
e.consume(this);
}
else if (e.action == GLFW_RELEASE && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = false;
}
ParamWidget::onButton(e);
}Want fix-PRs on findings? Install Repobility's GitHub App · github.com/apps/repobility-bot
onDragMove method · cpp · L279-L290 (12 LOC)src/MADDYPlus.cpp
void onDragMove(const event::DragMove& e) override {
ParamQuantity* pq = getParamQuantity();
if (!isDragging || !pq) return;
float sensitivity = 0.002f;
float deltaY = -e.mouseDelta.y;
float range = pq->getMaxValue() - pq->getMinValue();
float currentValue = pq->getValue();
float newValue = clamp(currentValue + deltaY * sensitivity * range, pq->getMinValue(), pq->getMaxValue());
pq->setValue(newValue);
}onDoubleClick method · cpp · L291-L297 (7 LOC)src/MADDYPlus.cpp
void onDoubleClick(const event::DoubleClick& e) override {
ParamQuantity* pq = getParamQuantity();
if (!pq) return;
pq->reset();
e.consume(this);
}OldSmallGrayKnob_UNUSED method · cpp · L304-L307 (4 LOC)src/MADDYPlus.cpp
OldSmallGrayKnob_UNUSED() {
box.size = Vec(21, 21);
}getDisplayAngle method · cpp · L308-L314 (7 LOC)src/MADDYPlus.cpp
float getDisplayAngle() {
ParamQuantity* pq = getParamQuantity();
if (!pq) return 0.0f;
float normalizedValue = pq->getScaledValue();
return rescale(normalizedValue, 0.0f, 1.0f, -0.75f * M_PI, 0.75f * M_PI);
}draw method · cpp · L315-L351 (37 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs& args) override {
float radius = box.size.x / 2.0f;
float angle = getDisplayAngle();
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgFillColor(args.vg, nvgRGB(30, 30, 30));
nvgFill(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGB(100, 100, 100));
nvgStroke(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 3);
nvgFillColor(args.vg, nvgRGB(180, 180, 180));
nvgFill(args.vg);
float indicatorLength = radius - 6;
float lineX = radius + indicatorLength * std::sin(angle);
float lineY = radius - indicatorLength * std::cos(angle);
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, radius, radius);
nvgLineTo(args.vg, lineX, lineY);
nvgStrokeWidth(args.vgonButton method · cpp · L352-L362 (11 LOC)src/MADDYPlus.cpp
void onButton(const event::Button& e) override {
if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = true;
e.consume(this);
}
else if (e.action == GLFW_RELEASE && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = false;
}
ParamWidget::onButton(e);
}onDragMove method · cpp · L363-L374 (12 LOC)src/MADDYPlus.cpp
void onDragMove(const event::DragMove& e) override {
ParamQuantity* pq = getParamQuantity();
if (!isDragging || !pq) return;
float sensitivity = 0.002f;
float deltaY = -e.mouseDelta.y;
float range = pq->getMaxValue() - pq->getMinValue();
float currentValue = pq->getValue();
float newValue = clamp(currentValue + deltaY * sensitivity * range, pq->getMinValue(), pq->getMaxValue());
pq->setValue(newValue);
}onDoubleClick method · cpp · L375-L381 (7 LOC)src/MADDYPlus.cpp
void onDoubleClick(const event::DoubleClick& e) override {
ParamQuantity* pq = getParamQuantity();
if (!pq) return;
pq->reset();
e.consume(this);
}Repobility · code-quality intelligence platform · https://repobility.com
OldMediumGrayKnob_UNUSED method · cpp · L388-L391 (4 LOC)src/MADDYPlus.cpp
OldMediumGrayKnob_UNUSED() {
box.size = Vec(26, 26);
}getDisplayAngle method · cpp · L392-L398 (7 LOC)src/MADDYPlus.cpp
float getDisplayAngle() {
ParamQuantity* pq = getParamQuantity();
if (!pq) return 0.0f;
float normalizedValue = pq->getScaledValue();
return rescale(normalizedValue, 0.0f, 1.0f, -0.75f * M_PI, 0.75f * M_PI);
}draw method · cpp · L399-L435 (37 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs& args) override {
float radius = box.size.x / 2.0f;
float angle = getDisplayAngle();
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgFillColor(args.vg, nvgRGB(30, 30, 30));
nvgFill(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 1);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGB(100, 100, 100));
nvgStroke(args.vg);
nvgBeginPath(args.vg);
nvgCircle(args.vg, radius, radius, radius - 4);
nvgFillColor(args.vg, nvgRGB(130, 130, 130));
nvgFill(args.vg);
float indicatorLength = radius - 8;
float lineX = radius + indicatorLength * std::sin(angle);
float lineY = radius - indicatorLength * std::cos(angle);
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, radius, radius);
nvgLineTo(args.vg, lineX, lineY);
nvgStrokeWidth(args.vgonButton method · cpp · L436-L446 (11 LOC)src/MADDYPlus.cpp
void onButton(const event::Button& e) override {
if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = true;
e.consume(this);
}
else if (e.action == GLFW_RELEASE && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = false;
}
ParamWidget::onButton(e);
}onDragMove method · cpp · L447-L458 (12 LOC)src/MADDYPlus.cpp
void onDragMove(const event::DragMove& e) override {
ParamQuantity* pq = getParamQuantity();
if (!isDragging || !pq) return;
float sensitivity = 0.008f;
float deltaY = -e.mouseDelta.y;
float range = pq->getMaxValue() - pq->getMinValue();
float currentValue = pq->getValue();
float newValue = clamp(currentValue + deltaY * sensitivity * range, pq->getMinValue(), pq->getMaxValue());
pq->setValue(newValue);
}onDoubleClick method · cpp · L459-L465 (7 LOC)src/MADDYPlus.cpp
void onDoubleClick(const event::DoubleClick& e) override {
ParamQuantity* pq = getParamQuantity();
if (!pq) return;
pq->reset();
e.consume(this);
}WhiteBackgroundBox method · cpp · L469-L472 (4 LOC)src/MADDYPlus.cpp
WhiteBackgroundBox(Vec pos, Vec size) {
box.pos = pos;
box.size = size;
}draw method · cpp · L473-L483 (11 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs &args) override {
nvgBeginPath(args.vg);
nvgRect(args.vg, 0, 0, box.size.x, box.size.y);
nvgFillColor(args.vg, nvgRGB(255, 255, 255));
nvgFill(args.vg);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGBA(200, 200, 200, 255));
nvgStroke(args.vg);
}Same scanner, your repo: https://repobility.com — Repobility
SectionBox method · cpp · L487-L490 (4 LOC)src/MADDYPlus.cpp
SectionBox(Vec pos, Vec size) {
box.pos = pos;
box.size = size;
}draw method · cpp · L491-L498 (8 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs &args) override {
nvgBeginPath(args.vg);
nvgRect(args.vg, 0, 0, box.size.x, box.size.y);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGBA(255, 255, 255, 150));
nvgStroke(args.vg);
}VerticalLine method · cpp · L502-L505 (4 LOC)src/MADDYPlus.cpp
VerticalLine(Vec pos, Vec size) {
box.pos = pos;
box.size = size;
}draw method · cpp · L506-L514 (9 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs &args) override {
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, box.size.x / 2.0f, 0);
nvgLineTo(args.vg, box.size.x / 2.0f, box.size.y);
nvgStrokeWidth(args.vg, 0.5f);
nvgStrokeColor(args.vg, nvgRGBA(255, 255, 255, 150));
nvgStroke(args.vg);
}HorizontalLine method · cpp · L518-L521 (4 LOC)src/MADDYPlus.cpp
HorizontalLine(Vec pos, Vec size) {
box.pos = pos;
box.size = size;
}draw method · cpp · L522-L530 (9 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs &args) override {
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, 0, box.size.y / 2.0f);
nvgLineTo(args.vg, box.size.x, box.size.y / 2.0f);
nvgStrokeWidth(args.vg, 0.5f);
nvgStrokeColor(args.vg, nvgRGBA(255, 255, 255, 150));
nvgStroke(args.vg);
}getDisplayValueString method · cpp · L535-L539 (5 LOC)src/MADDYPlus.cpp
std::string getDisplayValueString() override {
float value = getValue();
int primaryKnobs = (value < 0.2f) ? 2 : (value < 0.4f) ? 3 : (value < 0.6f) ? 4 : 5;
return string::f("%d knobs", primaryKnobs);
}getLabel method · cpp · L540-L543 (4 LOC)src/MADDYPlus.cpp
std::string getLabel() override {
return "Density";
}Repobility · severity-and-effort ranking · https://repobility.com
getDisplayValueString method · cpp · L548-L552 (5 LOC)src/MADDYPlus.cpp
std::string getDisplayValueString() override {
float value = getValue();
int primaryKnobs = (value < 0.2f) ? 2 : (value < 0.4f) ? 3 : (value < 0.6f) ? 4 : 5;
return string::f("%d knobs", primaryKnobs);
}getLabel method · cpp · L553-L556 (4 LOC)src/MADDYPlus.cpp
std::string getLabel() override {
return "Ch2 Density";
}getDisplayValueString method · cpp · L560-L564 (5 LOC)src/MADDYPlus.cpp
std::string getDisplayValueString() override {
float value = getValue();
int primaryKnobs = (value < 0.2f) ? 2 : (value < 0.4f) ? 3 : (value < 0.6f) ? 4 : 5;
return string::f("%d knobs", primaryKnobs);
}getLabel method · cpp · L565-L568 (4 LOC)src/MADDYPlus.cpp
std::string getLabel() override {
return "Ch3 Density";
}getDisplayValueString method · cpp · L572-L581 (10 LOC)src/MADDYPlus.cpp
std::string getDisplayValueString() override {
int value = (int)std::round(getValue());
if (value > 0) {
return string::f("%dx", value + 1);
} else if (value < 0) {
return string::f("1/%dx", -value + 1);
} else {
return "1x";
}
}generateMADDYPlusEuclideanRhythm function · cpp · L583-L596 (14 LOC)src/MADDYPlus.cpp
std::vector<bool> generateMADDYPlusEuclideanRhythm(int length, int fill, int shift) {
std::vector<bool> pattern(length, false);
if (fill == 0 || length == 0) return pattern;
if (fill > length) fill = length;
for (int i = 0; i < fill; ++i) {
int index = (int)std::floor((float)i * length / fill);
pattern[index] = true;
}
std::rotate(pattern.begin(), pattern.begin() + shift, pattern.end());
return pattern;
}reset method · cpp · L713-L730 (18 LOC)src/MADDYPlus.cpp
void reset() {
dividedProgressSeconds = 0.0f;
dividerCount = 0;
shouldStep = false;
prevMultipliedGate = false;
currentStep = 0;
shift = 0;
pattern.clear();
gateState = false;
envelopePhase = IDLE;
envelopeOutput = 0.0f;
envelopePhaseTime = 0.0f;
lastDecayParam = -1.0f;
currentDecayTime = 1.0f;
lastUsedDecayParam = 0.3f;
justTriggered = false;
}applyCurve method · cpp · L731-L748 (18 LOC)src/MADDYPlus.cpp
float applyCurve(float x, float curvature) {
x = clamp(x, 0.0f, 1.0f);
if (curvature == 0.0f) {
return x;
}
float k = curvature;
float abs_x = std::abs(x);
float denominator = k - 2.0f * k * abs_x + 1.0f;
if (std::abs(denominator) < 1e-6f) {
return x;
}
return (x - k * x) / denominator;
}Want fix-PRs on findings? Install Repobility's GitHub App · github.com/apps/repobility-bot
updateDivMult method · cpp · L749-L762 (14 LOC)src/MADDYPlus.cpp
void updateDivMult(int divMultParam) {
divMultValue = divMultParam;
if (divMultValue > 0) {
division = 1;
multiplication = divMultValue + 1;
} else if (divMultValue < 0) {
division = -divMultValue + 1;
multiplication = 1;
} else {
division = 1;
multiplication = 1;
}
}processClockDivMult method · cpp · L763-L798 (36 LOC)src/MADDYPlus.cpp
bool processClockDivMult(bool globalClock, float globalClockSeconds, float sampleTime) {
dividedClockSeconds = globalClockSeconds * (float)division;
multipliedClockSeconds = dividedClockSeconds / (float)multiplication;
gateSeconds = std::max(0.001f, multipliedClockSeconds * 0.5f);
if (globalClock) {
if (dividerCount < 1) {
dividedProgressSeconds = 0.0f;
} else {
dividedProgressSeconds += sampleTime;
}
++dividerCount;
if (dividerCount >= division) {
dividerCount = 0;
}
} else {
dividedProgressSeconds += sampleTime;
}
shouldStep = false;
if (dividedProgressSeconds < dividedClockSeconds) {
float multipliedProgressSeconds = dividedProgressSeconds / multipliedClockSeconds;
multipliedPrstepTrack method · cpp · L799-L809 (11 LOC)src/MADDYPlus.cpp
void stepTrack() {
currentStep = (currentStep + 1) % length;
gateState = !pattern.empty() && pattern[currentStep];
if (gateState) {
trigPulse.trigger(0.001f);
envelopePhase = ATTACK;
envelopePhaseTime = 0.0f;
justTriggered = true;
}
}