Skip to content

Feature/add web midi api#112

Merged
sudip-mondal-2002 merged 19 commits into
sudip-mondal-2002:mainfrom
Rakshak05:feature/Add-Web-MIDI-API
May 22, 2026
Merged

Feature/add web midi api#112
sudip-mondal-2002 merged 19 commits into
sudip-mondal-2002:mainfrom
Rakshak05:feature/Add-Web-MIDI-API

Conversation

@Rakshak05

@Rakshak05 Rakshak05 commented May 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds Web MIDI API support to the browser demo, allowing real-time parameter control via USB MIDI controllers without installation.

Details:

  1. JS Bridge:
  • Uses navigator.requestMIDIAccess() (triggered after user interaction)
  • Routes onmidimessage events → Module.ccall
  • Includes fallback handling for unsupported browsers
  1. C++ Handler:
  • Exports on_midi_cc via EMSCRIPTEN_KEEPALIVE
  • hooks into the existing MidiManager mapping system.
  1. Build/Config:
  • Enables MIDI logic in Web builds (without requiring RtMidi)
  • Guards native MIDI dependencies
  1. Default Web Mappings
  • CC11 (Expression) → Output Gain
  • CC64 (Sustain) → Output Gain toggle (bypass-style fallback)

Related Issue

Fixes #70

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor / code cleanup
  • 📝 Documentation
  • ✅ Tests
  • 🔧 Build / CI / Configuration

How Was This Tested?

  • Platform: Web (Emscripten), Windows

Manual Testing

  1. Built a web target using Emscripten
  2. Served locally via Python HTTP server
  3. Triggered MIDI manually via:
  • Module.ccall('on_midi_cc', null, ['number','number','number'], [0, 11, 127]);
  1. Verified:
  • Output gain responds to CC11
  • Toggle behaviour works for CC64
  • Audio changes are audible in real time

Limitations

  • Web MIDI API only supported in Chromium browsers (Chrome/Edge)
  • No physical MIDI device tested (validated via simulated CC input)

Checklist

  • Builds successfully
  • Manual testing completed
  • No audio thread blocking
  • Clean integration with existing MIDI system

Summary by CodeRabbit

  • New Features

    • Web MIDI support: Users can now connect MIDI controllers to the web version and receive real-time device connection feedback via a status overlay
    • Default MIDI CC mappings for web builds (volume, effect toggles, effect parameters)
    • MIDI effect toggle functionality enabling on/off switching via Control Change messages
  • Tests

    • Added end-to-end tests for Web MIDI functionality, including device detection and message handling
  • Chores

    • Updated CI workflow to use centralized dependency setup script
    • Updated project documentation and build configuration

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds Web MIDI API support to the Emscripten web demo. CMake enables MIDI compilation for Emscripten builds, C++ exports Emscripten callbacks to inject MIDI events, JavaScript bridges Web MIDI API messages, Web-specific CC mappings are registered with toggle-press behavior, and end-to-end tests verify the integration.

Changes

Web MIDI Support for Emscripten

