midiviz

#037 Violinist

037_violinist.html: an anime-style violinist (VRoid CC0 VRM, cel shaded) plays the solo part of a violin MIDI on a dark concert stage. The rest of the MIDI plays as accompaniment through a GM soundfont. The violin itself plays on the GM soundfont too, or (Violin menu, ?violin=waveguide|source|hybrid) on one of #034’s engines, as in #038: the bowed waveguide and the Helmholtz source-filter physical models in real time, or the hybrid sampler; the fingered notes, the bowing and the solo track’s CC11 / CC7 / CC2 hairpins (or a recorded performer’s dynamics lane for that engine, and its pitch curves) go through strings/sound/performance.js into #034’s Lab on its own audio context with the same hall, started with the clock and put back in step when it drifts more than 60 ms. Levels as #038’s (matched to the Creative 8 MB GM violin).

Pieces

midis/ has 48 MIDIs from the Mutopia Project (public domain, CC BY / CC BY-SA, credits in midis/README.md and midis/index.json): all of Bach’s Sonatas and Partitas BWV 1001–1006 (32 movements), six sonatas (Bach BWV 1017, Handel, Mozart K. 379, Beethoven Op. 30/2 and the Kreutzer), six concerto movements (Bach 1042 and 1043, Vivaldi Spring and Winter, Beethoven, Tchaikovsky finale) and four showpieces (Paganini Caprices 1 and 24, Bach/Gounod Ave Maria, Beethoven Romance 2). All are engraved from scores, so they play in strict time. Many Bach files have no tempo mark (LilyPond’s ♩=60); the page rescales them to suggestedBpm. The solo track is found by its note count from index.json.

The character

assets/models/: three VRoid Project sample males (CC0, see assets/models/CREDITS.md), loaded with @pixiv/three-vrm. They share one skeleton, so the Outfit menu binds Base_Male’s shirt, vest, tie, trousers and shoes onto any of them (?outfit=):

The rig (rig.js)

Drives the VRM’s normalised humanoid bones every frame from the #033 models (strings/fingering.js, motion.js, hand3d.js, violin3d.js):

Collision sweep

node violinist/test/collisions.mjs [song.mid[@model.vrm][@outfit]] … plays pieces headless (every 0.25 s, up to 240 s each) and checks the bow against the head and torso, the right forearm against the torso, the right elbow against the body’s midline, the left elbow against the violin’s back and both arms against the violin body, with the sleeve thickness added; exits 1 on a failure. It needs the parent folder served (BASE, default http://127.0.0.1:8000/midiviz/), playwright-core (PLAYWRIGHT) and a Chromium (CHROME). Current closest gaps on the four default runs: bow–head 8 cm, bow–torso 12.6, forearm–torso 2.4, elbow–midline 9.7, left elbow–violin 4.3.

Posture test

node violinist/test/posture.mjs [song.mid[@model.vrm]] … (same environment as the collision sweep) plays pieces headless and checks both hands every 0.25 s. Left: each pressed fingertip on its stop, the joints within a hand’s range, no finger leaning out of its plane, the wrist straight, the index at its contact, the little knuckle beside the board, the thumb under the neck, the elbow under the violin. Bow hand: each fingertip on its contact, the thumb bent on the frog, the palm down, the wrist bend the research gives for that part of the bow, the elbow bent 60–165°. It exits 1 on a failure. Current medians: left base joints 50°, middle joints 93°, wrist bend 2–7°; right elbow 77–112°, wrist −5…+13°; all four default runs pass.

Research

#038 Duo (../038_duo.html)

The violinist and the #032 pianist (AvatarSample_A in her concert dress, pianist/alt-model.js) on one stage, playing the violin part and the piano part of the same MIDI.

Not done yet

No spring-bone tuning; the forearm twist isn’t split; the jacket has no buttons or pockets and the tailcoat’s tails don’t swing; the director is a simple phrase-aware cutter. Headless check: ?shot&view=front&t=6.