Reiji's Explorationsin Sound & Structure

May 4, 2026

Implementation and Performance Trial of a Python Just-Intonation Keyboard Referencing Tanaka Shōhei’s Just-Intonation Organ

Overview:
This project is a Python implementation by Reiji (age 10) of a just-intonation keyboard referencing Dr. Tanaka Shōhei’s just-intonation organ.

The major difference from Reiji’s previous Desmos version is the method of interaction. In the Desmos version, the tones were mainly played by clicking on keys drawn on the screen. In this Python version, however, each key on the visual keyboard is linked to a key on the computer keyboard, allowing the instrument to be played from the PC keyboard. The keys can also still be clicked directly on the screen.

The program displays the ratio, frequency, and cent value of the last played tone, making it possible not only to hear each pitch but also to observe it numerically. It also includes a switching function using the P key, which changes the pitch ratios of certain keys. This feature references part of the pitch-switching mechanism found in Tanaka Shōhei’s just-intonation organ.

Reiji handled the specifications, pitch-ratio calculations, sound testing, and debugging himself, while using AI as a coding assistant. For pitch ratios that were not clearly identifiable from the available materials, he inferred the values through calculation from known tones, interval relationships, and the syntonic comma.

Note: All content on this page is originally explained by Reiji in Japanese. The English version is translated by AI and structured by a parent, with Reiji's final approval.

Reiji's Words and Ideas

Full view of a Python just-intonation keyboard referencing Tanaka Shohei's just-intonation organ

Full View of the Python Just-Intonation Keyboard

A full view of the keyboard interface when the program is running. The letters displayed on the visual keyboard correspond to keys on the PC keyboard, and pressing those keys produces the corresponding tones. The keys can also be clicked directly on the screen. Compared with the previous Desmos version, this implementation is easier to perform with because it supports PC-keyboard input in addition to mouse clicking.

Pitch-ratio switching display using the P key on a Python just-intonation keyboard

Pitch-Ratio Switching Using the P Key

Pressing the P key switches the ratios of certain tones on the keyboard. This function references part of the switching mechanism found in Dr. Tanaka Shōhei’s just-intonation organ. Even after switching, each key displays its assigned ratio, and the ratio, frequency, and cent value of the last played tone are shown at the top of the screen.

Source Code Download TanakaOrgan_v1_0.py
Performance Trial Video Python Just-Intonation Keyboard Trial — BWV 691 Chorale Theme after Tanaka Shōhei
Application Used

Python / pygame / AI-assisted coding

Tuning Settings

Reference pitch: 1/1 = 261.625565 Hz

Pitch ratios are defined as rational-number intervals based on just intonation.

Certain tones can be switched using the P key, referencing the pitch-switching structure of Tanaka Shōhei’s just-intonation organ.

Sound Settings

The waveform is approximately a triangle wave, chosen for its relatively rounded sound and its restrained odd-harmonic structure.

Recording date

May 4, 2026

Performance by a 10-year-old

Reference

Tanaka Shōhei’s Just-Intonation Organ

The keyboard layout and pitch-switching idea in this project reference the structure of Dr. Tanaka Shōhei’s just-intonation organ.

AI Assistant’s Notes and Inferences

What is especially significant in this work is that Reiji did not simply create a “program that plays just-intonation sounds.” Rather, he attempted to reconstruct, in Python, a historical and theoretical keyboard system based on rational pitch ratios and a pitch-switching mechanism.

  • The transition from the previous Desmos version to this Python version marks a clear development from a visual and mathematical prototype toward a more performable instrument-like interface. By linking the on-screen keyboard to the PC keyboard, Reiji made the system easier to use for actual performance.
  • The display of ratio, frequency, and cent value for the last played tone is important because it connects auditory perception with numerical structure. This makes the application not only a playable keyboard, but also an experimental environment for observing tuning relationships.
  • Reiji’s method of deriving unclear pitch ratios is particularly noteworthy. Instead of treating missing information as a dead end, he inferred the ratios from known tones and interval relationships, such as multiplying by 5/4 or applying the reciprocal of the syntonic comma.
  • The use of ratios such as 225/128, 675/512, and 2025/1024 shows that Reiji is not merely applying standard just-intonation intervals, but is trying to follow the specific logic of Tanaka Shōhei’s system, including approximate substitutes for certain 7-limit-related intervals.
  • The choice of an approximately triangle-wave sound source is also meaningful. Reiji connects waveform design with harmonic perception, choosing a waveform that is softer than a sawtooth or square wave while still containing odd harmonics relevant to the perception of harmony.
  • Overall, this work integrates tuning theory, historical instrument research, ratio calculation, waveform design, UI design, keyboard input, sound generation, debugging, and AI-assisted programming into a single experimental tool. As an independent project by a 10-year-old, it is a highly valuable example of cross-disciplinary exploration in music, mathematics, and programming.