Layer / File(s) Summary
Build configuration and infrastructure setup
CMakeLists.txt, .gitignore, .github/workflows/ci.yml, README.md
CMake enables MIDI sources and removes AMPLITRON_NO_MIDI for Emscripten; dependency setup delegates to shared script across all CI jobs; gitignore covers web build artifacts; README documents setup process.
Emscripten MIDI stubs and public accessor
src/midi/midi_manager.h, src/midi/midi_manager.cpp, src/gui/gui_manager.h
MidiMapping adds last_state field for toggle tracking; RtMidi include guarded for Emscripten; stubbed MIDI implementations replace real I/O in Emscripten; GuiManager::midi_manager() public accessor enables external event injection.
Emscripten MIDI callbacks and entry points
src/main.cpp
Exports on_midi_cc and on_midi_device_connected as EMSCRIPTEN_KEEPALIVE functions; on_midi_cc validates ranges, constructs MidiEvent, injects via gui->midi_manager(); shutdown resets g_gui to nullptr.
Web MIDI default CC mappings and toggle behavior
src/midi/midi_manager_mapping.cpp
install_default_mappings() adds Emscripten-guarded Web defaults: CC11/CC7→OutputGain, CC64→EffectBypass toggle for AmpSimulator, CC1→Chorus Depth. apply_mapping() switches EffectBypass to press-edge detection via last_state, toggling effect enabled on state changes and pushing new enabled value to engine.
JavaScript Web MIDI API integration in shell.html
web/shell.html
Add fixed MIDI status overlay. On audio-unlock, request navigator.requestMIDIAccess(); enumerate MIDI inputs, attach midimessage handlers filtering for CC-only, notify C++ of devices via Module.ccall('on_midi_device_connected'), forward CC events via Module.ccall('on_midi_cc'), and update status showing device name or "MIDI not supported" fallback.
Playwright end-to-end tests for Web MIDI
tests/web/amplitron.spec.ts
Add test.describe('Web MIDI Support') with two tests: mock navigator.requestMIDIAccess, simulate CC11 after unlock, verify #midi-status displays device and no console errors; delete requestMIDIAccess and verify fallback message.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

  • sudip-mondal-2002/Amplitron#78: Both PRs modify MidiManager MIDI mapping infrastructure (MidiMapping struct and apply_mapping() behavior in src/midi/midi_manager_mapping.cpp), with this PR adding Web-specific mappings and toggle-press edge detection on top of the mapping foundation.

Suggested labels

Audio Processing, ci, build, type:testing, level:intermediate, type:refactor

Suggested reviewers

  • sudip-mondal-2002

Poem

🎹✨ A web MIDI bridge hops in,
JavaScript and Wasm spin,
CC events now flow free,
From pedal to amp, the joy we see,
Web demo plays, no wires to pin! 🐰

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'Feature/add web midi api' is vague and generic; it uses a non-descriptive phrase without clearly specifying the scope or main implementation detail (e.g., missing 'to Emscripten/web demo'). Consider revising the title to be more specific, such as 'Add Web MIDI API support to browser demo' or 'Implement Web MIDI integration for Emscripten builds', to better convey the main change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed All primary coding requirements from issue #70 are met: Web MIDI API bridge implemented in JavaScript, on_midi_cc C++ entry point exported with EMSCRIPTEN_KEEPALIVE, default CC mappings added (CC11→Gain, CC64→Bypass, CC7/CC1), Emscripten-conditional MIDI logic, UI status display, browser fallback handling, and Playwright e2e test included.
Out of Scope Changes check ✅ Passed All changes align with issue #70 objectives: Web MIDI integration, build configuration updates, CI refactoring, and dependency management. No unrelated features or refactorings detected beyond the stated scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sudip-mondal-2002

Copy link
Copy Markdown
Owner

Why are there 1 lakh line changes? looks spammy

Did you mistakenly push something @Rakshak05 ?

@Rakshak05 Rakshak05 force-pushed the feature/Add-Web-MIDI-API branch from a331f90 to 0677839 Compare May 17, 2026 14:59
@Rakshak05

Copy link
Copy Markdown
Contributor Author

my bad @sudip-mondal-2002.
Actually, I pushed build artifacts into the repo. I think now it should be fine.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (1)
tests/web/amplitron.spec.ts (1)

364-437: ⚡ Quick win

Test intent and assertion scope are mismatched.

