Skip to content

JACK-aware drum machine with timeline-based pattern arrangement. Real-time audio, interactive editor, project persistence. Linux/Qt6/C++17.

License

Notifications You must be signed in to change notification settings

applebiter/beater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Beater - Drum Machine

A JACK-aware drum machine with timeline-based pattern arrangement for Linux.

Version Platform License

Features

  • 🎡 JACK Audio Integration - Real-time low-latency drum playback
  • 🎨 Interactive Timeline Editor - Drag, drop, resize regions with snap-to-grid
  • πŸ“Š Pattern Library - Groove, fill, and half-time patterns
  • 🎼 Dynamic Time Signatures - Right-click regions to change time signature
  • ⏱️ Tempo Control - 40-300 BPM with real-time adjustment
  • πŸ” Zoom Controls - Mouse wheel zoom (Ctrl+scroll) and toolbar buttons
  • ⌨️ Keyboard Shortcuts - Delete key to remove regions, standard shortcuts
  • πŸ’Ύ Project Persistence - Save/load projects in JSON format (.beater files)
  • 🎚️ Transport Controls - Play, stop, rewind with visual playhead
  • 🌍 Cross-Platform Sample Detection - Automatically finds samples in common locations
  • 🎨 Dark Theme UI - Professional modern interface
  • πŸ“ Playhead Control - Click to position, drag to scrub

Installation

Quick Start (Binary)

Download the latest release from Releases:

# Download and extract
wget https://github.com/applebiter/beater/releases/download/v0.1.0/beater
chmod +x beater

# Install dependencies
sudo apt install jackd2 qjackctl libqt6widgets6 libsndfile1

# Start JACK (use qjackctl or command line)
qjackctl &

# Run Beater
./beater

Building from Source

Dependencies

# Ubuntu/Debian
sudo apt-get install build-essential cmake git \
    libjack-jackd2-dev libsndfile1-dev \
    qt6-base-dev libqt6widgets6

# Arch Linux
sudo pacman -S base-devel cmake git jack2 libsndfile qt6-base

Compile

git clone https://github.com/applebiter/beater.git
cd beater
mkdir build
cd build
cmake ..
make -j$(nproc)

Run

# Start JACK first
qjackctl &

# Run from build directory
./src/beater

Usage

Getting Started

  1. Start JACK - Use qjackctl or start JACK manually
  2. Launch Beater - The application will auto-detect drum samples
  3. Drag Patterns - Drag pattern blocks from the palette to the timeline
  4. Edit Timeline - Click, drag, resize, and delete regions
  5. Change Time Signatures - Right-click regions to set custom time signatures
  6. Adjust Tempo - Use the tempo spinbox or type a value
  7. Play/Stop - Use transport controls or spacebar
  8. Save Projects - File β†’ Save (Ctrl+S)

Keyboard Shortcuts

  • Ctrl+N - New project
  • Ctrl+O - Open project
  • Ctrl+S - Save project
  • Ctrl+Shift+S - Save As
  • Ctrl+, - Settings
  • Delete or Backspace - Delete selected region
  • Ctrl+Scroll - Zoom timeline

Sample Configuration

Beater automatically searches for drum samples in:

  • /usr/share/hydrogen/data/drumkits/GMRockKit/
  • /usr/local/share/hydrogen/data/drumkits/GMRockKit/
  • ~/.hydrogen/data/drumkits/GMRockKit/
  • ./samples/ (relative to executable)

To add custom sample directories: File β†’ Settings

Project File Format

Projects are saved as JSON files with .beater extension:

{
  "version": 1,
  "name": "My Project",
  "patterns": [...],
  "tracks": [...],
  "instruments": [...],
  "meterChanges": [...]
}

Architecture

beater/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ domain/          # Core data structures
β”‚   β”‚   β”œβ”€β”€ TimeTypes    # Musical time, tempo, meter
β”‚   β”‚   β”œβ”€β”€ Pattern      # Note sequences
β”‚   β”‚   β”œβ”€β”€ Region       # Timeline blocks
β”‚   β”‚   β”œβ”€β”€ Track        # Arrangement lanes
β”‚   β”‚   β”œβ”€β”€ Instrument   # Sample mapping
β”‚   β”‚   └── Project      # Top-level document
β”‚   β”œβ”€β”€ engine/          # Audio processing
β”‚   β”‚   β”œβ”€β”€ JackAudioBackend  # JACK integration
β”‚   β”‚   β”œβ”€β”€ Sampler      # Sample playback
β”‚   β”‚   β”œβ”€β”€ Scheduler    # Event scheduling
β”‚   β”‚   └── Transport    # Playback control
β”‚   β”œβ”€β”€ ui/              # Qt6 interface
β”‚   β”‚   β”œβ”€β”€ MainWindow   # Main application window
β”‚   β”‚   β”œβ”€β”€ TimelineWidget    # Timeline editor
β”‚   β”‚   └── PatternPalette    # Pattern library
β”‚   β”œβ”€β”€ serialization/   # JSON save/load
β”‚   └── app/             # Main entry point
β”œβ”€β”€ tests/               # Unit tests
└── external/            # Third-party dependencies (nlohmann/json)

Technical Details

  • Language: C++17
  • UI Framework: Qt6 (6.4.2+)
  • Audio Backend: JACK Audio Connection Kit
  • Build System: CMake 3.16+
  • Sample Loading: libsndfile
  • Serialization: nlohmann/json
  • Time Resolution: 960 PPQ (Pulses Per Quarter note)

Troubleshooting

"Failed to load samples"

  • Install Hydrogen drum machine: sudo apt install hydrogen
  • Or configure custom sample directories in Settings

JACK Connection Issues

  • Ensure JACK is running: jack_lsp should list ports
  • Check JACK settings in qjackctl (try 48000 Hz, 256 frames)
  • Verify Beater appears in JACK connections

Qt6 Not Found

  • Ubuntu 22.04+: sudo apt install qt6-base-dev
  • Older Ubuntu: Add Qt6 PPA or build from source

Contributing

Contributions welcome! Areas for improvement:

  • Windows/Mac audio backend support
  • Additional pattern types
  • MIDI I/O
  • LV2 plugin hosting
  • Improved sample management

License

MIT License - see LICENSE file for details.

Free to use, modify, and distribute.

Credits

  • Inspired by Hydrogen Drum Machine
  • Uses JACK Audio Connection Kit
  • Qt6 framework for UI

Links


Note: This is an early release focused on Linux with JACK. Windows/Mac support and additional features are planned for future releases.

About

JACK-aware drum machine with timeline-based pattern arrangement. Real-time audio, interactive editor, project persistence. Linux/Qt6/C++17.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published