Jev, the songwriter

Jev is TypeSafe AI's decision model. It cannot write a note. Given a state and a list of options it returns one choice with a probability for every option. So we let code do everything that only needs to be legal, and let Jev do the judging: which chord, which note, how long. Every call is recorded, and every song below can be rebuilt on screen call by call, at the speed Jev actually answered.

The demos

Press play on any score; the cursor follows the notes. “Watch it being built in Jev's real time” opens the replay: the empty grid, then the chords landing, then the notes, with Jev's probabilities and raw responses for every call, each taking exactly as long as Jev took (a speed control is there if you want the gist). These were recorded on 22 September 2026 against jev-1.13.0, before the engine gained its rest rule, so a replay can show a rest offered next to a long length; the notes played are the ones Jev chose then.

Jev wrote everything

Content and warm, a summer evening by the river

F major · 88 bpm · AABA · 32 bars, about 87 s · mood: “content and warm, a summer evening by the river”

“Content and warm, a summer evening by the river”: F major at 100% confidence, 88 bpm, a full AABA; the bridge slows to half notes and the tune comes home.

Jev chose mode major (100%), tempo 88 bpm (84%). First phrase: F Bb F Bb F Bb Bb C. 14 chord calls, 48 note calls, about $0.0040; Jev agreed with code's first choice on 38% of notes and 93% of chords.

Watch it being built in Jev's real time · 0:30 →
Jev wrote everything

Wistful, late night

A minor · 72 bpm · 16-bar period · 16 bars, about 53 s · mood: “wistful, late night”

“Wistful, late night”: minor at 100% confidence, 72 bpm, an all-minor i–iv–v, two long notes a bar.

Jev chose mode minor (100%), tempo 72 bpm (93%), form short_16 (44%). First phrase: Am Dm Em Am Dm Em Dm Em. 7 chord calls, 14 note calls, about $0.0013; Jev agreed with code's first choice on 79% of notes and 86% of chords.

Watch it being built in Jev's real time · 0:11 →
Jev wrote everything

Playful, skipping down the street on a spring afternoon

G major · 120 bpm · AABB · 16 bars, about 32 s · mood: “playful, skipping down the street on a spring afternoon”

“Playful, skipping down the street on a spring afternoon”: major at 100% confidence, 120 bpm, a two-note skip in eighths that never sits down, and a second pair of phrases that lifts it a third.

Jev chose mode major (100%), tempo 120 bpm (84%). First phrase: G C C D. 6 chord calls, 48 note calls, about $0.0037; Jev agreed with code's first choice on 21% of notes and 83% of chords.

Watch it being built in Jev's real time · 0:24 →
Jev wrote everything

Restless, pacing the room at midnight, unable to sleep

E minor · 140 bpm · 8-bar period · 8 bars, about 14 s · mood: “restless, pacing the room at midnight, unable to sleep”

“Restless, pacing the room at midnight, unable to sleep”: E minor at 100%, 140 bpm, and Jev opened on F#dim, the one tense chord in the key, which code had ranked last of seven.

Jev chose mode minor (100%), tempo 140 bpm (68%), form mini_8 (21%). First phrase: F#dim Bm F#dim Bm. 3 chord calls, 16 note calls, about $0.0013; Jev agreed with code's first choice on 19% of notes and 0% of chords.

Watch it being built in Jev's real time · 0:10 →
Jev wrote everything

Tender, rocking a child to sleep

Eb major · 72 bpm · 16-bar period · 16 bars, about 53 s · mood: “tender, rocking a child to sleep”

“Tender, rocking a child to sleep”: E-flat major, 72 bpm at 95% confidence, two long notes a bar for sixteen bars.

Jev chose tempo 72 bpm (95%). First phrase: Eb Eb Ab Eb Ab Eb Ab Bb. 7 chord calls, 14 note calls, about $0.0013; Jev agreed with code's first choice on 71% of notes and 86% of chords.

Watch it being built in Jev's real time · 0:12 →

How we built it

The doctrine, borrowed from jev-go: code computes, Jev judges. Jev never generates text or notes. It picks from options that code enumerated, so it cannot write an illegal note, a bar that does not add up, or a chord outside the key. What it can do is prefer.

  1. Setup. Given a mood such as “wistful, late night”, one call asks Jev for the mode (major or minor), the tempo (five bands) and the song form (an 8-bar period, a 16-bar period, AABB, or the classic 32-bar AABA), unless you pinned them. The mood text then rides along in every later call.
  2. Chords, one call per fresh bar. The options are the seven diatonic triads, plus the seventh chords for jazz and bossa. Each option carries facts computed by code: its quality and harmonic function, the root motion from the previous chord and how many tones they share, how usual the move is in songs, and what it does right before the coming cadence. Cadence chords are set by the form. A repeated phrase keeps its model's chords. In the interleaved variant the chord for a bar is decided just before its notes, one bar ahead, so it can see the melody so far.
  3. Notes, one call per note. Code offers the scale tones within an octave of the last note, plus a rest, and the lengths that still fit in the bar. Each pitch says what interval it makes, whether it is a chord tone, whether it resolves a leap, whether it is a new high point, how far it is from the cadence note. Each length says where it starts and ends and whether it syncopates. Jev answers both questions in one call.
  4. Forced moves, no call. The last bar of every phrase holds the closing degree, tonic or dominant. The answering phrase repeats the opening phrase bar for bar except that last bar, and the return repeats the answer. Repetition is what makes sixteen bars of choices sound like a song.

Output is real ABC notation, a JSON trace of every request and response, and a page that renders the score with abcjs, plays it with the chords underneath, and replays the whole composition decision by decision.

What we found

Run it yourself

npm test
npm run compose -- --mood "wistful, late night"          # Jev picks mode, tempo, form, chords, notes
npm run compose -- --mood jazz --key F                    # named moods: jazz, bossa nova (seventh chords)
npm run compose -- --chords "C G Am F" --mood "a bright pop chorus" --tempo 120 --form aaba_32
npm run compose -- --mood "triumphant" --order interleaved
npm run serve                                             # http://localhost:3222

Needs Node 22.15+ (for --use-system-ca) and a TypeSafe API key in .dev.vars; without one a seeded mock plays Jev's part so the whole pipeline runs offline. Jev bills input only, $0.042 per million tokens.