-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] 8 CV input expander for parameters (Ildaeil, Carla plugin host) #88
Open
Simon-L
wants to merge
8
commits into
DISTRHO:main
Choose a base branch
from
Simon-L:ildaeil-expander-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1a400d8
WIP: Initial Expander module code
ecc4569
Fix dsp parameter not updated
cea5099
Disable slider (non-interactive) if input is connected in expander
6dc4f69
Move expander code to process()
c2a8ade
Remove NaN as initial value for expander message and use 0.0 instead
a28bb03
Nit: missed a NaN initial value, removed
2a4cb09
First pass at making expander generic. Renamed, now works with Carla …
1acf54c
Base class needs virtual destructor
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
//Expander module for Ildaeil | ||
// | ||
//Based on code from GateSeq64 and GateSeq64Expander by Marc Boulé | ||
//Adapted for Ildaeil by Simon-L | ||
|
||
#include "plugin.hpp" | ||
|
||
static const unsigned int ildaeil_expanderRefreshStepSkips = 4; | ||
|
||
struct IldaeilExpIn8 : Module { | ||
enum InputIds { | ||
PARAM1_INPUT, | ||
PARAM2_INPUT, | ||
PARAM3_INPUT, | ||
PARAM4_INPUT, | ||
PARAM5_INPUT, | ||
PARAM6_INPUT, | ||
PARAM7_INPUT, | ||
PARAM8_INPUT, | ||
NUM_INPUTS | ||
}; | ||
|
||
// Expander | ||
float rightMessages[2][2] = {};// messages from Ildaeil | ||
|
||
unsigned int expanderRefreshCounter = 0; | ||
|
||
IldaeilExpIn8() { | ||
config(0, NUM_INPUTS, 0, 0); | ||
|
||
rightExpander.producerMessage = rightMessages[0]; | ||
rightExpander.consumerMessage = rightMessages[1]; | ||
|
||
configInput(PARAM1_INPUT, "Parameter 1"); | ||
configInput(PARAM2_INPUT, "Parameter 2"); | ||
configInput(PARAM3_INPUT, "Parameter 3"); | ||
configInput(PARAM4_INPUT, "Parameter 4"); | ||
configInput(PARAM5_INPUT, "Parameter 5"); | ||
configInput(PARAM6_INPUT, "Parameter 6"); | ||
configInput(PARAM7_INPUT, "Parameter 7"); | ||
configInput(PARAM8_INPUT, "Parameter 8"); | ||
|
||
} | ||
|
||
|
||
void process(const ProcessArgs &args) override { | ||
bool ildaeilPresent = (rightExpander.module && rightExpander.module->model == modelIldaeil); | ||
if (ildaeilPresent) { | ||
float *messagesToIldaeil = (float*)rightExpander.module->leftExpander.producerMessage; | ||
for (int i = 0; i < NUM_INPUTS; i++) { | ||
messagesToIldaeil[i] = (inputs[i].isConnected() ? inputs[i].getVoltage() : std::numeric_limits<float>::quiet_NaN()); | ||
} | ||
rightExpander.module->leftExpander.messageFlipRequested = true; | ||
} | ||
}// process() | ||
}; | ||
|
||
|
||
struct IldaeilExpIn8Widget : ModuleWidget { | ||
IldaeilExpIn8Widget(IldaeilExpIn8 *module) { | ||
setModule(module); | ||
|
||
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/IldaeilExpIn8.svg"))); | ||
box.size = Vec(RACK_GRID_WIDTH * 2, RACK_GRID_HEIGHT); | ||
|
||
// Screws | ||
addChild(createWidget<ScrewBlack>(Vec(0, 0))); | ||
addChild(createWidget<ScrewBlack>(Vec(0, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); | ||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0))); | ||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); | ||
|
||
// Inputs | ||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 75), module, IldaeilExpIn8::PARAM1_INPUT)); | ||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 105), module, IldaeilExpIn8::PARAM2_INPUT)); | ||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 135), module, IldaeilExpIn8::PARAM3_INPUT)); | ||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 165), module, IldaeilExpIn8::PARAM4_INPUT)); | ||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 195), module, IldaeilExpIn8::PARAM5_INPUT)); | ||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 225), module, IldaeilExpIn8::PARAM6_INPUT)); | ||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 255), module, IldaeilExpIn8::PARAM7_INPUT)); | ||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 285), module, IldaeilExpIn8::PARAM8_INPUT)); | ||
} | ||
|
||
}; | ||
|
||
Model *modelIldaeilExpIn8 = createModel<IldaeilExpIn8, IldaeilExpIn8Widget>("IldaeilExpIn8"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@falkTX I'm unsure about that part, if there's a more elegant way. How does that look to you? From my test and understanding of this module, both
ui->values[]
and call tocarla_set_parameter_value
have to be updated to the new value in order to update both the DSP and the UI.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this should be done in a different way, I will handle it soon