:warning: remember the scope of this project is to create a piano technique practice app and not a virtual piano instrument. So, we don't need to add too much realism to the piano sound (such as sustain or high-fidelity recordings.)
Description
Currently, the PianoDisplay application visually simulates a piano keyboard with MIDI input support, displaying key presses and releases. However, there is no audio feedback when keys are pressed. Implementing an audio feedback feature will significantly enhance the user experience by providing real-time auditory cues corresponding to the key presses, closely mimicking an actual piano.
Expected Behavior
When a piano key is pressed (MIDI note-on message received), the application should play a sound corresponding to the key's note.
The sound should cease immediately or fade out appropriately when the key is released (MIDI note-off message received).
Audio playback should be as latency-free as possible to ensure a realistic piano-playing experience.
Suggested Implementation
Utilize Godot's AudioStreamPlayer nodes to play back piano note samples.
Assign an audio sample to each key generated in the PianoDisplay.gd script.
Trigger the audio sample to play on note-on and stop on note-off events.
Consider using high-quality piano note samples to ensure a realistic sound.
Optionally, implement a feature to adjust the volume.
Requirements
Collection of piano note audio samples (preferably covering all the notes of the keyboard).
Modifications to the PianoDisplay.gd script to handle audio playback in addition to the current visual feedback.
Testing for performance and synchronization between audio and visual feedback, ensuring minimal latency.
Additional Considerations
Explore the possibility of dynamic velocity-based volume (i.e., louder sound for harder key presses based on MIDI velocity).
Investigate potential performance implications of playing multiple audio streams simultaneously and how to optimize it.
Impact
This feature will significantly improve the realism and interactivity of the PianoDisplay application.
It will also lay the groundwork for further enhancements, such as different instrument sounds or recording functionality.
:warning: remember the scope of this project is to create a piano technique practice app and not a virtual piano instrument. So, we don't need to add too much realism to the piano sound (such as sustain or high-fidelity recordings.)
Description
Currently, the
PianoDisplay
application visually simulates a piano keyboard with MIDI input support, displaying key presses and releases. However, there is no audio feedback when keys are pressed. Implementing an audio feedback feature will significantly enhance the user experience by providing real-time auditory cues corresponding to the key presses, closely mimicking an actual piano.Expected Behavior
Suggested Implementation
AudioStreamPlayer
nodes to play back piano note samples.PianoDisplay.gd
script.Requirements
PianoDisplay.gd
script to handle audio playback in addition to the current visual feedback.Additional Considerations
Impact
PianoDisplay
application.