← Knowledge Notes
Indie Building / Knowledge note · English

Xiaohongshu / Music × Mathematics Collection (Euclidean Rhythm + Whitney Music Box)

A collection of 7 cross-disciplinary music and mathematics works by a Xiaohongshu vibecoding creator. **When Music Meets Mathematics series**: ① Euclidean rhythm (Godfried Toussaint 2004 paper / even distribution on 16-step sequencer / NI Circular plugin / Tidal Cycles + Strudle live coding) ② Whitney Music Box (48 semitones / 4 octaves / 72 divisions of microtonal tones / 21 modes / Prime Numbers Only) ③ Making music while typing (K kick / R rimshot / W woodblock / T tom / CDEFGAB) ④ Music version of Cursor (Strato live coding / Codex) ⑤ Creation with different rhythmic ratios ⑥ Exploration beyond twelve-tone equal temperament ⑦ SuperCollider open-source synthesizer

Source collection:Xiaohongshu Vibe Coding · Published here:2026-09-26

Creative codingMusic ToolsGenerative art

"When Music Meets Mathematics" series + making music while typing + music version of Cursor.Turning the beauty of mathematics into audible sound with vibecoding.


1. Euclidean Rhythm (Series 1)

Conceptual origin

  • Godfrey Howson in proposed in 2004(specifically introduced in the paper, with little direct relation to Euclid himself)
  • A tight integration of mathematics × music

Core principle (16-step sequencer example)

Algorithm: Distribute N drum hits as evenly as possible across an M-step sequence.

Number of drum hits 16-step distribution Result
4 16 ÷ 4 = 4 Perfectly even(1 drum hit every 4 steps)
8 16 ÷ 8 = 2 Perfectly even(1 drum hit every 2 steps)
6 16 ÷ 6 ≠ integer Maximally even(alternating 2-step + 3-step intervals, symmetric pattern)
7 16 ÷ 7 ≠ integer Mostly 2-step + 3-step intervals,no 4-step or 1-step gaps appear

Core property: When division is not exact,avoid intervals that are too short or too long, and achieve maximally even distribution.

Practical application cases

Tool Use
Euclid Circles modular synthesizer Physical hardware synthesizer module, strong Techno feel
Tidal Cycles programming language Invoke the Euclidean rhythm algorithm with a short piece of code
Strudle live coding tool Same as above, for music programming and creation
NI Circular (2024 plugin) Native Instruments plugin with built-in Euclidean algorithm
Minimalism + Euclidean rhythm Combined with circular visualization, displayed on a flat circle

Creator's self-made tool

16-step sequencer based on open-source applications + self-development:

  • Adjust the number of active points (number of drum hits)
  • Adjust distribution positions
  • Replaceable timbres (local sound library)
  • 4 groups for comparison
  • Adjust BPM + volume

2. Whitney Music Box (Series 2)

Concept

Visualization work by John Whitney (experimental animator) from the 1980s. An excellent trinity integration of music + mathematics + visualization.

Classic 48-count mode

48 个点 = 4 个八度(12 半音 × 4)
每个点代表一个半音
最外侧小球:速度最快(转 48 周)
最内侧小球:速度最慢(转 1 周)

Periodic visualization of mathematical ratios

As time progresses, the small balls form different fractional ratios (users can intuitively see):

  • 1/8 → 1/7 → 1/5 → 1/4 → 1/3 → Half-period 1/2
  • Also 2/7 and others

21 modes

Mode Description
Classic 48 mode Semitone increments
Basic resonance mode Fundamental tone 20 Hz → 2nd point 40 Hz → 48th point 960 Hz (by frequency ratio)
Microtonal mode 12 semitones per octave → divided into 72 divisions(12 tones between Do and Re,extremely rich sonic layers)
Prime Numbers Only Keep only tones at prime number positions(non-primes such as 4/6 are removed; tones are discontinuous, with mathematical beauty)
Stereo version
Different timbre versions

"The microtonal mode is my personal favorite; the sound under the 48-count setting is really particularly subtle."

Developer

Gem(developer of the Whitney Music Box) — web version with 21 modes available for online experience.


3. Making Music While Typing — Introduction to Strudle

Letters = timbre mapping

Character Timbre
K Kick (bass drum)
R Rimshot (snare rim)
-(hyphen) Closed Hi-Hat
=(equals sign) Open Hi-Hat
W Woodblock (the creator's favorite)
T Tom (tom drum)
Space Pause
Copy and paste Extend note length

Pitch characters

钢琴符号映射:CDEFGAB = 哆来咪发嗦啦西
8 度感觉:C D E F G A B
和弦:CEF(三和弦)
颤音:用强调符号

Rhythmic freedom

"It doesn't have to strictly follow 8-beat, 6-beat, 16-beat; feels like 6-beat, 3-beat are all actually fine, the whole feel will be a bit different."

Special symbols

  • Emphasis symbol: enhances the sound
  • Parentheses: timbre change
  • Tone symbol: removing it makes the sound duller

4. Music Version of Cursor — Strato live coding (see B1 for details)

See Xiaohongshu / Vibecoding Practical Collection (Games/Tools/Mini Programs) Case 9.Core features:

  • Integrated with Codex Codex(adjustable ChatGPT 5.5 reasoning / fast mode)
  • HONEST framework
  • Code = NOTE blocks(C2/G2/EB3 scales + tracks + ADSR envelope)
  • Library of 800+ code snippets(Disco / Rock / Space Ambient / Sense synthesizers)

5. Creating Music with Different Rhythmic Ratios

(Title information, content continues the themes of Euclidean rhythm + irregular meters)

Core: break out of the 4/4 time framework, and create using ratio theory (2:3 / 3:4 / 5:7).


6. If Music Is No Longer Twelve-Tone Equal Temperament

Possibilities beyond twelve-tone equal temperament:

  • Microtonality(Whitney Music Box 72-division mode)
  • Just intonation(based on integer frequency ratios)
  • Non-Western tuning systems(Indian, Arabic, etc.)
  • Just Intonation(Just intonation)

7. SuperCollider — Open-Source Synthesizer Project

SuperCollider: Classic open-source music programming language + synthesizer.

  • Fully open source
  • Server + client architecture
  • Suitable for algorithmic composition / live coding / real-time synthesis

8. Core Mindset (running through this series)

"Mathematics and music have a very deep inner connection."

Through vibecoding, turn those "very niche and obscure" mathematical concepts (Euclidean rhythm, Whitney Music Box, microtones, Prime Numbers Only),into tools that can be directly heard, seen, and played with.

Shared design language across projects

Element Manifestation
Visualization first Not just playback; let users see how mathematics changes(rotating light balls / flashing drum hits)
Adjustable Number of drum hits / BPM / timbre / mode can all be adjusted
Cross-tool referencing Community ecosystems such as NI plugins / Tidal / Strudle / SuperCollider
Open-source spirit Creators are willing to share via direct message + deploy online for free experience

See also