I am working on a project where you can play a piano. I want to have the option to switch octaves using the arrow keys (octave stored as an int variable) and have that change what sound is played using another library (miniaudio). I have to be able to switch what happens when each key is pressed based on the current octave, but I can’t figure out how to do this.
Here is the code to play the note A5
input_manager.register_hotkey(GLFW_KEY_A, hotkey_type::key_down, [](int, float){
ma_sound_start(&a5);
});
If I change the octave in the program, I want this to switch so the part inside the manager is ma_sound_start(&a6)