What is it?
This program is a type of interactive oscilloscope.
An oscilloscope is a scientific instrument that displays a
waveform from an electrical source, which can then be observed and
analyzed visually.
This particular oscilloscope uses the
JavaScript AudioContextAPI to
generate a periodic wave at a given pitch as an
OscillatorNode.
This
pitch (Hz) is then used to calculate
and derive a very zoomed-in, visual representation of the wave which
is rendered as an animation using the
HTML5 CanvasAPI. Each
OscillatorNode’s frequency , or
pitch, can be raised or lowered with
the right most range-slider and can be read as the number of waves
shown on screen at any time. Doubling the frequency of the wave will
amount to twice as many waves on screen where as halving the
frequency will have the opposite effect.
What do I do with it?
Have fun! Explore the result of the wave form when moving the slider
bar. Add more tone nodes and explore how they interact with each
other, both audibly and visually. The results can be both beautiful
and horrifying. See what happens when pitches are far apart vs when
they are right next to each other? Can you make a consonant chord?
Pro-tip:
The sliders can be adjusted with the keyboard's arrow-keys which can
not only creates a smoother visual effect, allows for finer tuning
of the pitches and can cause some really wild acoustic results.
What is an oscillator?
An oscillator is a wave that repeatedly moves back and forth, or a
wave that is oscillating. In the context of this application, the
OscillatorNode creates an instance of
an oscillator at a set frequency in the form of a sine wave and
outputs a constant tone.
What exactly is pitch?
In musical application,
pitch describes the audible quality of a sound wave, relative to
its frequency measured in Hz, or oscillations per second.
A sound with a higher frequency is described as “higher in pitch”
than a sound with lower frequency. The human audible range is
generally assumed to be frequencies from 20 Hz to 20,000Hz. This
program is set to generate pitches that range from 20 Hz to 3000 Hz.
Pitch can also be used to describe named frequencies which make up
various scales, the primary organizing principle in music aside from
rhythm. These namings can be quite regional and cultural but one
relatively common example is the named note “A” which orchestras
tune to is most commonly referring to the frequency 440 Hz, at least
in North America. Hence the term “A 440”.
About the developer:
I am a full stack software engineer, musician, and educator. I have
a love of computers, learning, music as well as for sharing my
enthusiasm for these things with anyone who will listen.
Currently, I’m building in
Ruby, Rails, JavaScript, React, Redux
but I am always looking to learn more languages and grow as a
developer. As a musician, I've performed and recorded all over the
country and world but mostly around New York City. Feel free to
follow me on
LinkedIn, check out my
GitHub if
you‘d like to connect or collaborate.
Thanks for visiting and I hope you enjoy my oscilloscope! - Bert Hill