Skip to content

Latest commit

 

History

History
111 lines (75 loc) · 2.97 KB

README.md

File metadata and controls

111 lines (75 loc) · 2.97 KB

pianika-c-SDL2

Pianika is a simple application that lets you play virtual piano keys using your keyboard. This application is built using SDL2, SDL_ttf, and SDL_mixer, and supports various instrument sounds that can be played with keyboard keys. image

⚠️ Disclaimer

The code in this repository is intended only for developers with a basic understanding of programming. Please use it responsibly and for development purposes only.

  • Not recommended for direct use in production environments without thorough testing.
  • No guarantees are provided regarding the absence of bugs or errors.
  • The author is not liable for any damages or issues caused

Features

  • Virtual Piano Keys: Play piano keys using the keyboard buttons A, S, D, F, G, H, J, K, L, M.
  • Visual Feedback: The piano keys change color when pressed to provide visual feedback.
  • Realistic Sounds: Each key has a unique sound, simulating a real piano experience.

Getting Started

To get started with Pianika, follow these steps:

Prerequisites

  • SDL2: Make sure you have SDL2 installed on your system.
  • SDL_ttf: This library is used for rendering text.
  • SDL_mixer: This library handles audio playback.
  • A C++ Compiler: Ensure you have a C++ compiler installed (like g++).

Installation

  1. Clone the Repository

    git clone https://github.com/Zreechxnn/pianika-c-SDL2.git
    cd pianika-c-SDL2
  2. Install Dependencies

    On Ubuntu-based systems, you can install the necessary libraries using:

    sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev

    On other systems, please refer to the respective package managers or build from source.

  3. Build the Project

    g++ -o pianika pianika.cpp -lSDL2 -lSDL2_mixer -lSDL2_ttf
  4. Run the Application

    ./pianika

Usage

  • Press the following keys to play different piano notes:

    • A - Do
    • S - Re
    • D - Mi
    • F - Fa
    • G - Sol
    • H - La
    • J - Si
    • K - Do (Stretched)
    • L - Fa (Stretched)
    • M - Sol (Stretched)
  • The keys will turn red when pressed and revert to black when released.

Assets

Make sure to place your sound files and font file in the assets directory:

  • do.wav
  • re.wav
  • mi.wav
  • fa.wav
  • sol.wav
  • la.wav
  • si.wav
  • do_stretched.wav
  • fa_stretched.wav
  • sol_stretched.wav
  • arial.ttf

Contributing

Feel free to fork the repository and submit pull requests for improvements or bug fixes. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or suggestions, please contact zreechxnn.


Enjoy playing the virtual piano with Pianika!


©️ 2024 Rechan Dinata