RNBO tips n tricks - TheTechnobear/SSP GitHub Wiki
tricks for developing RNBO based modules
this does NOT cover how to use RNBO and build modules. that is covered here:
https://github.com/thetechnobear/rnbo.example.ssp
rather this is a grab bag of tips etc
rename input / outputs
RNBO currently does not allow us to name input and outputs. so unforunately, we just get generic names IN-1 OUT-1 etc. this makes it pretty difficult to use ...
but fortunately its easy to fix !
the approach Im showing is simple, aimed at non-programmers... not necesasarily the best c++ ;)
important note: we are going to be editing code that is overwritten if you ever use create_module.sh again. so, if you need to re-generate from the template... you'd be wise to save your changes! (just the bits of code you have changed, not the whole file!)
rename INPUTS
we need to edit one file , PluginProcessor.cpp
and you will find a method, called getInputBusName
, defined as follows
const String PluginProcessor::getInputBusName(int channelIndex) {
RNBO::CoreObject rnboObj_;
unsigned I_MAX = rnboObj_.getNumInputChannels();
if (channelIndex < I_MAX) { return "In " + String(channelIndex); }
return "ZZIn-" + String(channelIndex);
}
here we can see, the generic names.. that'll work for every module however, we are simply going to replace this with something very specific!
const String PluginProcessor::getInputBusName(int channelIndex) {
switch(channelIndex) {
case 0 : return "v/oct";
case 1 : return "trig";
case 2 : return "level";
default:
break;
}
return "In " + String(channelIndex);
}
basically, each input needs a case
statement, that turns the string you want to use for that numbered input.
important note: channels are counted from ZERO (0), not 1... so out~ 1
= 0 !
of course, there is no check that the name that you are using above, is what you are using it for ;) so care must be taken.
similarly, if you add inputs you will need to adjust this.
rename OUTPUTS
really this is the same process as INPUTS.
so, we need to edit one file , PluginProcessor.cpp
and this time you will find a method, called getOutputBusName
, defined as follows
const String PluginProcessor::getOutputBusName(int channelIndex) {
RNBO::CoreObject rnboObj_;
unsigned O_MAX = rnboObj_.getNumOutputChannels();
if (channelIndex < O_MAX) { return "Out " + String(channelIndex); }
return "ZZOut-" + String(channelIndex);
}
same procedure, as above, for each output we name it.
const String PluginProcessor::getOutputBusName(int channelIndex) {
switch(channelIndex) {
case 0 : return "audio L";
case 1 : return "audio R";
default:
break;
}
return "Out " + String(channelIndex);
}