The piano is often called the king of instruments. It covers the entire frequency spectrum of the orchestra, from the deepest lows to the shimmering highs. PianoMitra’s Piano Studio brings this experience to the web, but with a twist: it is a fully digital, physics-enabled synthesizer. This guide will walk you through the unique features of our engine, how to navigate the 24-key interface, and the science behind the sounds you are creating.
The Science of Sound: Understanding Waveforms
When you press a key in the Piano Studio, the app doesn't just play a recording. It generates a sound wave in real-time using math. Understanding these waves allows you to choose the right "voice" for your music.
- Triangle Wave (Piano): This is the default setting. A triangle wave contains only odd harmonics, meaning it sounds smooth but has enough "bite" to be heard clearly. It mimics the soft hammers of a felt piano.
- Sine Wave (Flute): The purest form of sound, containing no overtones. This setting is perfect for playing smooth, flowing melodies or "pads" that sit in the background of a mix. It sounds very much like a blown bottle or a flute.
- Sawtooth Wave (Synth): This waveform is jagged and rich in harmonics. It sounds buzzy, sharp, and electronic. It is the staple sound of 1980s pop music and modern EDM. Use this when you want your melody to stand out aggressively.
Navigating the Interface: The Physics Engine
One of the biggest challenges in designing a mobile piano is screen real estate. A full piano has 88 keys; a phone screen can comfortably fit about 7. To solve this, we implemented a custom physics-based scrolling engine.
You will notice two rows of keys. The bottom row is the "Main Keyboard," where you play. The top row is the "Reference Scroller." These two are linked mathematically. When you drag the top scroller, the bottom keyboard moves in sync, but at a different ratio. This allows you to quickly jump from C3 (low notes) to C6 (high notes) with a single swipe. The inertia calculation ensures that the scrolling feels natural—if you flick it hard, it spins fast and slowly friction brings it to a halt. This intuitive navigation allows virtuoso playing even on small screens.
The Sustain Function
On a physical piano, the sustain pedal lifts the dampers off the strings, allowing them to ring out even after you lift your finger. In PianoMitra, clicking the "Sustain" button (or the orange "SUS" indicator) changes the decay algorithm of the audio engine.
Normally, when you release a key, the synthesizer triggers a "release" phase of 0.1 seconds, silencing the note almost instantly. When Sustain is active, this release phase is extended to 2.0 seconds. This allows you to build complex chords by playing one note at a time, letting them blend together. Be careful, though—too much sustain can make your mix sound muddy!
Recording Melodies
Recording in the Piano Studio captures two distinct data points: Note and Duration. Unlike the drum machine, where a hit is just a point in time, a piano note has a start time and an end time.
When you enter "Track Mode" and hit record, the system logs the exact millisecond you press the key (Note On) and the exact duration you hold it (Note Off). This allows for expressive playing. You can play short, staccato notes (jumping quickly) or long, legato passages (smooth and connected). When you save your track, this data is compressed into a JSON object and uploaded to your user profile.
Practice Mode: The "Simon Says" Game
Learning music should be fun. The "Learn" button activates a gamified memory mode. The system will play a short sequence of notes (highlighting them in blue) and then wait for you to repeat them.
This utilizes a "Call and Response" pedagogy. By forcing you to watch, listen, and then repeat, you are training your ear and your visual memory simultaneously. As you succeed, the sequences get longer and more complex, gradually teaching you full melodies without you realizing you are studying.
Conclusion
The Piano Studio is a versatile tool. Whether you are sketching out a melody for a new song using the Sawtooth wave or practicing your scales using the Triangle wave, the underlying technology works to ensure high fidelity and low latency. Remember to utilize the scroll bar to access the full range of octaves!