Help with MidiKeyboardComponent

Hi All,
I’ve been tinkering with JUCE (5.4.7) for a little while but my C++ knowledge is not great. I’ve been through several tutorials and managed OK thus far, but now I’m trying to create a plugin which uses the on-screen MidiKeyboard component. I have managed to set it up OK so it displays a range of notes from 48 to 77 but I’m now trying to implement an octave switch and would like to programmatically change the range so that I always have the same number of keys showing (2 octaves) without scroll bars. The keyboard component is declared and set up in the PluginEditor.cpp file so my question is how can I access the component from another class?
I hope I have explained my problem correctly!