The test title claims CC11 controls output gain, but it never asserts that on_midi_cc was called or that gain changed. Add an assertion on bridge invocation (or observable parameter effect) so this test covers the contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/web/amplitron.spec.ts` around lines 364 - 437, The test currently sends
a mock MIDI CC11 message but never asserts its effect; update the test "MIDI
CC11 controls output gain" to verify the bridge handler (on_midi_cc) was invoked
or that the output gain actually changed after the MIDI message. Locate the MIDI
injection via midiMessageListener and the unlock trigger ('`#audio-unlock`') and
add an assertion that the bridge method on_midi_cc was called (or observe a
visible/inspectable change such as a gain value in the DOM or an exposed JS
variable) after the mock message is delivered, failing the test if no change or
invocation occurs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/gui/nanosvgrast.h`:
- Around line 1235-1254: The defringe pass currently skips the immediate
left/top neighbor when x==1 or y==1 because it uses the checks x-1 > 0 and y-1 >
0; update those conditions to test for a valid neighbor (use x > 0 or x-1 >= 0,
and y > 0 or y-1 >= 0) so the left/top pixels at index 1 are included, leaving
the other boundary checks (x+1 < w, y+1 < h) unchanged; locate the block in
nanosvgrast.h where variables x, y, w, h, row and stride are used in the
defringe pass and replace the two offending comparisons accordingly.
- Around line 223-232: The nsvg__alloc function and several realloc sites risk
corrupting rasterizer state on OOM; change the nsvg__nextPage() call in
nsvg__alloc to assign its return to a temporary (e.g., NSVGrasterizerPage* next
= nsvg__nextPage(r, r->curpage)), check for NULL and only then set r->curpage =
next before dereferencing, and for every realloc site referenced (places
updating capacity/pointer such as the blocks around realloc calls that currently
update capacity before checking the realloc result), assign realloc() to a
temporary pointer, check for NULL, and only then update the original buffer
pointer and its capacity field (update pointer and capacity together after
success) to avoid desynchronization and state corruption.

In `@src/main.cpp`:
- Around line 50-89: Clear the global pointer g_gui during application shutdown
so MIDI callbacks can't dereference a destroyed GuiManager: in your
shutdown/teardown routine (the code that destroys the GuiManager instance),
explicitly set g_gui = nullptr after destroying or resetting the GuiManager
object; keep the existing guards in on_midi_cc and on_midi_device_connected that
check if (!g_gui) to drop events, and apply the same nulling change wherever
GuiManager is torn down (also ensure any other places that stop MIDI callbacks
happen-before you null g_gui).

In `@src/midi/midi_manager_mapping.cpp`:
- Around line 76-93: The Web-specific MIDI defaults block is missing the CC1
mapping required by the feature contract; add a MidiMapping for CC1 (modulation)
in the same block using MidiMapping cc1_mod; set cc_number = 1, midi_channel =
-1 (any channel), target_type = MidiTargetType::Modulation (or the enum value
used for modulation), mode = MidiMappingMode::Continuous, and call
add_mapping(cc1_mod) alongside the existing cc11_output and cc7_output mappings
so CC1/CC7/CC11 defaults are all present.
- Around line 101-108: The OutputGain handling currently ignores
MidiMapping.mode and effect_name so a mapping like the cc64_bypass MidiMapping
(cc_number=64, midi_channel=-1, target_type=MidiTargetType::OutputGain,
mode=MidiMappingMode::Toggle, effect_name="AmpSimulator") behaves as continuous
gain instead of a bypass toggle; update the code in the OutputGain branch to
check mapping.mode and mapping.effect_name and, when
mode==MidiMappingMode::Toggle and effect_name is non-empty, route the action to
the existing bypass-toggle logic (or call the EffectBypass handler) rather than
applying continuous scaling—use the MidiMapping struct (cc64_bypass) and
add_mapping flow to locate and modify the OutputGain branch to respect Toggle
semantics and effect_name.

In `@web/shell.html`:
- Around line 217-222: When inputCount > 0, include the active MIDI device name
in the status message instead of only the count: retrieve the device name from
the connected MIDI input object (e.g., inputs[0].name or the first element of
the array/Map of MIDIInput objects) and call updateMIDIStatus with a string like
"MIDI Active: [Device Name]" (or "✓ [n] MIDI device(s) — Active: [Device Name]"
if you prefer to keep the count). Update the console.log similarly to include
input.name so the UI and logs reflect the active device.

---

Nitpick comments:
In `@tests/web/amplitron.spec.ts`:
- Around line 364-437: The test currently sends a mock MIDI CC11 message but
never asserts its effect; update the test "MIDI CC11 controls output gain" to
verify the bridge handler (on_midi_cc) was invoked or that the output gain
actually changed after the MIDI message. Locate the MIDI injection via
midiMessageListener and the unlock trigger ('`#audio-unlock`') and add an
assertion that the bridge method on_midi_cc was called (or observe a
visible/inspectable change such as a gain value in the DOM or an exposed JS
variable) after the mock message is delivered, failing the test if no change or
invocation occurs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c6d2dba8-9d4b-4dbd-bd35-c0d74861db6e

