gpojani

instrument · VCV Rack, Pure Data, Orca and a canon machine · in the browser

Officina

A studio in one window. The engine of VCV Rack with its own modules, Pure Data as a patcher in the role of Max, the Orca sequencer, and a machine that plays canons the way Bach built them, or Gymnopédies the way Satie did: compiled from their source, on one clock, with audio running between them sample by sample.

REundecidable

    i · how it works

    Four instruments, one clock. Programs that usually live apart, here in one window and on one transport. Each is the real thing, built from its own source; Officina is the room they share and the wires between them.

    The rack. VCV Rack is a virtual Eurorack: modules that make or shape voltages, joined by cables. A VCO makes a tone, a VCF filters it, an ADSR shapes it in time, a VCA opens and closes the volume. Pitch travels as one volt per octave; notes as gates, ten volts while held. Rack's own engine and its Core and Fundamental modules run here as compiled from their source, sample by sample.

    The patcher. Pure Data is Miller Puckette's visual language for sound: boxes are objects, lines are connections, a tilde (osc~) marks what runs at audio rate. Puckette first wrote Max; Max for Live is Max inside Ableton Live, and closed. Officina gives Pd the same role, with devices that can move any knob in the rack.

    Orca. Hundredrabbits' livecoding grid. Every letter is an operator that reads its neighbours and writes below itself, four frames to a beat: D bangs every few frames, C counts, T reads a melody, : plays a MIDI note.

    Canon. One subject and four voices, each playing it mirrored, reversed, slowed, transposed or delayed. Four modes decide how pitches are treated: in the scale, strictly by semitones, Bach (a wrong note is put back in the key and a clash on the beat moves to a consonance, even the notes you play) and Satie (a Gymnopédie or a Gnossienne). The voices reach Rack's “Canon” MIDI device and the patcher's notein 49–54.

    The wiring. Orca's and the Canon's notes reach Rack's MIDI modules and the patcher's notein; the patcher's noteout reaches Rack. Audio crosses through Rack's Audio module: dac~ 3 4 comes out of its outputs 3–4, its inputs 3–4 go into adc~ 3 4. One transport sends tempo, start and stop to everything.

    Orca · Canonnotes, every step Keyboard · Web MIDInotes you play Patcher (Pd)notein · noteout · dac~ RackMIDI to CV · Audio module Speakersthe mixer · master Transport MIDIaudioclock

    ii · bach, mathematician

    Bach, the mathematical composer

    Calling Bach a mathematical composer does not mean he wrote equations. It means his music is built with procedures that mathematics describes well: rules that combine, symmetries that transform, proportions that measure. The structure can be analysed, modelled and reproduced; the Canon editor in Officina does exactly that with a subject and four voices.

    Counterpoint is rule-based combinatorics

    Counterpoint keeps several independent lines sounding well together under strict rules about intervals and motion. In a fugue Bach takes one subject and puts it through a fixed set of operations — answer at the fifth, inversion, augmentation, diminution, stretto, invertible counterpoint — and works out what each makes possible. The Art of Fugue and The Well-Tempered Clavier read like a systematic search through the solutions of a constrained problem.

    Symmetry and transformation

    A melody can be mirrored in pitch (inversion: every step up becomes a step down), in time (retrograde: last note first), or both (retrograde inversion). Bach uses all of them, and some pieces are palindromes that read the same from either end. The four forms combine like a small algebra:

    then →ORIRI
    OORIRI
    RRORII
    IIRIOR
    RIRIIRO
    Do one form, then another: the result is always one of the four. Each undoes itself (the diagonal is all O), and any two give the third. Mathematicians call this Klein’s four-group.

    Proportion and architecture

    Bar counts, section lengths and rhythms often stand in clear ratios — 1:1, 2:1 — and climaxes fall at measured points, so the large form is planned like a building. The Goldberg Variations are the clearest case: an aria and thirty variations in ten groups of three, every third a canon at a wider interval, with a French overture as the hinge at the midpoint.

    Aria
    1
    2
    4
    5
    7
    8
    10
    11
    13
    14
    16Ouv.
    17
    19
    20
    22
    23
    25
    26
    28
    29
    30Qdl.
    Aria
    canon, at the interval shown G minor the overture that opens the second half. Click a canon to hear it set up in the Canon editor.

    Permutation

    Themes are reordered as rigorously as they are transformed: which voice enters first, which line lies on top (invertible counterpoint lets the bass become the treble and still be correct), which section follows which. The voices move like the elements of a permutation group acting on the material.

    Numbers and names

    Bach and his contemporaries also played with numbers. In the old number alphabet (A = 1, B = 2 … with I = J and U = V), B + A + C + H = 2 + 1 + 3 + 8 = 14, and J. S. BACH = 41; both numbers have been traced in his music. His name is also a melody, since in German B is B♭ and H is B♮: B♭–A–C–B♮. The motif is its own retrograde inversion: play it backwards and upside down and the same shape comes back, a semitone lower. This is symbolism and craft rather than mathematics in the modern sense, but it is part of why the label stuck.

    Not cold arithmetic

    None of this makes the music mechanical. Expression, rhetoric and the practicalities of performance decide as much as the rules do. The mathematics names the rigour of the form; the feeling is carried by it, not replaced.

    Three works to start with

    • The Art of Fugue (BWV 1080): one subject through fugue after fugue — in mirror form, in augmentation and diminution, in invertible counterpoint at several intervals.
    • The Musical Offering (BWV 1079): canons on a theme given by Frederick the Great, written as puzzles: the score shows one line and a cryptic hint at the interval, the delay or the inversion, and the players solve the rest.
    • The Goldberg Variations (BWV 988): strict order, a symmetrical plan around the midpoint, and canons at every interval from the unison to the ninth.

    Why it matters

    The logic explains why Bach’s music sounds inevitable: each choice follows from constraints, so the resolutions convince. It gives analysis something precise to hold on to. And studying it trains musicians in disciplined, rule-governed composition — much as learning algorithms trains thinking. Structure and feeling, in Bach, are the same thing seen from two sides.

    iii · satie

    Erik Satie, the other way

    Bach fills every bar with logic; Satie empties it. Two chords that never resolve, a melody that floats over them, the same thing again: music that refuses to develop.

    Satie wrote the three Gymnopédies in 1888, at twenty-one. The first, marked lent et douloureux, is a slow 3/4: the bass falls on the first beat, a chord without its root answers on the second, and the harmony rocks between two major-seventh chords a fourth apart, G and D. After four bars the melody enters, on the second beat, and descends to a long held note. Two years later came the Gnossiennes, written without bar lines or time signatures, with instructions in place of tempo marks: wonder about yourself, on the tip of your thoughts.

    The Canon's Satie mode builds both. The opening of the first Gymnopédie plays note for note; any other subject, B–A–C–H or your name, becomes a melody in his phrasing: three notes to a bar from the second beat, long notes held a bar, the last one two. In the Gnossienne, the left hand alternates bass and chord and the melody turns around its long notes. Whatever you play on the computer keyboard is kept in the mode and on the chord.

    Satie's sound was a piano in a Montmartre cabaret. Here it is a synthesised voice in Rack, a soft triangle through a closing filter with a long decay and a dark echo: the notes and the patterns are his, the instrument is a sketch of his.

    iv · composing like them

    New Bach, new Satie

    The Composer writes pieces that are new note for note but made the way Bach’s and Satie’s are made. It does not copy or recombine their scores: it applies the regularities that music theory and music cognition have measured in them, then measures each piece it makes.

    A chorale, as Bach harmonised them

    Harmony. Chords follow the functional order tonic, predominant, dominant, tonic. A Markov chain chooses each chord from the one after it, walking backwards from cadences planned for each phrase: half, authentic, deceptive, authentic, as a chorale’s phrases end at its fermatas. The transition weights follow the chord statistics of the chorales (Rohrmeier & Cross 2008) and the progressions functional theory describes (Tymoczko 2011). In minor, the last chord may turn major: the tierce de Picardie.

    Voice leading. Every possible four-part voicing of every chord is listed. Dynamic programming, the Viterbi algorithm used for chorale harmonisation by Allan & Williams (2005), finds the cheapest path through all of them. The costs are Huron’s (2001) perceptual derivation of the rules. Small motions keep the voices apart as streams. Parallel fifths and octaves fuse two voices into one, so they are all but forbidden. Crossing and overlap blur the voices, and leading tones and sevenths resolve where the ear expects them. Ebcioğlu’s (1988) rule-based harmoniser and DeepBach (Hadjeres et al. 2017) tackle the same task, by expert rules and by learning.

    Melody. The soprano is scored as a melody: steps preferred, a skip answered by a turn back (von Hippel & Huron 2000), each phrase shaped as an arch (Huron 1996).

    Surface. Passing and neighbour notes fill thirds and repeated notes on the off-beats; any that would make parallel fifths or octaves is taken back. Their density and the dynamics follow 1/f noise, the fluctuation Voss & Clarke (1975) found in music and Levitin et al. (2012) in its rhythms.

    An invention

    A subject of a bar, mostly steps, from the tonic toward the dominant. It is answered an octave lower against a countersubject in thirds and sixths. Episodes spin a fragment of it in sequence down the scale. It returns in the dominant, then upside down, then in stretto, before a cadence. Every beat is checked note against note: consonant where the beat falls (Fux 1725), no parallel perfect consonances from beat to beat. This is recombination of a style’s procedures, in the spirit of Cope’s Experiments in Musical Intelligence (1996).

    A Gymnopédie, a Gnossienne

    Satie gives a model of a different kind. Orledge (1990) describes music built from short cells and blocks, juxtaposed and repeated rather than developed. The Composer takes a pair of seventh chords that rock a bar each, never the dominant, in Ionian, Lydian or Dorian. It voices them without their roots over a bass on the first beat, and moves the whole block up a step (planing) for the middle section. Its melody enters on the second beat, descends, and rests on the chords’ sevenths and ninths. Each phrase is repeated with only its ending changed. The Gnossienne drops the bar lines: phrases of uneven length over an oom-pah in harmonic minor, a melody of two cells, a turn and a fall through the augmented second.

    Measured, every time

    Beside each piece the Composer reports what the sources name. For Bach: parallel fifths and octaves (always none), how much of the melody moves by step, the cadences. For Satie: chords a bar, dominant cadences (none), how much repeats. For both, the entropy of note-to-note transitions, the measure of information Kulkarni et al. (2024) applied to Bach’s works: Satie’s, full of repetition, comes out lower. Of every seed’s first variants, the first that passes every check is kept, so a number always gives the same piece.

    Where it stops

    These are sketches of a manner, not forgeries. The chorales do not modulate as Bach’s do. The inventions follow one plan. The Satie pieces have his harmony and his repetition but not his wit, or the instructions he wrote in his scores. The style is in the procedures; the genius is not.

    References

    • Allan, M., & Williams, C. K. I. (2005). Harmonising chorales by probabilistic inference. Advances in Neural Information Processing Systems 17.
    • Cope, D. (1996). Experiments in Musical Intelligence. A-R Editions.
    • Ebcioğlu, K. (1988). An expert system for harmonizing four-part chorales. Computer Music Journal, 12(3), 43–51.
    • Fux, J. J. (1725). Gradus ad Parnassum. Vienna.
    • Hadjeres, G., Pachet, F., & Nielsen, F. (2017). DeepBach: a steerable model for Bach chorales generation. Proceedings of the 34th International Conference on Machine Learning.
    • Huron, D. (1996). The melodic arch in Western folksongs. Computing in Musicology, 10, 3–23.
    • Huron, D. (2001). Tone and voice: a derivation of the rules of voice-leading from perceptual principles. Music Perception, 19(1), 1–64.
    • Kulkarni, S., David, S. U., Lynn, C. W., & Bassett, D. S. (2024). Information content of note transitions in the music of J. S. Bach. Physical Review Research, 6, 013136.
    • Levitin, D. J., Chordia, P., & Menon, V. (2012). Musical rhythm spectra from Bach to Joplin obey a 1/f power law. PNAS, 109(10), 3716–3720.
    • Orledge, R. (1990). Satie the Composer. Cambridge University Press.
    • Rohrmeier, M., & Cross, I. (2008). Statistical properties of tonal harmony in Bach’s chorales. Proceedings of the 10th International Conference on Music Perception and Cognition.
    • Tymoczko, D. (2011). A Geometry of Music. Oxford University Press.
    • von Hippel, P., & Huron, D. (2000). Why do skips precede reversals? The effect of tessitura on melodic structure. Music Perception, 18(1), 59–85.
    • Voss, R. F., & Clarke, J. (1975). “1/f noise” in music and speech. Nature, 258, 317–318.

    v · listening

    Bach: further listening

    Most of these are on any streaming service. The GeruBach channel on YouTube pairs many of them with the score, scrolling as the music plays; the links below go to one piece of each set, and the rest turn up by searching “GeruBach” with the BWV number. For everything at once there are complete editions, such as Bach Edition: Complete Works (155 CDs) and The Complete Bach Edition (153 CDs).

    Choral and orchestral

    • BWV 232Mass in B minor Assembled over decades; often named among the greatest pieces of music ever written.score ↗
    • BWV 248Christmas Oratorio Six cantatas for the feasts of the Christmas season, about three hours in all.score ↗
    • BWV 249Easter Oratorio Shorter and festive, opening with trumpets and drums.score ↗

    Cantatas

    • BWV 29Wir danken dir, Gott Opens with a sinfonia for obbligato organ, reworked from the prelude of the E major violin partita.
    • BWV 32Liebster Jesu, mein Verlangen A dialogue for soprano and bass; hear the duet, the fifth movement.
    • BWV 51Jauchzet Gott in allen Landen For solo soprano and trumpet, brilliant from first to last.
    • BWV 102Herr, deine Augen sehen nach dem Glauben A dark, searching opening chorus.
    • BWV 110Unser Mund sei voll Lachens Its opening chorus is the overture of the fourth orchestral suite, with voices added.
    • BWV 146Wir müssen durch viel Trübsal Begins with the D minor harpsichord concerto recast for organ and orchestra.
    • BWV 147Herz und Mund und Tat und Leben Polyphonic choral writing at its clearest; the source of “Jesu, Joy of Man’s Desiring”.

    Keyboard

    • BWV 846–893The Well-Tempered Clavier Forty-eight preludes and fugues, two through every major and minor key: the best way into Bach’s style.score ↗
    • BWV 806–811English Suites Six suites of dances, each opened by a large prelude.score ↗
    • BWV 812–817French Suites Six suites of dances without preludes, more intimate in scale.score ↗
    • BWV 1080The Art of Fugue Fugues and canons on a single subject, the last breaking off unfinished: the summit of the “mathematical” Bach.score ↗
    • BWV 772–801Inventions and Sinfonias Thirty short pieces in two and three parts, written to teach playing and composing at once.score ↗

    Instrumental and orchestral

    • BWV 1046–1051Brandenburg Concertos Six concertos, each for a different group; the fifth has a long harpsichord solo.score ↗
    • BWV 1066–1069Orchestral Suites An overture, then dances; the third contains the famous Air.score ↗
    • BWV 1052Harpsichord Concerto in D minor Driving, dramatic, and one of his most exciting instrumental works.score ↗
    • BWV 1060–1065Concertos for two, three and four harpsichords The last is his arrangement of a Vivaldi concerto for four violins.score ↗
    • BWV 1079The Musical Offering Ricercars, puzzle canons and a trio sonata on the Royal Theme: The Art of Fugue’s companion for instruments.score ↗

    Organ

    • BWV 525–530Trio Sonatas Three independent lines for two hands and feet; bright and transparent.score ↗
    • BWV 542Fantasia and Fugue in G minor, “Great” A fantasia of startling harmonies and a fugue on a dance-like subject.score ↗
    • BWV 544Prelude and Fugue in B minor Among his grandest organ works.score ↗
    • BWV 548Prelude and Fugue in E minor, “Wedge” The fugue subject widens step by step, like a wedge opening.score ↗
    • BWV 565Toccata and Fugue in D minor The most famous of all; it opens Disney’s Fantasia (1940).score ↗
    • BWV 582Passacaglia and Fugue in C minor An eight-bar bass repeated twenty times, then a fugue built on it: variation as architecture.score ↗
    • BWV 593, 596Organ Concertos in A minor and D minor Bach’s organ transcriptions of concertos by Vivaldi.score ↗

    notice

    Rack. The engine of VCV Rack 2 (GPL-3.0-or-later, © VCV), its Core modules and the Fundamental plugin, compiled from their source to WebAssembly with Emscripten. Rack's SSE vector code runs as WebAssembly SIMD. The desktop application around the engine is replaced: an audio driver and a MIDI driver whose devices are this page, so the Core Audio module drives the engine the way a sound card would. Every knob, switch, jack and light sits where the module's own widget code puts it; the panels are drawn anew, because VCV's panel artwork is not licensed for derivatives. Not affiliated with VCV.

    Patcher. Pure Data 0.56 (BSD, © Miller Puckette and others), through libpd, compiled to WebAssembly and edited object by object, as Pd's own editor does. Max and Max for Live are closed; this is their open sibling.

    Orca. Orca (MIT, © Hundredrabbits), its own engine, operators, cursor and commander, unchanged, with a new view and a clock locked to the transport.

    Plugins. With a plugin installed, Rack runs as rack-dyn.wasm, the same engine built to export its symbols, and the page links each plugin into it as Rack's loader would. The plugin offered here,Befaco (GPL-3.0-or-later, © VCV and Befaco), is compiled from its source at commit bf03788 by build-plugin.sh, unchanged. Plugins from the VCV Library (.vcvplugin) are native code and cannot run in a browser; any open-source Rack 2 plugin can be built from its source instead.

    Canon. Officina's own. Its subjects follow the subject of The Art of Fugue, the Royal Theme of theMusical Offering, the notes B–A–C–H, the ground of the Goldberg Variations and the opening of Satie's first Gymnopédie, all long in the public domain. The score videos in the listening list are GeruBach's, on YouTube.

    The code that joins them, the build scripts and the patches to the upstream sources are in this site's repository under tools/officina-wasm and src/lib/officina, GPL-3.0-or-later.

    esc

    ↑↓ move · ↵ open~ terminal · ? shortcuts

    gsh — gianni@gpojani

    manual · keyboard

    Shortcuts

    / ⌘K
    search & jump
    ~
    terminal
    C
    live channel (chat)
    J K
    next / previous transmission
    G then HZLANUXDSVW
    home · zoo · lab · atlas · network · unveiled · logic · drums · synth · vocoder · a world made of letters
    ?
    this sheet
    P
    pause / run the colony
    R
    reseed
    1–4
    Conway · HighLife · Day & Night · Anneal
    M
    listen to the colony
    ⟲ in the HUD
    homeostat: the colony matches your input variety
    click · shift-click · drag
    glider · glider gun · paint
    ↑↑↓↓←→←→BA
    first contact