--- title: Morse Code emoji: ๐Ÿ“ก colorFrom: blue colorTo: purple sdk: static pinned: false hf_oauth: true hf_oauth_expiration_minutes: 480 # No hf_oauth_scopes โ†’ defaults to "openid profile" (just sign-in + identity). # This app never touches HF repos/datasets, so it must NOT request the # read/write/manage-repos scopes (that's what triggered the scary # "Manage all your repos" consent prompt). Sign-in identity is all the host # shell needs to connect you to your robot via the signaling server. short_description: Talk to Reachy Mini in Morse โ€” taps, beeps, mic decode. tags: - reachy_mini - reachy_mini_js_app --- # Morse Code Make your Reachy Mini speak and understand **Morse code**. The robot transmits by *clapping its antennas together* โ€” each hit is an audible click. Your phone or laptop can transmit too, with beeps. Either device (or a **second Reachy Mini** sitting across the table) listens through its microphone, detects the hits, and decodes them back to text in real time. Open the Space URL, sign in with Hugging Face, pick your robot. No install. ## Three tabs - **Compose** โ€” type a message, see its Morse, and pick who sends it: the robot's antennas or this device's speaker. Watch it transmit. - **Listen** โ€” turn on the mic and decode incoming clicks/beeps live, with a scope that drops a marker on every detected hit. - **Learn** โ€” the letter โ†” rhythm chart. Tap any tile to *feel* the rhythm (a letter is just a pattern of short and long beats). ## How it works (the impulse wire code) An antenna hit is **impulsive** โ€” one short click. You can't hold a click long the way you hold a tone, so classic "short tone = dot, long tone = dash" can't work on the robot. Instead every channel here uses one **onset-only** code so a tapping robot, a beeping phone, and a second robot are all mutually intelligible through a single detector: - **dot** = one impulse - **dash** = a quick double-tap (two impulses) - letters and words are separated by progressively longer gaps It's still real Morse โ€” the Learn chart shows the standard `ยทโ€“` patterns โ€” just carried as a rhythm of hits instead of tone length. Detection is a transient-onset detector (high-pass โ†’ short-term energy โ†’ spectral flux โ†’ peak pick) ported from the Marionette audio-sync tests and validated end-to-end against synthetic audio (`npm test`). All timing and detection thresholds live in Settings, so the robot clap and mic sensitivity can be calibrated on real hardware without code changes. ## Develop ```bash npm install npm test # unit tests: morse codec, wire code, detector round-trip npm run test:e2e # playwright (optional) ``` No build step โ€” `sdk: static`, the host shell + SDK load from jsDelivr. Local dev: serve the folder (e.g. `python3 -m http.server`) and open with a `?embedded=1`-capable dev token, or just push to the Space. ### SDK pin `@pollen-robotics/reachy-mini-sdk@1.8.0-rc1-main.dbe26af`, pinned in three places that must stay in sync: the two `modulepreload` links in `index.html`, the two import URLs in `main.js`, and the re-export in `lib/animation-helpers.js`. ## Credits Built for Reachy Mini by Pollen Robotics. Antenna-collision recipe and the transient detector adapted from the Marionette project.