📥 Commits

Reviewing files that changed from the base of the PR and between 36fc3e5 and 0677839.

📒 Files selected for processing (10)
  • CMakeLists.txt
  • src/audio/dsp/dr_wav.h
  • src/gui/gui_manager.h
  • src/gui/nanosvg.h
  • src/gui/nanosvgrast.h
  • src/main.cpp
  • src/midi/midi_manager.cpp
  • src/midi/midi_manager_mapping.cpp
  • tests/web/amplitron.spec.ts
  • web/shell.html

Comment thread src/gui/nanosvgrast.h Outdated
Comment thread src/gui/nanosvgrast.h Outdated
Comment thread src/main.cpp
Comment thread src/midi/midi_manager_mapping.cpp
Comment thread src/midi/midi_manager_mapping.cpp
Comment thread web/shell.html
@Rakshak05

Copy link
Copy Markdown
Contributor Author

Just a quick note. Now the diff size is ~14k added lines are primarily from including required header-only dependencies for the web build:

  • src/audio/dsp/dr_wav.h
  • src/gui/nanosvg.h
  • src/gui/nanosvgrast.h

These are lightweight, single-header libraries needed for WAV loading and SVG rendering and are compiled directly into the project (no external linking or submodules involved).

Aside from these, the remaining changes are limited to the Web MIDI integration and related source updates.

Sorry for the inconvenience.

@Rakshak05

Copy link
Copy Markdown
Contributor Author

@sudip-mondal-2002 One small suggestion: it might be worth adding build_web/ to .gitignore to prevent accidental commits of generated Emscripten build artifacts in the future.
I ran into this during development and excluding it would help keep diffs clean.

@sudip-mondal-2002

Copy link
Copy Markdown
Owner
image it looks like it's already there but sure you may add it explicitly

@sudip-mondal-2002 sudip-mondal-2002 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not add external header files like this

please add it inside external and update setup_dependencies, CI and all the scripts

the same way imggui is used

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/midi/midi_manager_mapping.cpp (1)

222-231: ⚡ Quick win

Remove or gate the hard-coded bypass debug print.

