Adruino
https://raw.githubusercontent.com/digistump/arduino-boards-index/master/package_digistump_index.json
ino
cd ~/Arduino/libraries/ git clone https://github.com/heartscrytech/DigisparkMIDI
A Morse code keyer with MIDI input and audio output, converted from Python to Rust.
Based on midicwkeyer.py by Christoph Berg DF7CB.
- MIDI input for paddle keying (dit/dah)
- Real-time audio tone generation (850 Hz)
- Automatic Morse code decoding and display
- Adjustable WPM (words per minute) via MIDI control change
- Cosine-ramped audio envelope for clean keying
- State machine-based iambic keyer logic
cargo build --releaseThe compiled binary will be at: target/release/midicwkeyer
cargo run --releaseOr directly:
./target/release/midicwkeyerThe program will list available MIDI ports and connect to the first one. You can modify the code to select a specific port.
- Note 1 (On/Off): Dit paddle
- Note 2 (On/Off): Dah paddle
- Control Change 61 (0x3D): WPM adjustment (6-48 WPM)
midir- MIDI input handlingcpal- Cross-platform audio I/O
From Linux, you can build for Windows using MSVC (recommended) or MinGW:
# Build for Windows with MSVC (RECOMMENDED - avoids antivirus issues)
cargo build --target x86_64-pc-windows-msvc --release
# Output: target/x86_64-pc-windows-msvc/release/midicwkeyer.exe (~365 KB)
# Alternative: Build with MinGW (may trigger antivirus false positives)
cargo build --target x86_64-pc-windows-gnu --release
# Output: target/x86_64-pc-windows-gnu/release/midicwkeyer.exe (~2.4 MB)Why MSVC? MSVC-compiled binaries are smaller, use standard Windows libraries, and are much less likely to trigger antivirus false positives.
For MSVC (recommended):
-
Install xwin (downloads Windows SDK):
cargo install xwin
-
Download MSVC SDK (one-time setup):
xwin --accept-license splat --output ~/.xwin -
Install LLD linker:
sudo apt install lld # Debian/Ubuntu sudo dnf install lld # Fedora/RHEL
For MinGW (alternative):
-
Install MinGW cross-compiler:
sudo apt install mingw-w64 # Debian/Ubuntu sudo dnf install mingw64-gcc mingw64-winpthreads-static # Fedora/RHEL
-
Add Windows target to Rust:
rustup target add x86_64-pc-windows-msvc # For MSVC rustup target add x86_64-pc-windows-gnu # For MinGW
The project includes .cargo/config.toml with all necessary linker configurations.
# Linux (native)
cargo build --release
# Windows MSVC (recommended - smaller, fewer AV issues)
cargo build --target x86_64-pc-windows-msvc --release
# Windows MinGW (alternative - larger, may trigger AV)
cargo build --target x86_64-pc-windows-gnu --release- Linux:
target/release/midicwkeyer - Windows (MSVC):
target/x86_64-pc-windows-msvc/release/midicwkeyer.exe✅ Recommended - Windows (MinGW):
target/x86_64-pc-windows-gnu/release/midicwkeyer.exe
The project includes a GitHub Actions workflow that automatically builds for macOS (both Intel and Apple Silicon).
Push to GitHub and the workflow will create binaries for:
- Linux x86_64
- macOS x86_64 (Intel)
- macOS aarch64 (Apple Silicon)
- Windows x86_64 (MSVC)
Artifacts are available in the Actions tab after each push.
If you have access to a Mac:
cargo build --releaseSee MACOS_CROSS_COMPILE.md for OSXCross setup (complex, not recommended).
| Platform | Build Method | Status |
|---|---|---|
| Linux x86_64 | Native | ✅ Working |
| Windows x86_64 (MSVC) | Cross-compile (xwin) | ✅ Working |
| Windows x86_64 (MinGW) | Cross-compile (mingw-w64) | ✅ Working |
| macOS x86_64 (Intel) | GitHub Actions | ✅ Automated |
| macOS aarch64 (M1/M2/M3) | GitHub Actions | ✅ Automated |