Mellotron is a simple piano synthesizer application built using SDL2 and SDL_mixer. It allows users to play notes using their keyboard, providing an interactive experience for music creation. The project aims to deliver a lightweight and easy-to-use interface for both beginners and experienced musicians.
- Keyboard Input: Play notes using the keyboard.
- Octave Control: Change octaves to access a wider range of notes.
- Sustain Functionality: Hold notes using the sustain feature.
- Dynamic Sound Resampling: Adjust the pitch of notes in real-time.
- Visual Representation: Display piano keys that respond to user input.
Mellotron uses SDL2 for rendering graphics and handling input, while SDL_mixer is utilized for audio playback. The application maps keyboard keys to piano notes, allowing users to play sounds by pressing corresponding keys. The sound is dynamically resampled to adjust the pitch based on the selected octave. The visual representation of the piano keys changes color when pressed, providing immediate feedback to the user.
To install Mellotron, follow these steps:
-
Install dependencies: Ensure you have SDL2, SDL2_mixer, and SDL2_ttf installed. You can install them via your package manager.
For example, on Ubuntu:
sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev
On macOS:
brew install sdl2 sdl2_mixer sdl2_ttf
-
Build the project:
./autogen.sh ./configure make
-
Run the application:
./mellotron
- Use the following keys to play notes:
- White keys:
a,s,d,f,g,h,j - Black keys:
w,e,t,y,u
- White keys:
- Press
zto decrease the octave andxto increase it. - Press
Tabto toggle sustain on and off.
Contributions are welcome! If you would like to contribute to Mellotron, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Make your changes and commit them (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.