Skip to content

Commit 7bd0639

Browse files
2 parents b97751b + eb2d0c1 commit 7bd0639

40 files changed

Lines changed: 3019 additions & 1233 deletions

.github/workflows/ci.yml

Lines changed: 571 additions & 568 deletions
Large diffs are not rendered by default.

.github/workflows/deploy-preview.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Resolve PR number from head branch
4040
id: resolve-pr
41-
uses: actions/github-script@v8
41+
uses: actions/github-script@v9
4242
with:
4343
script: |
4444
const headSha = '${{ github.event.workflow_run.head_sha }}';
@@ -99,7 +99,7 @@ jobs:
9999
100100
- name: Check pull request state
101101
id: pr-state
102-
uses: actions/github-script@v8
102+
uses: actions/github-script@v9
103103
with:
104104
script: |
105105
const { owner, repo } = context.repo;
@@ -124,7 +124,7 @@ jobs:
124124

125125
- name: Comment preview URL on PR
126126
if: steps.pr-state.outputs.state == 'open'
127-
uses: actions/github-script@v8
127+
uses: actions/github-script@v9
128128
env:
129129
PR_NUMBER: ${{ steps.preview-meta.outputs.pr_number }}
130130
PREVIEW_URL: ${{ steps.preview-meta.outputs.preview_url }}
@@ -207,7 +207,7 @@ jobs:
207207
208208
- name: Comment cleanup on PR
209209
if: steps.pages-checkout.outcome == 'success'
210-
uses: actions/github-script@v8
210+
uses: actions/github-script@v9
211211
with:
212212
script: |
213213
const marker = '<!-- amplitron-pr-preview -->';

CMakeLists.txt

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ else()
3232
endif()
3333
endif()
3434

