Eyesy sampling frequency

I was playing around with hacking a mode on Eyesy and found that the etc.audio_in array is sampled in a way that syncs with note D4 + about 2.5 cents (or around 294 Hz). Not terribly useful, unless you like to use the Eyesy as a synth scope - showing the waveform you’re currently playing into it.

Here’s a short vid of playing a sine wave from the Hydrasynth through a custom mode visualising the array: https://youtu.be/nKFl-tLKbAU

Presumably this is just a function of syncing to Pal / NTSC; perhaps with Pal at 50Hz, if the audio buffer is sampled once per frame, you’d expect a sync at some multiple of 50? I haven’t look at the code - anyone got info on how the array is created?

Looking forward to getting into some 3D with the ofLua stuff…

Steve

1 Like

The 100 point audio_in array is filled at 36.75 Hz (this is 11025 Hz sample rate / 300, I can’t remember the reasoning exactly, that part of the code is here)

36.75 * 8 = 294 Hz, so what you are seeing makes sense. The audio sample rate is fixed at 11025 Hz, this is dictated by the hardware and independent of frame rate.

1 Like

Aha - thanks for that. Looking at the code, it’s probably just a case that a buffer of 100 audio samples was seen as the right/convenient size, and the 300 is based on doing a 3x over sampling, so each value in the buffer is an average of 3 actual audio samples.

Doesn’t look like there’s any other rationale. Could be interesting to hack this, do some basic FFT on it and pull out different frequencies for more fun…

…and digging a little more into ALSA audio, am betting now that the period_size of 300 is a result of experimenting with device latency and speed of the code execution to minimise audio buffer overruns. Ok - none of this is relevant to making pretty pictures!