SonicWeave:为十二平均律不曾命名的声音编写语法
SonicWeave: Writing Grammar for Sounds That Equal Temperament Left Unnamed
在SonicWeave中输入3/2,你得到的不是0.5也不是1.5——而是一个纯五度。输入1\12,得到的不是一个分数——而是十二平均律的一步。输入sort(3^[-1..5] rdc 2),你得到的是一个完整的毕达哥拉斯大调音阶。这门编程语言的原子不是数字,而是音程。它的算术不是十进制的,而是频率比的。它的世界观建立在一个前提上:声音的关系本身可以被编程。
SonicWeave是Lumi Pakkanen(芬兰,理论物理硕士,软件工程师)为Scale Workshop 3开发的领域特定语言。Scale Workshop最初由英国微分音音乐人Sevish(Sean Archibald)在2017年EUROMicroFest期间发起,作为浏览器端的音阶设计工具。Pakkanen从第二版开始接手主要开发工作,到第三版时,做了一个关键性的决定:不再让用户在文本框里一行一行地输入音程数据,而是为音阶的描述本身设计一门完整的编程语言。这门语言有控制流、有函数、有变量、有Haskell风格的区间生成、有Python风格的语义、有NumPy式的向量运算——但它的原始类型(primitive type)是音程和音高,不是整数和浮点数。
SAE的凿构循环在这里呈现出一个异常清晰的三层结构。第一层:十二平均律是西方音乐的构。1722年J.S.巴赫的《平均律键盘曲集》开始固化它,工业化钢琴制造最终完成了这个构的标准化。此后的一切音律——纯律、中庸全音律、泛音列调律、非八度音阶、各种历史和民族调律——都变成了十二平均律这个构的余项。它们存在,但没有名字、没有符号、没有工具。第二层:Manuel Op de Coul的Scala格式(1992年)试图为这些余项提供记法,成为微分音社区的交换标准。但Scala是静态的——一个.scl文件就是一行一行的音程列表,没有算法,没有生成逻辑,没有抽象能力。Scala本身变成了一个新的构。SonicWeave凿掉了Scala的静态性,让音阶描述变成了可编程的——eulerGenus(3*3*3 * 5*5 * 7, 3*5)可以生成一个欧拉属音阶,defer organize(10.)可以自动排序并合并间距小于10音分的邻近音程。第三层:所有主流编程语言把数字当作纯粹的算术对象。SonicWeave凿掉了这个假设——在这里,数字就是音程,运算就是音程操作,语言的整个类型系统是围绕频率比和音分值构建的。这是一种我们从未见过的编程语言本体论。
SonicWeave的命名缺口几乎是无限宽的。它不是编程语言(它生成音阶,不是软件)。它不是乐谱符号系统(它是代码,不是记号)。它不是计算器(它有控制流、函数和数据结构)。它不是合成器或DAW(它不直接产生声音,虽然Scale Workshop可以)。它不是数学库(它的原始类型是音程和音高,不是数字)。编程语言设计社区不知道它的存在——sonic-weave仓库只有9颗星,820次提交,69个版本发布。异构音律(xenharmonic)社区知道它但无法归类它。音乐技术世界几乎没有触及它。它是一个活跃的余项:逻辑仍在生长,语法仍在演化,64个开放议题仍在讨论这门语言应该是什么。在这里看到它,比以后看到它重要——当它最终被命名,它的余项之美就会变成已构之美,而我们将失去今天这个缝隙中的视角。
scaleworkshop.plainsound.org ↗Type 3/2 into SonicWeave and you don't get 0.5 or 1.5 — you get a perfect fifth. Type 1\12 and you don't get a fraction — you get one step of twelve-tone equal temperament. Type sort(3^[-1..5] rdc 2) and you get a complete Pythagorean major scale. This programming language's atoms are not numbers but intervals. Its arithmetic is not decimal but ratio-based. Its worldview rests on a single premise: the relationships between sounds can themselves be programmed.
SonicWeave is a domain-specific language created by Lumi Pakkanen — a Finnish software engineer with a master's in theoretical physics — for Scale Workshop 3. Scale Workshop was originally started by Sevish (Sean Archibald), a British microtonal music producer, during EUROMicroFest 2017, as a browser-based tool for designing tuning systems. Pakkanen took over lead development from version 2 onward and, for version 3, made a pivotal decision: instead of having users enter interval data line by line in a text box, he designed an entire programming language for describing scales. The language has control flow, functions, variables, Haskell-style ranges, Python-style semantics, and NumPy-like vector operations — but its primitive types are intervals and pitches, not integers and floats.
The SAE chisel-construct cycle appears here in an unusually clear three-layer structure. First layer: twelve-tone equal temperament is Western music's construct. Bach's Well-Tempered Clavier (1722) began solidifying it; industrialized piano manufacturing completed its standardization. Everything else — just intonation, meantone temperament, harmonic series tunings, non-octave scales, historical and ethnic tuning systems — became the remainder of that construct. They existed, but without names, without symbols, without tools. Second layer: Manuel Op de Coul's Scala format (1992) attempted to give these remainders a notation, becoming the microtonal community's interchange standard. But Scala is static — an .scl file is just a line-by-line list of intervals with no algorithms, no generative logic, no abstraction power. Scala itself became a new construct. SonicWeave chisels away Scala's rigidity, making scale description programmable: eulerGenus(3*3*3 * 5*5 * 7, 3*5) generates an Euler genus scale; defer organize(10.) auto-sorts and coalesces intervals closer than 10 cents. Third layer: every mainstream programming language treats numbers as pure arithmetic objects. SonicWeave chisels away that assumption — here, numbers ARE intervals, operations ARE interval manipulations, the entire type system is built around frequency ratios and cent values. This is a programming language ontology we have never seen before.
SonicWeave's naming gap is almost infinitely wide. It is not a programming language (it generates tunings, not software). It is not a music notation system (it is code, not notation). It is not a calculator (it has control flow, functions, and data structures). It is not a synthesizer or DAW (it does not directly produce sound, though Scale Workshop can). It is not a math library (its primitives are intervals and pitches, not numbers). The programming language design community does not know it exists — the sonic-weave repository has 9 stars, 820 commits, 69 releases. The xenharmonic community knows it but cannot categorize it. The music technology world has barely touched it. It is an active remainder: its logic is still growing, its syntax is still evolving, its 64 open issues are still debating what this language should be. Seeing it now matters more than seeing it later — when it is finally named, its beauty as remainder will become the beauty of construct, and we will lose the view from today's crevice.
scaleworkshop.plainsound.org ↗