[
    {
        "role": "user",
        "content": "using%20an%20external%20optical%20scanner%20bar%20laid%20across%20the%20keys%20to%20play%20a%20grand%20piano"
    },
    {
        "role": "assistant",
        "content": "It\u2019s an interesting idea to use an external optical scanner bar laid across a grand piano\u2019s keys to capture playing in real time. There are already several existing systems, projects, and patent concepts that do more-or-less that using optical sensors. Below is a breakdown of how it works currently, what challenges arise, and how feasible an external scanner-bar approach would be.\n\n---\n\n## Existing Systems & Projects\n\n1. **The Portable Optical Key Motion Scanner (e.g. PianoBar / McPherson\u2019s system)**  \n   - Andrew McPherson\u2019s work demonstrates a \u201cportable optical measurement system\u201d that captures *continuous key motion* on any piano using sensors placed at the back of the keyboard. It samples at about **1 kHz**, capturing positions of both white and black keys. ([nime.org](https://www.nime.org/proc/nime2013_mcpherson/?utm_source=openai))  \n   - The Moog *PianoBar*, now discontinued, used optical reflectance sensing on white keys and beam interruption sensors for black keys. This gave MIDI note-on/off data and allowed for expressive control. ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC4451251/?utm_source=openai))\n\n2. **Non-Contact, High-Precision Optical Key Motion Capture**  \n   - A recent 2022 system records the vertical position of all 88 keys using a contactless optical sensor setup under the keys. Spatial resolution of ~0.01 mm, time resolution of 1 ms, without physically touching the action. This enables fine measurement of dynamics and timing. ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC9269260/?utm_source=openai))\n\n3. **EPiCK (Electronic Piano Construction Kit)**  \n   - This is a hobbyist/open-source project where someone built a \u201csensor bar\u201d (optical boards under/above keys) to detect key movements, convert to MIDI, etc. It covers all 88 keys with boards and a motherboard setup. ([sebion.wordpress.com](https://sebion.wordpress.com/about/?utm_source=openai))\n\n4. **Commercial Varieties**  \n   - The Bechstein VARIO system uses optical sensors under the keys (non-contact) to detect motion over the key stroke with many measuring points, converting that into MIDI (including Bluetooth LE MIDI). No effect on touch response or feel. ([bechstein-digital.com](https://www.bechstein-digital.com/en/sensor-technology/?utm_source=openai))  \n   - DUALITY is another product: 88 optical sensors \u201cplaced above the piano keyboard,\u201d converting the acoustic piano into a hybrid instrument, capable of controlling software (DAWs), etc. ([lpduo.com](https://www.lpduo.com/duality/?utm_source=openai))\n\n---\n\n## What an \u201cExternal Optical Scanner Bar\u201d Means in This Context\n\nWhen you say \u201claid across the keys,\u201d it sounds like:\n\n- A bar (or strip) placed *in front*, *above*, or *across* the front side of the keyboard, not embedded under the action.\n- It uses optical sensors (infrared / reflectance / interruption etc.) to detect key movement or obstruction (i.e. key being depressed).\n\nSome existing devices approximate this: e.g. Moog\u2019s PianoBar was mounted at back of keys, beam interruption sensors for some keys; optical reflectance for others. Then there are sensor strips inserted between keys and fallboard (the top front cover). ([nime.org](https://www.nime.org/proceedings/2013/nime2013_240.pdf?utm_source=openai)) Also patents exist for \u201cinsertable key sensor strips\u201d that sit above or in the gap between keys and fallboard, using optical emitters and receivers. ([patents.google.com](https://patents.google.com/patent/US7227069B1/en?utm_source=openai))\n\n---\n\n## Technical Considerations & Challenges\n\nThese are some key constraints one needs to manage:\n\n| Challenge | Description |\n|-----------|-------------|\n| **Line of sight / obstruction** | Keys might block sensors; sensors need cleaner paths if using LEDs, photodiodes, etc. Positioning above vs. below vs. in front changes practicality. |\n| **White vs Black Keys Response Differences** | Black keys absorb more light; some systems use stickers, reflectance modification, or different sensor types to normalize signal. e.g. PianoBar used stickers for black keys. ([nime.org](https://www.nime.org/proceedings/2013/nime2013_240.pdf?utm_source=openai)) |\n| **Latency / Sample Rate** | To capture expressive dynamics, you need sampling rates on the order of at least 1kHz (1000 samples per second) and millisecond-level timing. Many existing optical systems meet that. ([nime.org](https://www.nime.org/proc/nime2013_mcpherson/?utm_source=openai)) |\n| **Velocity / Depth Sensing** | Knowing *that* a key has been pressed is one thing; knowing how fast (velocity) and how much/travel depth (e.g. half press vs full press) requires capturing continuous or at least analog information from motion or obstruction or reflectance; many systems aim for that. |\n| **Mounting / Fit** | Fitting a bar across a grand piano so it doesn\u2019t interfere with playing, doesn\u2019t touch moving parts (keybed, fallboard, etc.), allows rapid installation/removal. The optical components must be shielded from ambient light and kitchen etc. |\n| **Calibration and Consistency** | Differences between key sizes, geometry, mechanical tolerances (especially with older or vintage pianos) mean per-key calibration might be needed. |\n\n---\n\n## Feasibility & How Close to \u201cLay-across\u201d Bar We Can Get\n\nGiven the state of the art:\n\n- Yes, it *is* technically feasible to build an optical scanner-bar that is external (i.e. not deeply modifying the piano), that captures key presses, and outputs useful data (MIDI, velocity, etc.). Systems like PianoBar or duality show this.\n\n- However, \u201claid across the keys\u201d exactly (i.e. directly spanning them, like a physical bar running front-to-back over the key tops) has drawbacks: blocking the pianist\u2019s hands; interfering with shape of key depression; risk of obstructing the motion or touch.\n\n- More common/viable is placing sensor at back of keybed (under keys) or a strip just above keys but close to front edge, or insert between keys and fallboard. Both allow detection of movement (interrupt beams or via reflectance) with less physical interference. The patent US7227069 describes a sensor strip that \u201cinserts between the keys and fallboard\u201d to detect key movement with optical emitter/receiver pairs. ([patents.google.com](https://patents.google.com/patent/US7227069B1/en?utm_source=openai))\n\n- Commercial devices like Bechstein\u2019s VARIO have sensors under the keys to detect movement \u201cwithout contact,\u201d so touch and feel aren\u2019t altered. ([bechstein-digital.com](https://www.bechstein-digital.com/en/sensor-technology/?utm_source=openai))\n\n---\n\n## Design Blueprint: How One Could Build Such a Bar\n\nHere\u2019s how one might create an external optical scanner-bar that is minimally intrusive and effective:\n\n1. **Sensor Type Selection**  \n   - Use infrared (IR) reflectance sensors: emit IR light; measure reflection from moving key-lever bottom surfaces.  \n   - Or beam-interrupt sensors: position emitter and receiver such that key movement blocks the beam.\n\n2. **Placement**  \n   - Either at the back of the keys (beneath key lever), or inserted between keys and fallboard, or slightly above front of keys but slanted to avoid obstruction.  \n   - The key is to ensure each key movement is detectable without risk of obstruction.\n\n3. **Mechanical Attachment**  \n   - A rigid bar/clamp across the keyboard that holds sensors aligned to each key.  \n   - Must adjust for different key geometries (e.g. width of keys, spacing black vs white).\n\n4. **Electronics**  \n   - One sensor per key or grouped: emitter + detector, analog or digital.  \n   - Signal conditioning to derive key press onset, possibly velocity (from speed of obstruction or reflectance slope).  \n   - Multiplexing or use of many I/O lines; scan rates \u2265 1 kHz desired.  \n\n5. **Interface (MIDI / USB / DAW)**  \n   - Collect sensor data per key; map to noteOn/noteOff; compute velocity.  \n   - Possibly provide continuous data (aftertouch, key displacement) for more expressivity.  \n   - Calibration routines: each key calibrated so threshold of activation, velocity scaling, etc., optimized.\n\n6. **Power and Ambience**  \n   - Use IR to reduce ambient light interference. Possibly use shielding.  \n   - Low-latency electronics and buffering to ensure small time delay between physical key movement and digital event (< few milliseconds).\n\n---\n\n## Conclusion\n\n- Many systems already provide something like an optical scanner-bar for a grand piano, either under the keys, between keys and fallboard, or at back\u2014but \u201cacross the keys\u201d in a way that spans the front might be more intrusive or awkward physically.  \n- It is feasible: sensors can detect note-on/off, velocity, even continuous key motion with high precision, without altering mechanical action.  \n- If you want to build one, aiming for a strip inserted just above the front of the keybed or between keys and fallboard is more practical than a bar laid directly over keys. Using IR reflectance sensors or beam interruption methods are both valid approaches.\n\nIf you like, I can sketch out a detailed design plan for such a bar (sensor types, part selection, layout), or show examples of kits people have built. Do you want that?"
    }
]