Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Audio Feedback for Piano Key Presses #2

Open
brylie opened this issue Jan 28, 2024 · 0 comments
Open

Implement Audio Feedback for Piano Key Presses #2

brylie opened this issue Jan 28, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@brylie
Copy link
Member

brylie commented Jan 28, 2024

⚠️ 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.
@brylie brylie added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant