Chordlock

Installation

Get Chordlock running on your system.

Prerequisites

CLI Installation

macOS/Linux

git clone https://github.com/kurogedelic/Chordlock.git
cd Chordlock

# Build CLI
g++ -std=c++17 -O2 -I./src -I./src/engines -I./src/interfaces \
    -I./src/processors -I./src/utils src/cli_main.cpp src/Chordlock.cpp \
    src/engines/EnhancedHashLookupEngine.cpp src/processors/VelocityProcessor.cpp \
    -o build/chordlock -framework CoreMIDI -framework CoreFoundation

# Test installation
./build/chordlock -N 60,64,67 -k C

Windows

git clone https://github.com/kurogedelic/Chordlock.git
cd Chordlock

# Build with MSVC
cl /std:c++17 /O2 /I.\src /I.\src\engines /I.\src\interfaces \
   /I.\src\processors /I.\src\utils src\cli_main.cpp src\Chordlock.cpp \
   src\engines\EnhancedHashLookupEngine.cpp src\processors\VelocityProcessor.cpp \
   /Fe:build\chordlock.exe

# Test installation
.\build\chordlock.exe -N 60,64,67 -k C

WebAssembly Build

# Install Emscripten first
# https://emscripten.org/docs/getting_started/downloads.html

# Build WebAssembly module
emcc -std=c++17 -O2 -I./src -I./src/engines -I./src/interfaces \
     -I./src/processors -I./src/utils src/chordlock_wasm.cpp src/Chordlock.cpp \
     src/engines/EnhancedHashLookupEngine.cpp src/processors/VelocityProcessor.cpp \
     -o web_app/chordlock.js -s EXPORTED_RUNTIME_METHODS='["ccall"]' \
     -s MODULARIZE=1 -s EXPORT_NAME="ChordlockModule"

MCP Integration

Install MCP Server

npm install -g @kurogedelic/chordlock-mcp

Configure Claude Desktop

Add to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "chordlock": {
      "command": "npx",
      "args": ["@kurogedelic/chordlock-mcp"]
    }
  }
}

Configure Claude Code

Add to your Claude Code MCP settings:

{
  "mcpServers": {
    "chordlock": {
      "command": "node",
      "args": ["/path/to/Chordlock/chordlock-mcp/dist/index.js"]
    }
  }
}

Docker Installation

FROM emscripten/emsdk:latest

WORKDIR /chordlock
COPY . .

# Build CLI
RUN g++ -std=c++17 -O2 -I./src -I./src/engines -I./src/interfaces \
    -I./src/processors -I./src/utils src/cli_main.cpp src/Chordlock.cpp \
    src/engines/EnhancedHashLookupEngine.cpp src/processors/VelocityProcessor.cpp \
    -o build/chordlock

# Build WebAssembly  
RUN emcc -std=c++17 -O2 -I./src -I./src/engines -I./src/interfaces \
    -I./src/processors -I./src/utils src/chordlock_wasm.cpp src/Chordlock.cpp \
    src/engines/EnhancedHashLookupEngine.cpp src/processors/VelocityProcessor.cpp \
    -o web_app/chordlock.js -s EXPORTED_RUNTIME_METHODS='["ccall"]' \
    -s MODULARIZE=1 -s EXPORT_NAME="ChordlockModule"

EXPOSE 3000
CMD ["./build/chordlock", "-h"]

Verification

Test your installation:

# CLI functionality
./build/chordlock -N 60,64,67 -k C
# Expected: C (confidence: 21.87) [I]

# Key context analysis  
./build/chordlock -N 52,60,64,67,74 -k C
./build/chordlock -N 52,60,64,67,74 -k Em
# Should show different chord interpretations

# Degree generation
./build/chordlock -d "V7" -k C
# Expected: G7 [55, 59, 62, 65]

# WebAssembly (open in browser)
open web_app/index.html

Troubleshooting

Common Issues

Compilation errors:

WebAssembly build fails:

MCP not working:

MIDI not working (macOS):

Platform-Specific Notes

macOS:

Linux:

Windows:

Next Steps