Simple browser piano/keyboard chord performance synthesizer | ZeroTools

A piano keyboard that runs on your browser. You can enjoy simple performances by selecting a sound wave waveform and assigning keys on your mouse or PC keyboard. It is a convenient web tool that operates completely locally and safely without sending data to an external server.

Loading tool interface...

Client-Side Secure Execution

This tool executes entirely in your browser sandbox. None of your input strings, files, or configurations are uploaded to any external server.

ZeroTools: Browser Processing & Privacy

ZeroTools focuses on tools that process input on your device. Check each tool’s scope and limitations before use.

Processing and privacy policy
Chapter 1

The depths of mathematics of twelve equal temperament frequency calculations using Web Audio API

The core of this system is the advanced control system of the Web Audio API, which is a browser-native audio processing platform.

At its center is an oscillator node, which acts as an oscillator. Furthermore, a complex acoustic space is constructed by combining amplitude control using the gain node and dynamic modulation of the frequency band using the biquad filter node.

In particular, when calculating the frequency that determines pitch, we use a rigorous mathematical model of 12 equal temperament based on the international standard pitch of 440 hertz, A4.

Specifically, the natural frequency of each keyboard is derived using the formula f(n) = 440 \times 2^{\frac{n-49}{12}} \text{ Hz} for the integer value n that indicates the absolute position of the keyboard.

By calculating this logarithmic frequency distribution in real time and immediately applying it to the frequency property of the oscillator node, we generate accurate pitches that match the characteristics of human hearing.

This process, which requires high precision using floating point arithmetic, is the basis for minimizing beats when creating chords and producing harmonies of high purity.

Chapter 2

Building a tone synthesis model using basic four waveforms and ADSR envelope

What determines the tone of a synthesizer is the selection of the oscillation waveform and the precise design of the volume changes over time.

By switching the type attribute of the oscillator node, this system can instantly generate four types of basic waveforms: a pure sine wave that does not contain overtones, a square wave that has an abundance of odd harmonics and sounds like a woodwind instrument, a sawtooth wave that contains all integer harmonics and produces a sharp and rich sound, and a triangle wave that has high harmonics that are easily attenuated and produces a soft tone.

The ADSR envelope generator adds temporal dynamics to these static waveforms. Four phases are parametrically controlled: attack, which is the time it takes for the volume to reach its maximum value the moment the key is pressed, decay, which is the time it takes for the volume to decay from there to a sustained volume, sustain, which is the volume level while the key is held down, and release, which is the time it takes for the sound to completely disappear after the key is released.

By calling multiple methods of audio parameters such as linearRampToValueAtTime and exponentialRampToValueAtTime, the nonlinear volume curve unique to analog synthesizers is reproduced extremely faithfully on the browser.

Chapter 3

Low-latency real-time performance control using QWERTY keyboard and Web MIDI API

The mechanism that transmits performance information input from the physical interface to the audio processing engine without delay is an important element that determines the expressiveness of a musical instrument.

This system implements event mapping that treats a standard QWERTY computer keyboard as a piano keyboard, and monitors the keystroke status through keydown and keyup event listeners.

In order to prevent unintentional continuous pronunciation due to the automatic key repeat function, the pronunciation status of each key is strictly tracked and managed in variable space.

Furthermore, to meet the requirements of advanced music production environments, it also integrates functionality for linking with external hardware using the Web MIDI API.

It analyzes various messages such as note-on, note-off, and pitch bend sent from a MIDI controller in real time, allowing for fine adjustments to the sound frequency and dynamic changes in attack strength according to velocity, which is the speed at which keys are struck.

To minimize jitter in the asynchronous communication between the browser's main thread and the audio rendering thread, we run a scheduling algorithm that precisely synchronizes the timestamps of keypress events with the current time of the audio context.

Chapter 4

Dynamic drawing and state synchronization of virtual 88-key visual interface

The virtual 88-key keyboard displayed on the screen is not just a visual decoration, but an information presentation platform that allows you to intuitively understand the pitch of the currently sounding note and the set range.

The geometric arrangement of white and black keys is logically constructed as a structure in the document object model, and rendered seamlessly across a variety of screen resolutions using the flexible box and grid layouts of cascading style sheets.

The sound state in the audio engine and the visual keyboard highlighting state are fully synchronized using a reactive state management mechanism.

Even when a user directly operates a keyboard on the screen using a mouse or touch panel, the coordinate system of the pointer event is analyzed to identify the identifier of the target keyboard and trigger the process of generating an accurate acoustic signal without bypassing the frequency calculation logic described above.

In addition, in order to access a vast range that cannot be displayed at once, the display area can be dynamically slid using scroll operations and octave shift buttons, ensuring access to the same range as a full concert grand piano in a limited display space.

Chapter 5

Timbre parameter control using in-browser local computation architecture

All speech synthesis processing and parameter variation calculations are performed on a completely local computing architecture that utilizes only client-side processing power, without any communication to an external server.

This fundamentally eliminates the risk of performance interruptions due to network bandwidth or delays.

A wide variety of synthesizer control parameters, such as the filter cutoff frequency, resonance peak value, and envelope settings in milliseconds, are held in the browser's memory space, and are instantly updated to each node in the audio graph in response to user operations.

Furthermore, it includes a function to persist the tone data you have created using the web storage API, making it possible to completely restore the previous session state even after restarting the browser.

This client-contained design not only protects privacy and improves overall system robustness, but also minimizes computational resource overhead and produces a smooth, uninterrupted audio stream, even when playing polyphonically with multiple oscillators running simultaneously.

Chapter 6

Practical application system from music theory learning and chord structure confirmation to melody composition

This system is more than just a pronunciation device; it also serves as a learning and production support tool that promotes visual and auditory understanding of music theory.

Accurate pitch generation based on the rigorous mathematical background of the Twelve Equal Temperament provides an ideal environment for hearing the differences in the resonance of intervals such as perfect fifths and major thirds.

By highlighting complex tension chords and scale notes on the keyboard, you can directly connect abstract concepts of music theory with intuitive operation.

Furthermore, in addition to playing single-note melodies, it is also envisioned that by combining it with a browser's media recorder API, it can be applied to a simple composition workflow where sketches of melodies and chord progressions can be recorded as audio files on the spot.

Through minute parameter adjustments, such as building rhythm patterns using percussive tones with extremely short attacks or exploring ambient chords with long decays and releases, it functions as a powerful testing ground for outputting vague musical ideas that exist in the creator's head as concrete sound waveforms.

Frequently Asked Questions (FAQ)

A.
No external software installation is required as it runs directly using native browser Web Audio and MediaRecorder APIs.
A.
Audio signals from your microphone are processed exclusively within local browser memory and never transmitted externally.
A.
All audio waveform processing is computed in your browser using local CPU power. With zero server network latency, operation is ultra-smooth and fast.