35+
# --- nlohmann/json (header-only, fetched at configure time) ----------------
36+
# Single-header C++17 JSON library used for preset serialization /
37+
# deserialization. We disable nlohmann's own tests and install rules so
38+
# they don't pollute the Amplitron build.
39+
include(FetchContent)
40+
FetchContent_Declare(
41+
nlohmann_json
42+
GIT_REPOSITORY https://github.com/nlohmann/json.git
43+
GIT_TAG v3.11.3
44+
GIT_SHALLOW TRUE
45+
)
46+
set(JSON_BuildTests OFF CACHE INTERNAL "Disable nlohmann/json tests")
47+
set(JSON_Install OFF CACHE INTERNAL "Disable nlohmann/json install")
48+
FetchContent_MakeAvailable(nlohmann_json)
49+
# ---------------------------------------------------------------------------
50+
3551
# --- Dependencies ---
3652
# Emscripten provides SDL2, OpenGL ES, and audio via built-in ports.
3753
# Native builds find PortAudio, SDL2, and OpenGL from the system.
@@ -151,6 +167,7 @@ set(APP_SOURCES
151167
src/audio/effects/equalizer.cpp
152168
src/audio/effects/noise_gate.cpp
153169
src/audio/effects/compressor.cpp
170+
src/audio/effects/looper.cpp
154171
src/audio/effects/cabinet_sim.cpp
155172
src/audio/effects/ir_cabinet.cpp
156173
src/audio/effects/amp_simulator.cpp
@@ -274,6 +291,8 @@ if(EMSCRIPTEN)
274291
# OpenGL ES 3 for ImGui's OpenGL3 backend on WebGL 2
275292
target_compile_definitions(Amplitron PRIVATE IMGUI_IMPL_OPENGL_ES3 AMPLITRON_VERSION="${AMPLITRON_VERSION}" AMPLITRON_NO_MIDI)
276293

294+
target_link_libraries(Amplitron PRIVATE nlohmann_json::nlohmann_json)
295+
277296
# Emscripten linker flags for Web Audio + AudioWorklet + SharedArrayBuffer
278297
target_link_options(Amplitron PRIVATE
279298
"-sWASM=1"
@@ -341,8 +360,9 @@ elseif(ANDROID)
341360
target_include_directories(main PRIVATE ${OBOE_INCLUDE_DIRS})
342361

343362
target_link_libraries(main PRIVATE
344-
${OBOE_LIBRARIES} # Google Oboe (AAudio/OpenSL ES low-latency)
345-
SDL2::SDL2-static # Still used for display / ImGui rendering
363+
nlohmann_json::nlohmann_json
364+
${OBOE_LIBRARIES}
365+
SDL2::SDL2-static
346366
android
347367
log
348368
EGL
@@ -380,6 +400,7 @@ elseif(IOS)
380400
)
381401

382402
target_link_libraries(Amplitron PRIVATE
403+
nlohmann_json::nlohmann_json
383404
SDL2::SDL2main
384405
SDL2::SDL2-static
385406
"-framework UIKit"
@@ -430,9 +451,16 @@ else() # NOT EMSCRIPTEN, ANDROID, or IOS
430451
${RTMIDI_INCLUDE_DIRS}
431452
)
432453

433-
target_compile_definitions(Amplitron PRIVATE AMPLITRON_VERSION="${AMPLITRON_VERSION}")
454+
# ============================================================
455+
# DEFINE AMPLITRON_HAS_MIDI FOR DESKTOP BUILDS
456+
# ============================================================
457+
target_compile_definitions(Amplitron PRIVATE
458+
AMPLITRON_VERSION="${AMPLITRON_VERSION}"
459+
AMPLITRON_HAS_MIDI
460+
)
434461

435462
target_link_libraries(Amplitron PRIVATE
463+
nlohmann_json::nlohmann_json
436464
${PORTAUDIO_LIBRARIES}
437465
${SDL2_LIBRARIES}
438466
${OPENGL_LIBRARIES}
@@ -458,7 +486,9 @@ else() # NOT EMSCRIPTEN, ANDROID, or IOS
458486
tests/test_common.cpp
459487
tests/test_oboe_ring_buffer.cpp
460488
tests/test_effects.cpp
489+
tests/test_looper.cpp
461490
tests/test_preset_manager.cpp
491+
tests/test_json_serialization.cpp
462492
tests/test_recorder.cpp
463493
tests/test_theme.cpp
464494
tests/test_command_history.cpp
@@ -496,6 +526,7 @@ else() # NOT EMSCRIPTEN, ANDROID, or IOS
496526
src/audio/effects/equalizer.cpp
497527
src/audio/effects/noise_gate.cpp
498528
src/audio/effects/compressor.cpp
529+
src/audio/effects/looper.cpp
499530
src/audio/effects/cabinet_sim.cpp
500531
src/audio/effects/ir_cabinet.cpp
501532
src/audio/effects/amp_simulator.cpp
@@ -529,7 +560,13 @@ else() # NOT EMSCRIPTEN, ANDROID, or IOS
529560
${RTMIDI_INCLUDE_DIRS}
530561
)
531562

563+
# ============================================================
564+
# DEFINE AMPLITRON_HAS_MIDI FOR TEST BUILDS
565+
# ============================================================
566+
target_compile_definitions(amplitron-tests PRIVATE AMPLITRON_HAS_MIDI)
567+
532568
target_link_libraries(amplitron-tests PRIVATE
569+
nlohmann_json::nlohmann_json
533570
${PORTAUDIO_LIBRARIES}
534571
${SDL2_LIBRARIES}
535572
${OPENGL_LIBRARIES}
@@ -567,4 +604,4 @@ else() # NOT EMSCRIPTEN, ANDROID, or IOS
567604
install(DIRECTORY presets DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/amplitron)
568605
install(DIRECTORY assets/fonts DESTINATION bin/assets)
569606

570-
endif() # EMSCRIPTEN / ANDROID / IOS / desktop
607+
endif() # EMSCRIPTEN / ANDROID / IOS / desktop

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ make build
245245
# Windows
246246
.\build\Release\amplitron.exe
247247
```
248+
### Command-line options
249+
| Flag | Description |
250+
|------|-------------|
251+
| `-h`, `--help` | Print usage and exit |
252+
| `-v`, `--version` | Print version and exit |
248253

249254
### Controls
250255
- **Menu Bar** → File → Settings to configure audio devices, buffer size, and sample rate
@@ -259,7 +264,10 @@ make build
259264
### Default Signal Chain
260265
The application starts with a clean acoustic preset. Only EQ and Reverb are enabled by default — all other effects start bypassed:
261266
```
262-
Input → Noise Gate* → Compressor* → Overdrive* → Distortion* → EQ → Chorus* → Delay* → Reverb → Cabinet* → Output
267+
Input → [Noise Gate] → [Compressor] → [Overdrive] → EQ → [Cabinet] → [Delay] → Reverb → Output
268+
269+
> Brackets [ ] = bypassed by default. Only **EQ** and **Reverb** are active on startup.
270+
> Click any pedal's footswitch in the GUI to enable it.
263271
```
264272
(*bypassed by default — click the footswitch to enable)
265273

0 commit comments

Comments
 (0)