Line 231 logs "AmpSimulator" on every press edge even though this branch is keyed by mapping.effect_name. That will pollute the browser console and becomes misleading as soon as another effect gets a bypass mapping.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/midi/midi_manager_mapping.cpp` around lines 222 - 231, The hard-coded
debug print "AmpSimulator BYPASS TOGGLED" should be removed or replaced with a
gated/logging call that uses the actual mapping.effect_name so it doesn't
mislead; locate the press-edge branch where mapping.last_state is set and
effects[i]->set_enabled()/engine.push_effect_enabled() are called and either
delete the printf or replace it with a formatted logger (or conditional debug
flag) that prints mapping.effect_name (or i) and the new enable state instead of
the fixed "AmpSimulator" string.
src/midi/midi_manager.h (1)

41-44: ⚡ Quick win

Align the public Toggle contract with the new edge-triggered state.

Adding last_state means bypass mappings now behave as press-edge toggles, but MidiMappingMode::Toggle is still documented as CC >= 64 -> on, CC < 64 -> off. Please update that public comment or rename the mode so callers are not told the old semantics.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/midi/midi_manager.h` around lines 41 - 44, The public contract for
MidiMappingMode::Toggle no longer matches its implementation because last_state
makes mappings behave as an edge-triggered press toggle; update the API by
either (A) changing the MidiMappingMode::Toggle doc-comment to explicitly state
"edge/press-triggered toggle (toggled on CC press edge, not level: rising CC
>=64 crossing toggles state tracked via last_state)" or (B) rename the enum
value to a clearer name (e.g., MidiMappingMode::ToggleOnPress or
MidiMappingMode::EdgeToggle) and update all usages/tests and the public comment
accordingly so callers are not misled by the old "CC >= 64 -> on, CC < 64 ->
off" semantics; ensure you update any public docs/comments that describe the
enum and adjust consumers that relied on level semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/gui/nanosvgrast.h`:
- Around line 796-810: The dash loop can hang when strokeDashArray contains zero
or negative entries: before computing allDashLen and entering the segmentation
loop in nanosvgrast (use variables allDashLen, shape->strokeDashCount,
shape->strokeDashArray, shape->strokeDashOffset, dashOffset, idash, dashLen,
scale), validate and filter out any dash entries <= 0 (or collapse them) into a
sanitized dash list and adjust strokeDashCount/allDashLen accordingly; use that
sanitized array for the fmodf/dashOffset computation and for the while loops
(and similarly for the later 817–839 code paths) so dashOffset is always reduced
and dashLen never becomes zero, preventing infinite loops.
- Around line 284-295: nsvg__duplicatePoints currently returns void and may
return early on realloc failure leaving r->points2/r->npoints2 in a stale state;
change nsvg__duplicatePoints to return a success/failure value (e.g., int or
bool), and on realloc failure explicitly set r->points2 = NULL and r->npoints2 =
0 (or otherwise leave a consistent state) before returning failure so callers
(dash code paths) can skip the dashed stroke; update callers to check the return
value and abort the dashed-stroke handling when duplication fails.

---

Nitpick comments:
In `@src/midi/midi_manager_mapping.cpp`:
- Around line 222-231: The hard-coded debug print "AmpSimulator BYPASS TOGGLED"
should be removed or replaced with a gated/logging call that uses the actual
mapping.effect_name so it doesn't mislead; locate the press-edge branch where
mapping.last_state is set and
effects[i]->set_enabled()/engine.push_effect_enabled() are called and either
delete the printf or replace it with a formatted logger (or conditional debug
flag) that prints mapping.effect_name (or i) and the new enable state instead of
the fixed "AmpSimulator" string.

In `@src/midi/midi_manager.h`:
- Around line 41-44: The public contract for MidiMappingMode::Toggle no longer
matches its implementation because last_state makes mappings behave as an
edge-triggered press toggle; update the API by either (A) changing the
MidiMappingMode::Toggle doc-comment to explicitly state "edge/press-triggered
toggle (toggled on CC press edge, not level: rising CC >=64 crossing toggles
state tracked via last_state)" or (B) rename the enum value to a clearer name
(e.g., MidiMappingMode::ToggleOnPress or MidiMappingMode::EdgeToggle) and update
all usages/tests and the public comment accordingly so callers are not misled by
the old "CC >= 64 -> on, CC < 64 -> off" semantics; ensure you update any public
docs/comments that describe the enum and adjust consumers that relied on level
semantics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 89bec57a-4043-40a6-a743-d22ab551947f

📥 Commits

Reviewing files that changed from the base of the PR and between 0677839 and 6e64393.

📒 Files selected for processing (7)
  • .gitignore
  • CMakeLists.txt
  • src/gui/nanosvgrast.h
  • src/main.cpp
  • src/midi/midi_manager.h
  • src/midi/midi_manager_mapping.cpp
  • web/shell.html
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/main.cpp
  • CMakeLists.txt
  • web/shell.html

Comment thread src/gui/nanosvgrast.h Outdated
Comment thread src/gui/nanosvgrast.h Outdated
@Rakshak05 Rakshak05 force-pushed the feature/Add-Web-MIDI-API branch from 6e64393 to 1d9cde4 Compare May 17, 2026 17:09
@sudip-mondal-2002

Copy link
Copy Markdown
Owner

@Rakshak05 please don't force push

@sudip-mondal-2002 sudip-mondal-2002 added gssoc:approved GSSoC 2026 contribution type:feature New feature or request level:advanced Advanced task · 45 GSSoC points quality:clean labels May 18, 2026

@sudip-mondal-2002 sudip-mondal-2002 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not push nanosvg, dr_wav etc to codebase, please add it in dependencies

As far as i remember, nanosvg is already in the dependencies

@sudip-mondal-2002

Copy link
Copy Markdown
Owner

@Rakshak05 Are you still working on it?

@Rakshak05

Copy link
Copy Markdown
Contributor Author

yess sir, actually i had an exam today, so was busy with that. I'll work on this tonight!
sorry for the delay.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CMakeLists.txt`:
- Around line 51-71: The download steps for the three headers (variables
_nanosvg_url, _nanosvgrast_url, _dr_wav_url and their file(DOWNLOAD ...)
invocations) must be hardened: pin each download with EXPECTED_HASH set to the
known SHA256 for the file, enable TLS_VERIFY to ON, capture the STATUS variable
already used (_dl_status, _dl_status2, _dl_status3) and check its value after
each file(DOWNLOAD); if the STATUS indicates failure or the downloaded file's
hash doesn't match EXPECTED_HASH, abort configuration with message(FATAL_ERROR)
and a clear error message. Apply this pattern to all three file(DOWNLOAD ...)
calls so configure-time downloads are verified and fail fast on mismatch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 94bb1237-4eda-4908-a875-9f333510d1b7

