For my experimentations I needed a way to change the base note that is played when you press a key on the PC keyboard and you use the keyboard widget. I didn’t want to change the octave you play when you play notes on a true midi-keyboard or when you click directly the notes in the keyboard widget… Just set the base octave that is played when you press a key on the PC keyboard. Then I noticed that Juce has a function for that:
void MidiKeyboardComponent::setKeyPressBaseOctave(int newOctaveNumber)
but in Cabbage that function is hard-coded to a value of 3 that isn’t always what I need. So I made some mods to add an identifier “keypressbaseoctave” to the keyboard widget that allows you to set the octave you want to use for the PC keyboard keys.
So you can do, for example:
<Cabbage>
...
keyboard bounds(10, 192, 581, 95) keypressbaseoctave(5) value(30) whitenotecolour(255, 255, 255, 255) ...
...
</Cabbage>
Of course, if you don’t use the ‘keypressbaseoctave’ identifier, the default value will remain 3. If you are interested I can make a pull request with my changes.
P.S.: according to the Juce documentation, the value you pass to keypressbaseoctave(…) has to be between 0 and 10. For now I have not made checks on the range and I don’t know what happens if you pass a value outside that range…