home/ atoms/ analog-sensor-audio-rate-control

Bela reads analog sensors synchronously with the audio block, removing the polling lag of slow microcontrollers

On standard microcontrollers, analog-to-digital conversion for sensors runs at polling rates of hundreds of Hz, making smooth continuous modulation of audio parameters hard without lag from filtering. Bela samples analog inputs synchronously with the audio block, providing up to tens of thousands of new sensor values per second. Each audio-sample computation can read the corresponding sensor value with no extra delay, so potentiometers, force-sensitive resistors, and accelerometers can modulate oscillator frequency, filter cutoff, or envelope depth with action-sound latency dominated only by the audio block size. The analog outputs run at the same rate, letting Bela emit control voltages to drive external hardware synthesizers.

Examples

analogRead(context, n, 0) returns a 0-1 float for analog input 0 at sample n. Multiply by 440 and add to a base frequency for real-time pitch control from a potentiometer; a force-sensitive resistor can trigger envelopes at finger pressure.

Assessment

Compare sensor latency on Bela versus an Arduino → MIDI CC → software synth chain. Name every latency contribution in the Arduino path that Bela eliminates.

“Control voltages and VCOs”