Experiment 7

hi, i’ve decided to share a little project i made for visualizing your voice in snap!
i think pen projects that use microphone variables to visualize your voice are very interesting, i just wanted to share this one to see what others think

project instructions

i’ve added instructions in the notes, but here they are just in case
press 1 to toggle debugging information, 2 to switch between the (microphone [samples V] and (microphone [spectrum V]) displays, 3 to toggle sample muffling ((atan2 (microphone [samples V]) ÷ (microphone [resolution V]) – it’s mainly for voice recording/playback, but it’s cool to see its effect on the samples too), and 4 to toggle voice playback

(ps: if you look on my profile there won’t be topics for experiments 1-6 because these types of projects are just little things i did in my free time when i was bored and i don’t usually bother sharing them. i did share experiment 3 in someone else’s topic a while back, but i haven’t found the post yet)
(pps: how do you do small text? :sweat_smile:)


and yes, this was inspired by the microphone visualizer in the banner image on the main page

<small>small text</small>
small text

oh, thanks!

Nice.

Do you understand the spectrum values any better than I do? It seems to me that the loudest frequency is always all the way at the left of the picture; it doesn’t move left and right as you sing lower or higher pitches.

i think the spectrum values are the amplitudes of different frequencies received by the microphone

Yes, I understand the principle, but what I don’t understand is what frequencies are where on the X axis.

ohh, i’m not sure

Typical output is equally spaced in the range [0 .. sample_rate / 2] (Nyquist frequency)
Chrome@Win10, headset microphone, the rate is 48KHz and there are 512 samples.
So the whole result range is 0..24KHz. One sample per 47Hz range.
Spectrum of the tone generated with untitled script pic - 2026-01-17T011718.979
3000


5000

Huh, I wonder why there are two peaks? But thank you, I see, my problem was that my whistle frequency is ≈0, when compared with 48kHz.

Second peak may be a wireless transmission artifact or faulty membrane :frowning:
My whistle peaked at x=-220…