# FCB1010 Looper Pedal - Project Specification

## System Overview

A looper pedal system using a modified Behringer FCB1010 MIDI foot controller, Behringer UMC404HD audio interface, Raspberry Pi with TFT display (215x135mm).
The system provides a 5x5 matrix of loop tracks organized in columns and rows, with real-time visual feedback.

## Hardware Components

- **Behringer FCB1010**: MIDI foot controller with 10 footswitches (1-10), UP/DOWN buttons, and 2 expression pedals
- **Behringer UMC404HD**: Audio interface for input/output
- **Single Board Computer**: Running Linux
- **TFT Display**: 215x135mm color display, no touchscreen
- **Audio**: JACK audio connect kit

## System Architecture

### Two-State Operation
1. **Menu State**: Configuration and management functions
2. **Performance State**: Recording and playback matrix

### Matrix Organization
- **5 Columns**: Synchronized recording and playback for each column
- **5 Rows**: Individual tracks within each column
- **25 Total Cells**: Each cell can contain one audio loop
- **Column-based Timing**: First recording in a column sets the beat count for all tracks in that column

## Interface Design
- **Metronome**: Moving indicator that pulses when in center
- **Progress Bars**: Show current position in each column with beat divisions

  First recording behavior:
  - Progress bar fills during beat 1, then stays full
  - Additional beats appear as sliding segments (right-to-left)
- **Active Row**: Increased border with
- **Selected Cell**: Switched border and background color
- **Track States**:
  - `---`: Empty cell (dark background)
  - `READY`: Recorded, ready to play (green)
  - `PLAY`: Currently playing (blue)
  - `REC`: Currently recording (red)
  - `SOLO`: Solo mode active (orange/amber)
- **Volume Bars**: Small bars under each cell showing track volume

## Button Mappings

### Menu State
- **Button 1**: Tap Tempo
- **Button 2**: Enable/Disable Click Track
- **Button 3**: Not used
- **Button 4**: Not used
- **Button 5**: Clear current column
- **Buttons 6-10**: Column selection (1-5)
- **UP/DOWN**: Switch to Performance Mode
- **Expression Pedal A**: Click track volume
- **Expression Pedal B**: Master volume

### Performance State
- **Button 1**: Record/Arm
- **Button 2**: Play/Mute current track
- **Button 3**: Solo current track
- **Button 4**: Overdub on current track
- **Button 5**: Clear current track
- **Buttons 6-10**: Column selection (1-5)
- **UP/DOWN**: Navigate rows (switch between track rows), return to Menu when at top or bottom
- **Expression Pedal A**: Current track volume
- **Expression Pedal B**: Master volume

## Operational Behavior

### Recording Workflow
- **First Recording in Column**: Sets beat count for entire column, records until stopped
- **Subsequent Recordings**: Auto-sync to established column length
- **Record Button Stop**: Recording stops, cell starts playing
- **Stop Button Stop**: Recording cancelled, previous state restored
- **Overdub Button Stop**: Recording continues for next loop, overdubs on previous content

### Timing and Synchronization
- **All actions sync to the beat**: Start/stop occurs at metronome center position
- **Column Switching**: Only when not recording, immediate switching to selected column
- **Tempo Changes**: Only allowed when all tracks are cleared
- **Recording Start**: Synced to column start if column playing, otherwise next beat

### Solo Functionality
- **Solo Activation**: Press Solo button on any track
- **Solo Indication**: Cell shows `SOLO` state in orange/amber color
- **Multiple Solo**: Additional tracks can be added to solo group
- **Solo Play**: Activates solo tracks + any tracks showing `PLAY` state
- **Solo Stop**: Stops entire column
- **All Solo Actions**: Synced to next beat

### MIDI Implementation

- **Startup**: Send SysEx configuration to FCB1010 for proper button/pedal mapping
- **Expression Pedals**: Set volume on change
- **MIDI Feedback**: Send click track to sync with other systems

### State Management

- **Startup Behavior**: Load last audio tracks and configure FCB1010
- **Column Consistency**: Recordings automatically match column beat count
- **State Validation**: Prevent invalid operations (e.g., switching columns while recording)