Thank you for your interest in contributing to Browser Music! This document provides guidelines and instructions for contributing.
Be respectful and inclusive. We want this to be a welcoming community for everyone.
Before creating bug reports, please check existing issues. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Screenshots if applicable
- Browser and OS information
- Console errors if any
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Clear title and description of the feature
- Use case - why would this be useful?
- Mockups or examples if applicable
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test your changes thoroughly
- Commit with clear messages (
git commit -m 'Add amazing feature') - Push to your fork (
git push origin feature/amazing-feature) - Open a Pull Request
- Node.js (v16 or higher)
- npm or yarn
- Modern web browser (Chrome, Firefox, Safari, or Edge)
# Clone your fork
git clone https://github.com/YOUR_USERNAME/BrowserMusic.git
cd BrowserMusic
# Install dependencies
npm install
# Start dev server
npm run devsrc/
├── audio/ # Audio engines for instruments
├── components/ # React components
│ ├── Header/ # App header
│ ├── TR909/ # TR-909 components
│ └── TB303/ # TB-303 components
├── App.tsx # Main app component
└── main.tsx # Entry point
- Use TypeScript for all new code
- Define proper types and interfaces
- Avoid
anytype when possible - Use meaningful variable and function names
- Use functional components with hooks
- Keep components small and focused
- Extract reusable logic into custom hooks
- Use proper prop types
- Clean up audio nodes in useEffect cleanup
- Avoid creating audio nodes in render
- Use Tone.Transport for timing
- Handle audio context state properly
- Use CSS modules or scoped styles
- Follow BEM naming convention when appropriate
- Ensure responsive design (mobile, tablet, desktop)
- Test on different screen sizes
- Use clear, descriptive commit messages
- Start with a verb: "Add", "Fix", "Update", "Remove"
- Keep commits focused on single changes
- Reference issues when applicable
Before submitting a PR, test your changes:
- Works on desktop browsers (Chrome, Firefox, Safari)
- Works on mobile devices (iOS, Android)
- No console errors
- Audio works correctly
- Responsive design looks good
- Performance is acceptable
-
Always start audio context properly
await Tone.start()
-
Clean up audio nodes
useEffect(() => { const synth = new Tone.Synth() return () => synth.dispose() }, [])
-
Use Transport for sequencing
Tone.Transport.scheduleRepeat((time) => { // Your code }, '16n')
- Test with headphones and speakers
- Check for clicking/popping sounds
- Verify timing is accurate
- Test at different BPM values
- Check CPU usage
When adding new instruments or features:
- Create audio engine in
src/audio/ - Create UI components in
src/components/ - Add to main app if needed
- Update documentation
- Add examples to README
- Update README.md for new features
- Add JSDoc comments for complex functions
- Include usage examples
- Update CHANGELOG.md
Feel free to open an issue for:
- Questions about the codebase
- Discussion about features
- Help with development setup
By contributing, you agree that your contributions will be licensed under the MIT License.
Your contributions make Browser Music better for everyone. Thank you for taking the time to contribute!