Skip to content

🎹 A lightweight, cross-platform piano synthesizer built from scratch in C99 with modern tooling (SDL3, CMake, Conan).

License

Notifications You must be signed in to change notification settings

hnthap/chip-piano

Repository files navigation

ChipPiano

License: MIT GitHub Stars

A lightweight, cross-platform piano synthesizer built from scratch in C99 with modern tooling.

 
ChipPiano Screenshot

ChipPiano is a simple but powerful digital piano simulator. It features polyphonic sound synthesis and a responsive visual keyboard, all rendered using the cross-platform SDL3 library.

Key Features

  • 🎶 Polyphonic Sound Synthesis: Play multiple notes simultaneously, generated in real-time.
  • 🎹 Interactive Visual Keyboard: A 46-key piano keyboard, from D3 to B6.
  • Low-Latency Audio: Built on the SDL3 audio API for responsive sound playback.
  • 🗂️ In-App Menu: A "menu bar" and information dialogs.
  • 🔊 Volume Control: Amplitude adjustment with up/down arrow keys.
  • 🚫 Automatic Note Stop on Focus Loss: All currently playing notes are automatically stopped when the window loses focus, ensuring no lingering sounds if you switch to another application.
  • 💻 Modern C99: Written with a focus on clarity, performance, and portability.
  • 🌍 Cross-Platform Build: Uses CMake and Conan for a streamlined and reliable build process on any platform.

Tech Stack

Getting Started

Follow these instructions to get a local copy up and running.

Prerequisites

Installation & Building

  1. Clone the repository:

    git clone https://github.com/hnthap/chip-piano.git
    cd chip-piano
  2. Install dependencies with Conan: This command downloads and builds the required libraries (SDL3, FreeType).

    conan install . --output-folder=build --build=missing
  3. Configure the project with CMake: This step generates the build files for your system.

    cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="build/build/Release/generators/conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
  4. Build the application:

    cmake --build build

Running the Application

You can run the executable directly from the build output directory or use the custom CMake target for convenience.

cmake --build build --target run

Usage & Keyboard Layout

ChipPiano Screenshot 2

ChipPiano maps your QWERTY keyboard to a 46-key piano (D3 → B6).
Play the lower octaves with Z–/, move up with A–RET, Q–], and 1–=.

Octave 3 (D3–B3)
PC Keys:   Z   X   C   V   B   N   M   ,   .   /
Notes:     D3  D#3 E3  F3  F#3 G3  G#3 A3  A#3 B3

Octave 4 (C4–B4)
PC Keys:   A   S   D   F   G   H   J   K   L   ;   '   RET
Notes:     C4  C#4 D4  D#4 E4  F4  F#4 G4  G#4 A4  A#4 B4

Octave 5 (C5–B5)
PC Keys:   Q   W   E   R   T   Y   U   I   O   P   \[   ]
Notes:     C5  C#5 D5  D#5 E5  F5  F#5 G5  G#5 A5  A#5 B5

Octave 6 (C6–B6)
PC Keys:   1   2   3   4   5   6   7   8   9   0   -   =
Notes:     C6  C#6 D6  D#6 E6  F6  F#6 G6  G#6 A6  A#6 B6

Other useful shortcuts:

Shortcut Action
F1 Shows About dialog
F2 Shows Help dialog
F12 Toggle visual key labels
ESC Quit/exit application
Up/Down Arrows Adjust volume

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

Support

If you find this project useful and want to support its development, thank you!

Donate with PayPal

Licenses

This project is licensed under MIT license. See LICENSE.txt for the full license text.

This project uses Noto Serif, which is licensed under the SIL Open Font License 1.1. See LICENSE-OFL.txt for the full license text.

About

🎹 A lightweight, cross-platform piano synthesizer built from scratch in C99 with modern tooling (SDL3, CMake, Conan).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages