Scene 03: Audio Driven TCode¶
Script¶
Goal¶
Capture live audio, extract audio features, and transform signal energy into smooth real-time TCode output.
Main Pipeline¶
Audio Capture -> Audio Feature Core -> Python Expr Service (msg['rms']) -> Envelope -> Smooth Filter -> Range Map -> TCode -> Serial Out
Steps¶
- Import the script and start
Audio Capture,Audio Feature Core,Audio Feature Rhythm, andPyEngine. - Verify
Audio Capture.audioShmNameis connected to bothAudio Viz.shmNameandAudio Feature Core.audioShmName. - Use
Python Expr Serviceto extract the drive value fromcoreFeatures(current expression:msg['rms']). - Check output stability through
Envelope,Smooth Filter, andRange Map. - Verify timing link
Tick.tickMs -> TCode.intervalMs(both are100in this script). - Configure and enable
Serial Out; validate command stream withTCodeViz.
Key Parameters¶
Audio Feature Core.windowMs/hopMs:768/64(responsiveness vs. stability)Envelope.method:SMASmooth Filter.filter_type:ONEEURORange Map.outMin/outMax:0.4/1.0
Validation¶
Text Viz 1/2continuously display core and rhythm feature payloads.Wave Vizshows a sensible progression from raw -> envelope -> smoothed.TCodeVizand serial stream stay continuous and stable.
Image Placeholders¶
docs/media/images/scenarios/scene-03-overview.pngdocs/media/images/scenarios/scene-03-audio-features.png