📥 Commits

Reviewing files that changed from the base of the PR and between 6e64393 and 1d10a7e.

📒 Files selected for processing (8)
  • .gitignore
  • CMakeLists.txt
  • src/main.cpp
  • src/midi/midi_manager.h
  • src/midi/midi_manager_mapping.cpp
  • tests/web/amplitron.spec.ts
  • tests/web/playwright-report/index.html
  • web/shell.html
💤 Files with no reviewable changes (5)
  • src/midi/midi_manager.h
  • src/main.cpp
  • tests/web/amplitron.spec.ts
  • web/shell.html
  • src/midi/midi_manager_mapping.cpp

Comment thread CMakeLists.txt Outdated
@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

PR Preview Removed

The GitHub Pages preview for this PR has been removed because the PR was closed.

@sudip-mondal-2002 sudip-mondal-2002 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi As requested before please remove dr_wav and nanosvg from the codebase and add them in the setup_dependencies script

Nanosvg is already a part of it.

@Rakshak05

Copy link
Copy Markdown
Contributor Author

Done Sir.

@sudip-mondal-2002

Copy link
Copy Markdown
Owner

@Rakshak05 the files are still there, please remove
image

@sudip-mondal-2002

Copy link
Copy Markdown
Owner

@Rakshak05 now builds are failing, take a look

@Rakshak05 Rakshak05 force-pushed the feature/Add-Web-MIDI-API branch from a4b7e85 to f63d7b2 Compare May 22, 2026 10:58
@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Report 📊

Line Coverage: 66.2%

✅ Coverage meets threshold: 66.2% >= 60%

Full Coverage Summary
Summary coverage rate:
  lines......: 66.2% (2620 of 3959 lines)
  functions..: 78.8% (364 of 462 functions)
  branches...: no data found

@Rakshak05

Copy link
Copy Markdown
Contributor Author

finally! 😅

@sudip-mondal-2002 sudip-mondal-2002 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sudip-mondal-2002 sudip-mondal-2002 merged commit 41ea58f into sudip-mondal-2002:main May 22, 2026
9 checks passed
github-actions Bot added a commit that referenced this pull request May 22, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Jun 5, 2026
8 tasks
@Rakshak05 Rakshak05 deleted the feature/Add-Web-MIDI-API branch June 16, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC 2026 contribution level:advanced Advanced task · 45 GSSoC points mentor:sudip-mondal-2002 quality:clean type:feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add Web MIDI API support to the Emscripten web demo

2 participants