# Acapella — Setup Guide

## Creating the Xcode Project

Since this code was generated outside of Xcode, you'll need to create a project and add the source files. Here's the quickest path:

### Option 1: Create Project in Xcode (Recommended)

1. Open Xcode → File → New → Project
2. Choose **macOS → App**
3. Settings:
   - Product Name: **Acapella**
   - Team: your team (or None for personal use)
   - Organization Identifier: **com.acapella**
   - Interface: **SwiftUI**
   - Language: **Swift**
   - Uncheck "Include Tests" (we'll add later)
4. Save the project somewhere convenient
5. **Delete** the auto-generated `ContentView.swift` (we have our own MainWindow)
6. **Delete** the auto-generated `AcapellaApp.swift` (we have our own)
7. Drag the following folders from this directory into the Xcode project navigator:
   - `Acapella/Models/`
   - `Acapella/Parsing/`
   - `Acapella/Audio/`
   - `Acapella/SheetMusic/`
   - `Acapella/UI/`
   - `Acapella/Bundle/`
   - `Acapella/Utilities/`
   - `Acapella/AcapellaApp.swift`
   - `Acapella/Info.plist`
8. When dragging, choose **"Create groups"** and make sure **"Add to target: Acapella"** is checked

### Option 2: Use the Terminal

```bash
cd /path/to/this/directory
# Create a new Xcode project using xcodegen or manually
# Then add source files as above
```

## Project Settings

After adding files, verify these settings:

1. **Deployment Target**: macOS 13.0+
2. **Info.plist**: Point to `Acapella/Info.plist` in Build Settings → Packaging → Info.plist File
3. **Signing**: Enable "Automatically manage signing"
4. **Capabilities**:
   - Audio Input (for microphone recording)
   - App Sandbox → Audio Input = YES

## Running

1. Build and Run (Cmd+R)
2. Use File → Open Song to load a `.txt` song file from the `Samples/` folder
3. The sheet music should render in the main window

## Sample Files

The `Samples/` directory contains test song files:
- `simple_round.txt` — Row Row Row Your Boat as a 2-part round
- `harmony_test.txt` — Simple SATB harmony in G major

## File Format Reference

```
Line 1: Song Title
Line 2: TimeSignature, Key, Tempo  (e.g., "4/4, C major, 120 bpm")
Line 3+: PartName Note1 Dur1 Note2 Dur2 ...

Notes: C4, F#5, Bb3, R (rest)
Durations: 1 (whole), 2 (half), 4 (quarter), 8 (eighth), 16 (sixteenth)
Dotted: append period (e.g., "2." = dotted half)
```
