Thank you for your interest in contributing to Amplitron! This document provides guidelines and instructions for contributing.
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Check if the bug has already been reported in Issues
- If not, create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Your OS, audio interface, and Amplitron version
- Any error messages or logs
- Check existing issues and discussions
- Create a new issue with the
enhancementlabel - Describe the feature and its use case
- Explain how it would benefit users
- Fork the repository
- Create a branch from
develop:git checkout -b feature/your-feature-name develop
2.5. Set Up Pre-commit Hooks (Crucial for C++ & Formatting)
We enforce strict formatting rules using pre-commit and clang-format. You must set this up before committing code.
# Install the pre-commit tool (requires Python)
pip install pre-commit
# Install the git hook scripts in your local repository
pre-commit installNow, clang-format will automatically check and format your C++ files every time you run git commit.
- Make your changes:
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
- Test your changes:
cd build ./amplitron-tests - Commit with clear messages:
git commit -m "Add feature: description" - Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request on GitHub
- C++17 compiler (GCC 8+, Clang 7+, MSVC 2019+)
- CMake 3.16+
- PortAudio
- SDL2
- OpenGL
See README.md for platform-specific build instructions.
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make amplitron-tests
./amplitron-testsAll tests must pass before submitting a PR (105+ unit tests + Playwright e2e tests in tests/web/).
-
Follow Google C++ Style Guide for all
.cpp,.h,.cc, and.hppfiles. -
Ensure strict adherence to our formatting rules using
clang-format. -
Use modern C++ features where applicable but maintain performance and memory safety.
-
Indentation: 4 spaces (no tabs)
-
Naming:
- Classes:
PascalCase - Functions/methods:
snake_case - Variables:
snake_case - Constants:
UPPER_SNAKE_CASE - Private members:
trailing_underscore_
- Classes:
-
Braces: Opening brace on same line
-
Comments: Use
//for single-line,/* */for multi-line -
Headers: Use
#pragma once
class AudioEffect {
public:
void process(float* buffer, int num_samples);
void set_enabled(bool enabled) { enabled_ = enabled; }
private:
bool enabled_ = true;
float mix_ = 1.0f;
};- Write tests for all new features
- Ensure existing tests still pass
- Test edge cases and error conditions
- Use the test framework in
tests/test_framework.h
TEST(effect_processes_without_nan) {
Overdrive od;
od.set_sample_rate(48000);
od.reset();
float buf[512];
fill_sine(buf, 512, 440.0f, 48000);
od.process(buf, 512);
ASSERT_TRUE(buffer_is_finite(buf, 512));
}- Create header and source in
src/audio/effects/ - Inherit from
Effectbase class - Implement required methods:
process(float* buffer, int num_samples)set_sample_rate(int sample_rate)reset()name()params()
- Add effect color to
src/gui/theme.h - Register in
PresetManager::create_effect()(src/preset_manager.cpp) - Add source files to
APP_SOURCESandCORE_SOURCESinCMakeLists.txt - Add tests in
tests/test_effects.cpp - Include the header in
src/main.cppif it should appear in the default chain
- Update README.md for user-facing changes
- Add inline comments for complex algorithms
- Document public APIs with clear descriptions
- Update CHANGELOG.md (if exists)
Use clear, descriptive commit messages:
Add: New feature descriptionFix: Bug descriptionUpdate: Change descriptionRefactor: Code improvement descriptionTest: Test addition/modificationDocs: Documentation updateci: setup clang-format pre-commit hook and workflows – CI/CD or automation changes.
- Open a Discussion
- Email: sudmondal2002@gmail.com
Thank you for contributing to Amplitron! 🎸