01
Install and open
Lily# Studio is the editor for Lily#: an extension of Visual Studio Code that
brings the compiler, a live score preview that plays, and the AI features. Installing it
takes one search in VS Code's Extensions view — Get
started walks through it, and through a first score. Open any .lys file and
the language server starts, with the score beside it. The keys to know:
| Key | Does |
|---|---|
| Ctrl+Space | list what can come next — words, names, chords, marks; in an empty file, the lessons — below |
| Ctrl+Shift+V | open the score preview |
| Ctrl+K V | open it beside the source |
| Alt+P (hold) | sound the note under the caret |
| Alt+M | play the measure the caret is in |
| Ctrl+Shift+Up / Down | step a note to the next note of the key, a chord shape, a tempo by 1, a key a fifth, a clef, a dynamic, a time, an octave or a transpose — below |
| Ctrl+Shift+PageUp / PageDown | step a note an octave mark, a chord shape, or a tempo by 10; switch a key to its parallel / relative key, a treble or bass clef an octave, a dynamic a level, a time to the next common meter, an octave by 1 or a transpose an octave |
| Ctrl+I | Ask AI in Chat: Copilot's chat opens with the file, a selection as a hint of where — below |
On macOS read Cmd for Ctrl in the first two and the last; the stepping keys are Ctrl+Shift+Up/Down and Ctrl+Shift+PageUp/PageDown (the Control key) there too.
02
Typing aids you might not notice
A note is written in one order — pitch, octave marks, duration, dots, then its string
number, annotations and marks: cis'4.\2@accent(. The editor knows that order,
so a mark typed anywhere on the note lands in its slot, and the caret stays where
you pressed the key. You never have to move to the right spot first. In the examples,
| is the caret.
Octave marks land after the pitch
Type ' or , with the caret anywhere on a note — at its start,
in the middle of its name, after its duration or dots, or among its annotations and marks —
and the mark is inserted after the pitch letters and the marks already there, before the
duration.
| Before | Type | After |
|---|---|---|
| c|is4. | ' | c|is'4. |
| cis4.| | ' | cis'4.| |
| cis4.@accent| | ' | cis'4.@accent| |
| c,4| | ' | c4| — the opposite key cancels one mark |
| <c e g>4| | ' | <c e g>'4| — the whole chord |
Marks stack from wherever the caret rests (' twice gives c''4).
Inside a chord's brackets the mark is the member's and is typed where you press it
(<c e| g> → <c e'| g>); the chord as a whole takes one
at its < or after its >. A rest takes no octave mark, so
there the key types as pressed.
cis4. lands after the pitch.A sharp goes into the name
A sharp is part of a note's name, cis. Type # anywhere on a note and
it is written there. Against a flat it cancels one; a second one makes a double sharp.
| Before | Type | After |
|---|---|---|
| c| | # | cis| |
| c4| | # | cis4| |
| ces4| | # | c4| |
| <c e| g>4 | # | <c eis| g>4 — the note the caret is on |
A rest, a slash note or a whole chord takes none, and the status bar says why. In a chord
symbol it is typed as pressed: @chord(F#). A flat has no key of its own, since
b is a note: bb4 is marked as an error and Ctrl+. writes
bes4. cb is a cowbell, so in a book with no drums it is marked too.
A duration digit replaces the duration
Type a digit with the caret anywhere on a note, rest, chord or slash note and it goes to the duration slot, and what it leaves there is always a real duration — 1, 2, 4, 8, 16, 32, 64 or 128. A digit that makes one together with the digits already there extends them; otherwise it replaces them. Dots stay.
| Before | Type | After |
|---|---|---|
| c4| | 8 | c8| |
| c|4 | 8 | c|8 |
| c16| | 8 | c8| |
| c1| | 6 | c16| — 16 is a duration, so the 6 extends |
| c1| | 2 | c2| — 12 is not, so the 2 replaces |
| c4| | 6 | c64| — a 3 or 6 on its own is completed to 32 or 64 |
| c4.| | 8 | c8.| — the dot is kept |
| <c e g>4| | 8 | <c e g>8| |
| <c e g|> | 4 | <c e g|>4 — on a note of the chord too |
| c|hord(F#) | 8 | c|hord(F#)8 — on the word; in its parentheses a digit is typed as pressed |
| r4| | 2 | r2| — rests too |
| /4| | 8 | /8| — and slash notes |
| c4@f| | 8 | c8@f| |
| c4| | 5 | c4| — no duration begins with 5: nothing changes |
Directly after the digits a digit extends them only when the result is a duration
(c1| + 6 → c16, c3| + 2 →
c32). Anywhere else on the note a 1, 2, 4 or 8 starts a fresh duration
(c1.| + 2 → c2.), while a 3 or 6 — no duration by
itself — extends when it can (c1.| + 6 → c16.). A
3 or 6 that extends into nothing is completed to the only
duration it can start: 32 or 64. Retyping the duration a note
already has changes nothing. A digit that begins no duration — 5,
7, 9, 0 — leaves the note unchanged and says so
in the status bar: on a note it could only write an error such as c45.
A 128th cannot be typed digit by digit, since c1| + 2 is already
c2: paste 128, type it with the aids turned off, or type
8 after a 12 that is already there. A digit after a space inside a
chord's brackets (a scale degree), inside an annotation's parentheses (@finger(5)) and outside
notes (time 5/4, R1*5) are typed as pressed.
The rest of the slots
| Key | What happens | Example |
|---|---|---|
. | the dot goes after the duration and any dots already there (on a rest too, and from a note inside a chord's brackets) | c|'8. → c|'8.. |
\ | opens the note's tab string number in its slot and the caret follows, ready for the digit; on a note that already has one, the digit is selected so the next key replaces it | |a4 → a4\| |
@ | goes after the string number and the annotations already there, and the name list opens there | c|4( → c4@|( |
~ | moves to the end of the note | |c2 → c2~ |
( / ) | a slur is placed over two notes at once — the one typed on and the next; ) on the note after a slur's end extends it by one. From a note inside a chord's brackets, ( goes after the chord | c4| d e → c4( d) e |
[ / ] | a manual beam, the same way, within the bar. From a note inside a chord's brackets, [ goes after the chord. On a quarter, a longer note or a rest it changes nothing, and the status bar says why | c8| d e f → c8[ d] e f |
< / > | < before a note, or inside it, wraps it in a chord (the duration stays outside); turning one end into << or back turns the matching end too | |c4 → <c|>4 |
Several cursors. With more than one cursor, the octave marks, digits, dots,
\ and @ work at each cursor on its own note, all in one undo step:
c4| d1| /4| + 6 → c64| d16| /64|. Two cursors on the
same note have no single answer, so there the key is typed as pressed at every cursor. The
bracket, slur, beam and tie keys are single-cursor: with several cursors they type as
pressed.
Selected notes take the mark
Select notes and type (, [ or <, or the closing
), ] or > with the caret left after it, and the mark goes
on the notes instead of around the selection. One Ctrl+Z takes it back.
| Selected | Type | After |
|---|---|---|
| c4 d e | ( | c4(| d e) |
| c8 d e | [ | c8[| d e] |
| c4 d e | < | <c d e|>4 |
The next note keeps its pitch: a note after a chord is counted from the chord's first note, so it is given the octave marks that keep it where it sounded. The chord's own notes stack upward from its first note, as in any chord. When the notes cannot take the mark — a beam over a bar line or a quarter, a chord of different lengths, notes with marks of their own — nothing changes, the selection stays and the status bar says why. A selection that is not all notes is surrounded as anywhere in VS Code.
Selected staves go into a group
In a score, select two or more staff rows, press
Ctrl+Space and pick grandStaff, staffGroup or
choirStaff: the rows move inside it, indented. condensedStaff and
combinedStaff take bare part names, so there each row loses its staff;
they are offered when every row is a part's name alone, and combinedStaff for
exactly two.
When it steps aside. With a selection any other key replaces the selection,
as anywhere in VS Code. Keys inside strings and comments, and outside notes —
time 4/4, tuplet 3/2, a title — type as pressed. A slash note
takes durations, dots, ties, slurs and beams like a note but has no pitch, so
', , and \ type as pressed on it, as on a rest. Every
aid is one undo step with the keystroke. To turn all of it off, set
lilysharp.editing.typingAids to false (Settings → Lily# → Typing
Aids): every key then types exactly as pressed.
03
The preview
The score redraws as you type, not when you save: a keystroke reparses only what it touched, and only the systems whose width changed are laid out again.
- It opens by itself and follows you. Opening a
.lysfile opens the preview beside it (lilysharp.preview.openWithScore); switching to another.lysturns the same preview to it, each file keeping its own zoom and scroll, and while it plays it waits for the music to stop. The lock at the top right of the preview keeps it on one file — to compare two scores, lock one and switch to the other: its preview opens beside the locked one. Bringing a locked preview forward brings its file's tab forward too, and a.lysopened while the preview has the focus opens among the scores, not over the preview. - Source and score are linked both ways. The note under the caret is highlighted in the score, and a selection highlights every note in it. Click a note, a tie, a slur, a clef or a key signature in the preview to jump to the text that wrote it, or a bar beside its notes to put the caret in that bar.
- A note or a bar can be the AI's hint. Right-click it and choose Ask AI in Chat…; to hint several bars, select them in the editor. A plain drag scrolls the sheet, and Ctrl+wheel zooms it.
- A bar line cuts or joins sections. Right-click a bar line inside a section for Split Section Here; on the bar line between two sections — the left half of a section's first bar, or the right half of its last, as the score plays them — Join Sections Here joins the section before it with the one after it. Both work on sections written inside a part, as a new score is written, and are checked to sound as before.
- The header holds, from the left: the picker for which
scorethe preview shows, with Export and ✨ Ask AI; Rewind, ▶, Pause, ⏹ and Repeat, with the bar and the time it stands at (Bar 12 / 118 over 0:21 / 3:42); the Tempo key and the mixer; the pages; and Range. On a narrow pane its groups wrap onto the next row rather than squeeze. - It plays. ▶ plays the score the preview shows — that score's parts, under its form — from the A flag, each note lit as it sounds, with each part's own General MIDI sound. Click a bar (or a note) to move the A flag there. Right-click for This Section as A-B, Stop Playback, Fit Width and Reset Zoom. More in Playback and practice.
- Its pages stand apart as sheets of paper, and an exported PDF has pages of the paper's real size.
- Its sound is a SoundFont synthesizer. Out of the box it plays the General MIDI bank your computer already has; for fuller instruments, install a free sound font — Sound fonts, below. A browser lets sound start only once you have clicked or typed in the preview itself — the status bar says so when a note comes first.
- It exports. Lily#: Export writes PDF, PNG, SVG, MP3, WAV, an MP4 video of the
pages with each note lit as it sounds (with your own ffmpeg), the words as a timed LRC, a VOCALOID
sequence, MIDI, MusicXML or LilyPond (
.ly) — from the preview (the score it shows, under that score's own form), the command palette, or by right-clicking.lysfiles in the Explorer (every score of every selected file, into one folder). Every door writes the same file aslysc. - Red rings mark the
@todonotes, with their memos in the staff's margin. Exporting an SVG, PNG or PDF of a score that has any asks whether to draw them (lysc svg --tododoes on the command line). - Its colours follow VS Code's theme, or stay light (the printed page) or dark:
lilysharp.preview.theme. The header and the mixer are black metal, or walnut, or black between walnut cheeks:lilysharp.preview.deck.
04
Playback and practice
▶ plays from the A flag, which always stands on the score (at the start until you move it): every part sounding there, the notes lit as they sound. ⏸ pauses and goes on from the same place; ⏹ stops where it is, and pressed again (or ▶) goes back to A; ⏮ moves A to the start. With the preview focused, Space plays and pauses.
- Click a bar (or a note) to move the A flag there.
- Shift+click a bar to put the B flag at its end: ▶ then plays from A to B. Shift+click B's own bar again to take B away. Drag a flag to move it.
- Repeat, beside ⏹, plays A to B — or the whole score — round and round.
Hold Alt+P to hear the note under the caret; Alt+M plays its bar. After Repeat stands how long the whole score plays, repeats and tempo changes included, kept up to date as you edit.
The Tempo key (a metronome), beside the mixer button, drops down a small panel: a fader for the speed against the written tempo (a double-click puts it back to 100%), Count-in — one bar of clicks before the music comes in, and before each round when Repeat is on — and Metronome: a wood block on every beat, the first of the bar louder. The key stays lit while the tempo is not 100% or Count-in or Metronome is on, and while the tempo is not 100% it stands over the key's metronome.
The mixer drops down from the mixer button (three faders):
| In the panel | Does |
|---|---|
| Mix | the mix the score sounds with, and the Master line — the listener's own volume and pan for everything the preview sounds, written in no mix. The list holds (Default) — no mix: the score as written — and the file's mixes, the score's own marked “— this score”. Choosing another entry tries it on the score shown — the score's text does not change — and Use in This Score writes mix NAME into the score, or for (Default) takes the score's mix item away. While no mix is heard, Save writes the faders as a mix under the first free name (mix1, mix2…) and writes mix mix1 into the score shown, so the score sounds with it. While a mix is heard the button is Duplicate: it writes a copy of that mix under its name counted on (stage → stage2) and tries the copy, leaving the score's text as it is. Neither asks for a name: rename it in the text |
| Score | a line for each part of the file and each voice that sings: press its name to silence it, S to hear only the lines soloed, and Shift+click a name to keep that line alone. Its fader is the line's volume in the mix, shown in dB (0dB as written, +6dB at the top), and the knob beside it its pan (drag it up or down; Shift for fine steps): while a mix is heard, each writes its number into that mix's block as it is dragged, and one Undo takes the whole drag back. While none is heard ((Default)) they are the listener's own: heard at once, written nowhere until Save, and kept until the score or the file is switched. A double-click puts back 0dB, or C. Play turns the whole group off and on, All sounds every part whatever you chose, and As scored goes back to the parts the score plays. The group's own fader and knob are the mix's score row: the score's sound as a whole — its instruments and voices, not the recording — on top of each line's row, written as a line's are. The lines stand in one order whichever score is shown: what is sung first, then guitars, keyboards, the other parts (chords rows first), bass and drums — the order of a separated recording |
| Audio | with a recording beside the score: its button turns it on and off, with its fader and knob (the mix's audio row), the fader and knob of each of its separated parts (vocal, guitar, piano, other, bass, drums), and Octave to shift it |
What the mixer holds is of two kinds. The mix — each line's volume and pan, the Score group's — is part of the piece and is written in the file, once the score sounds with a mix (until then Save writes it). The rest is the listener's own and is not saved: the lines silenced or soloed, the Master fader and pan (over everything the preview sounds) and the faders of a recording's separated parts — as the tempo, Count-in and Metronome are.
Reset Listening, at the right of the MASTER row, puts what you hear back to what the file says: no solo, the Master at 0dB and in the middle, the Score's Play and All as they start, the recording off with its parts, their faders and pans, and its octave as recorded, the score's own mix chosen again after another was tried, and — while no mix is heard, (Default) — the faders, pans and lines turned on or off that were not saved. A named mix's faders are the file's: Ctrl+Z undoes them. The tempo, Count-in and Metronome are not in it. The mixer button is lit exactly while what you hear differs from what the file says, and a change made while it plays — in either panel — goes on from the same place.
05
Each part's range
Range in the preview's header (a double-headed arrow beside a note) opens a panel over the score with each part's lowest (▼) and highest (▲) note, spelled as written, with the bar it stands in. Click one to see it on the score, with the editor's caret on it; a pitch written in several places says how many (2/3) and goes on to the next with each click.
Under them is the part's tessitura — where it spends four-fifths of its sounding time (G4–E5), which tires a singer more than the top note does — over a small chart of the time spent on each semitone from the lowest note to the highest. The panel follows the score picked in the header and every edit while it is open. The pitches are the sounding ones, with C4 for middle C.
06
Audition
With a preview open, edits sound through the preview's synthesizer, with the pitches the
compiler plays: the note, chord or @chord shape the caret lands on (once per
note, not on every arrow-key repeat), a note as you type it once its pitch and octave marks
are in, and the result of every step. Nothing sounds while no preview is open.
"lilysharp.playback.audition": false turns it off; Alt+P and
Alt+M keep working either way.
07
Sound fonts
The preview plays each part with the General MIDI instrument its midiInstrument
or instrument preset names — the same sounds the exported MIDI asks for. Which recording of
those instruments you hear is the sound font. To play a part on a VST3 instrument of your
own instead — a sampled orchestra, a piano, a synthesizer — name it with sound "…":
Your instruments.
- Out of the box Lily# Studio plays MuseScore_General (MIT), from the Lily# Sound
Font extension that installs with Lily# Studio — full and stereo, the same on every computer. It
is a separate extension so that its 38 MB come down once, not with every update. Without it,
Lily# Studio plays the General MIDI bank your computer already has (Windows'
gm.dls, a Mac's DLS bank: every instrument, but small and dated; on Linux none, and simple tones). - For another sound, download a free General MIDI sound font and choose it. Any
.sf2,.sf3or.dlsworks. Export as WAV, Export as MP3 and Export as MP4 Video play through the same font, so a file sounds as the preview does.
Fonts to try
From the nearest to the default to the most different. The links go to each font's own publisher; read its licence there.
| Sound font | Size | Licence | Against the default |
|---|---|---|---|
| FluidR3Mono_GM.sf3 | 14 MB | MIT | the font MuseScore_General grew from, lighter and mono; MuseScore 2's default — near the default, for a slower computer |
| GeneralUser GS | about 30 MB | its author's own, free | balanced and clean, by S. Christian Collins, who later worked on MuseScore_General: a step away, light to load |
| Timbres of Heaven 4.00 | 285 MB download, 420 MB unpacked (.7z) | free; not to be shared on other sites | large and rich, Roland GS, about 260 instruments: clearly different — and about four times as loud, so start with the volume down |
If you have MuseScore 4, its MS Basic.sf3
(C:\Program Files\MuseScore 4\sound on Windows) is MuseScore_General in higher
quality — the same instruments as the default, and hard to tell apart. MuseScore 4's Muse
Sounds are not sound fonts and play only inside MuseScore; for instruments of that kind,
send Lily# Studio's notes to a DAW or a VST host through MIDI output, or open an
exported MusicXML in MuseScore. More fonts, and their licences, on MuseScore's
sound font page.
Setting one up
- Download the file. Some come packed (
.zip,.7z): unpack it and keep the.sf2or.sf3. Keep it in a folder you will not tidy away — Music\SoundFonts, say. Lily# Studio reads it from there; it does not copy it. - In VS Code, open the command palette (Ctrl+Shift+P, Cmd+Shift+P on a Mac), type sound font and choose Lily#: Choose Sound Font… — its last item, Find More Sound Fonts…, opens this page.
- Pick Browse for a file… and select the file you downloaded.
- The open previews switch to it — press ▶ to hear the difference. A large font takes a few seconds to load each time a preview opens; a loud one can be brought down with the mixer's faders.
Switching back and forth. Choose Sound Font… remembers the last five fonts
you have used and lists them under Default, so trying one against another is a pick,
not a browse. A font whose file is not there when you open the list — on a drive that is not
plugged in, say — is left out until it is back; the 🗑 button beside a font takes it off the
list (the file stays where it is). To go back to the sound Lily# Studio starts with, pick
Default. The choice is the lilysharp.playback.soundFont setting, which
holds the file's path.
08
MIDI output: a DAW, a VST host, or the computer's own synth
A sound font is one recording of the General MIDI instruments. For your own
instruments — a sampled piano in a DAW, a VST or AU synth, a hardware module — have Lily# Studio
send MIDI instead: lilysharp.playback.MIDIOutput names a MIDI output port of
your machine, and the ▶ button, Alt+P / Alt+M and the auditions
all go there. The follow-along highlight runs as before.
- Have a port the receiver listens on. On Windows, Microsoft GS Wavetable Synth is
there already — the computer's own synth, with no setup; for a DAW or a VST host install
loopMIDI and add a
port. On a Mac, switch on the IAC Driver bus in Audio MIDI Setup. On Linux the ALSA
sequencer's clients are the ports: a FluidSynth / Qsynth, a DAW's input, whatever
aconnect -llists. - In VS Code, open the command palette and choose Lily#: Choose MIDI Output…; pick the port.
- In the DAW, set a track (or a template with a track per part) to take MIDI from that
port on the part's channel — the parts take channels 1, 2, 3… in score order, as the
exported MIDI does, and the drums channel 10; a part may name its own,
part lead { midiChannel 3 }— and press ▶.
The DAW can follow too: while the preview plays through the port it sends the song position,
Start / Continue / Stop and the MIDI clock (lilysharp.playback.MIDIClock, on by
default), so a DAW set to sync to external MIDI clock runs with the score from the same bar — its
tempo changes, the practice tempo and the count-in included — and its own tracks and tempo-synced
effects play along. A loop, an A-B repeat or a bar played alone sends no clock. For its bars to match the score's, import the score's tempo map
first: Export as MIDI → Tempo map for a DAW, or the REAPER script.
Each part sends its General MIDI program (its midiInstrument or
preset) when playback starts; a DAW track that keeps its own instrument ignores it. The
auditions strike on channel 16. To go back to the sound font, choose The preview's own
synth in the same picker. A port that is not there when you press ▶ — a device
unplugged — makes the preview play its own synth, with the reason in the status bar. With
both settings set, the port wins: the sound font plays only while no port is named or the
named port is not there. The port
is reached through each system's own MIDI API (winmm, CoreMIDI, the ALSA sequencer); it has
been tried on Windows so far.
09
Stepping: Ctrl+Shift+Up / Down, Ctrl+Shift+PageUp / PageDown
Two pairs of keys that step what the caret is on, one notch at a time: Ctrl+Shift+Up / Down to the next note of the key, Ctrl+Shift+PageUp / PageDown by an octave.
| On | Up / Down |
|---|---|
| a note, Ctrl+Shift+Up / Down | moves it to the
next note of the key in force, spelled as the signature spells it: key c major
walks the white keys, key f major steps a → bes →
c. A minor key walks its signature, its natural minor (key a minor:
the notes of C major, g → a; a gis is written), and a
church mode its own. A note off the key steps
to the nearest note of the key that way (cis in C major: Up d, Down
c). The note keeps its pitch —
where the new letter would land in another octave, the marks are corrected (b' →
c''). A chord member moves alone. |
a chord as a whole (its > or its duration), Ctrl+Shift+Up / Down | inverts it: Up raises the lowest note an octave (<c' e' g'> → <c'' e' g'>), Down lowers the highest; the other notes keep their pitches. Ctrl+Shift+PageUp / PageDown there move the whole chord (<c' e' g'>'). |
| a note, Ctrl+Shift+PageUp / PageDown | adds one ' (Up) or , (Down) — or takes away one of the other mark. Inside < > or << >> only the member under the caret moves; on the chord's > or its duration, the whole chord moves. With a selection, every note in it steps. It is a plain mark edit, so in relative mode the notes after it follow. |
a chord name — @chord(Cm7) or a row's Cm7 | Down on a name with no shape writes its usual shape and the diagram appears (@chord(Cm7) → @chord(Cm7 x35343), G → G(320003)); further Downs and Ups walk the other playable shapes, frets 10–15 included; Up back at the usual shape removes it. The status bar says where you are: Cm7: shape 4 of 33 (x3x546). With shapes for two instruments written (@chord(C x32010 0003)), the one under the caret steps on its own instrument: C (ukulele): shape 2 of 39 (0403). |
a chord name — a row's, an @chord(…)'s, a chord(…) or diagram(…) item's — Ctrl+Shift+PageUp / PageDown | walks the seventh chords of the key instead of the shape: in C major Cmaj7 → Dm7 → Em7 → Fmaj7 → G7 → Am7 → Bm7-5, stopping at I and at VII, from the degree the name's root stands on (C and C7 stand on I too). The status bar says Dm7: IIm7 of c major (2 of 7). A minor key walks its own; a name whose root is outside the key stays, and the status bar says so. |
a chord's shape — the caret on x35346 in @chord(Cm7 x35346), chord(…) or diagram(…) — Ctrl+Shift+PageUp / PageDown | steps the shape as Ctrl+Shift+Up / Down do, but through the shapes with a five-fret stretch too: @chord(Cm7 xx5546) → @chord(Cm7 8xx546), and the status bar marks it — Cm7: shape 8 of 53 (8xx546, stretch). Ctrl+Shift+Up / Down walk the same line skipping the stretch shapes, so you can change pairs anywhere. |
a chord(…) or diagram(…) item | steps its shape the same way on the part's own instrument (from chord(C), Down writes the usual shape). Up at the usual shape takes the item's shape away (chord(F 133211) → chord(F); diagram(Cmaj7 x32000) → diagram(Cmaj7), which still draws and plays the usual shape), and stops a shape with no symbol. |
a chord(…) or diagram(…) item with no symbol — diagram(x32010) — or an @chord(x32010) | steps through the other shapes of the chord it sounds (x32010 is C: the status bar says C: shape 2 of …), rewriting the shape only; Up at the first shape keeps it. |
a chord(…) or diagram(…) item, right-click | Convert to Chord Notes <…> writes it out as the chord it plays — diagram(133211)4 → <f,\6 c\5 f'\4 a'\3 c'\2 f''\1>4 — with the octave marks it needs where it stands (a chord(…) item keeps its name as a bare @chord: chord(F)1 → <f a c>1@chord), and the file sounds the same. |
a <…> chord, right-click | Add Guitar Diagram adds the shape a hand holds it by — <g b d' f'>1 → <g b d' f'>1@diagram(xx5431). With the caret on the shape, Ctrl+Shift+Up / Down walks the other ways to hold the same notes (fingering 2 of 3). Edit the notes later and the diagram is warned (LYS1057), with a quick fix that writes the chord's own. On a single note of a guitar part the light bulb (Ctrl+.) offers it too: c'1 → c'1@diagram(xxxx1x).Convert to Chord Symbol chord(…) goes back the other way — <f,\6 c\5 f'\4 a'\3 c'\2 f''\1>1@chord(F) → chord(F 133211)1 — named from the notes when no @chord(NAME) says it, with the shape when its close voicing is not the notes; the file sounds the same, or nothing changes. |
a tempo | changes the metronome number: Ctrl+Shift+Up / Down by 1, Ctrl+Shift+PageUp / PageDown by 10 (tempo "Allegro" 4 = 120 → 130). Never the beat unit or a swing 16; it stops at 1. |
a key, Ctrl+Shift+Up / Down | moves it a fifth round the circle — one sharp more, or one flat more: key c major → key g major, Down → key f major. The mode stays (a minor → e minor); it stops at seven sharps or flats. Only the signature changes, not the notes. |
a key, Ctrl+Shift+PageUp / PageDown | PageUp: the parallel key — same tonic, other mode (c major ⇄ c minor). PageDown: the relative key — same signature, other mode (c major ⇄ a minor). Major and minor only. |
a clef | Ctrl+Shift+Up / Down: the clef for higher / lower notes — bass → tenor → alto → treble, stopping at either end — a part header's clef bass or a clef inside music. Ctrl+Shift+PageUp / PageDown: an octave — treble_8 ⇄ treble ⇄ treble^8, bass_8 ⇄ bass. Only the clef changes, not the notes. |
a dynamic (the caret after its @) | Ctrl+Shift+Up / Down steps it a level: pp → p → mp → mf → f → ff. On @cresc / @decresc, either pair writes @cresc (Up) or @decresc (Down), and the @!cresc that ends it changes with it. The accent dynamics step among themselves: @fp → @rf → @rfz → @sf → @fz → @sfz → @sffz. Ctrl+Shift+PageUp / PageDown on a level places it, as on an articulation below. |
an articulation (the caret after its @) | Ctrl+Shift+PageUp / PageDown places it: PageUp .down → none (its own side) → .up, PageDown back, stopping at either end — on every mark that takes .up / .down: an articulation, a dynamic level, @text(…), @diagram(…), @todo(…). Ctrl+Shift+Up / Down steps it along its group, Up towards the up-bow, the hammer-on, the longer, the stronger, the one above, stopping at either end: @downBow → @upBow, @pullOff → @hammerOn, @staccatissimo → @staccato → @portato → @tenuto, @accent → @marcato, @shortFermata → @fermata → @longFermata, @mordent → @prall, @reverseTurn → @turn, @pralltriller → @trill → @trillSpan (stepping back deletes its @!trillSpan), @heel → @toe, @scoop → @plop, @fall → @doit, @breath → @caesura, @stemDown → @stemUp, @15mb → @8vb → @8va → @15ma, @rall → @rit → @accel; Down goes back. Related marks are a key apart even where the order means little: @unaCorda → @sostenuto → @sustain, @editorial → @courtesy, @repeatTie → @laissezVibrer, @flageolet → @harmonic, @arpeggio → @arpeggio(bracket). The @! that ends a span changes with its start, and on the end (@!accel) the keys step the start and the end together. A span start that nothing closes (@rit with no @!) gets its end when it steps: @!accel on the last note of its bar, or of the next bar when it stands on that last note itself. An argument from a list steps too: @notehead(…), @pluck(…) and @figuredBass(…) down the list Ctrl+Space shows, @mark("A") to the next letter (or number) Up, @finger(…) and @bend(…) Up to the larger, @feather(…) Up to right. A .up / .down stays. On Up / Down a mark in no group (@tap), a dynamic on no ladder (@niente) and a bare @chord on a chord step the note, member or chord they are written on instead — <c' e' g'>@chord inverts it. |
a navigation mark in a form — segno, dc al fine … | Ctrl+Shift+Up / Down steps it among its kin in the completion's order, Down the next, stopping at either end: segno ⇄ coda, to coda ⇄ fine, and dc ds dc al fine dc al coda ds al fine ds al coda. |
a music keyword — grace, acciaccatura, appoggiatura, break, pageBreak, noBreak, noPageBreak | Ctrl+Shift+Up / Down steps it among its kin, stopping at either end: Down grace → acciaccatura → appoggiatura, Up break → pageBreak and noBreak → noPageBreak. |
a time | Ctrl+Shift+Up / Down: the beats by 1 (3/4 → 4/4). Ctrl+Shift+PageUp / PageDown: the common meters by the length of the bar — 3/8 2/4 6/8 3/4 2/2 4/4 9/8 12/8. |
a part's octave N | either pair steps N by 1 (0 to 8); every bare note of the part moves with it. |
an octave absolute / octave relative — the file's or one inside music | Up runs Convert Octaves to Absolute, Down Convert Octaves to Relative (either pair): the whole file is rewritten into that mode, every note keeping its pitch, and the file's octave line stays, naming the new mode. To change the word alone, type it. |
a transpose to a pitch | Ctrl+Shift+Up / Down: the target a semitone, spelled so the transposed key has the fewest sharps or flats (transpose d → ees); the status bar says how far. Ctrl+Shift+PageUp / PageDown: an octave mark (d → d'). |
a transpose by a number | either pair steps it a semitone (transpose +1 → transpose +2, −11 to +11, a sharp or flat after it kept) and the status bar names the key the piece lands in (transpose +1: key c major -> des major). A top-level transpose moves the whole piece — every part, its own transpose included, the key signatures and the chord rows. |
a part's midiInstrument "…" | Ctrl+Shift+Up / Down walk the 128 General MIDI sounds, Up to the one before in the list; Ctrl+Shift+PageUp / PageDown their families of eight. Each new one sounds, and the status bar names its number and family. |
a part's or a chord row's sound "…" | with Suonatore: the sounds kept for that VST3 instrument, as completion lists them — Ctrl+Shift+Up / Down one at a time, Up to the one before; Ctrl+Shift+PageUp / PageDown eight at a time. Each is heard, in the score while it plays. |
a mix row's volume | Ctrl+Shift+Up / Down by 1 dB, Ctrl+Shift+PageUp / PageDown by 6 dB (twice or half the level), up to +6dB; going down they stop at -40dB, and the next press is -60dB, silence. The status bar says what changed, and the open mixer's fader follows. |
a mix row's pan | Ctrl+Shift+Up / Down by 1, Ctrl+Shift+PageUp / PageDown by 10, as the mixer's knob moves — Up towards the right speaker, Down towards the left, through C. |
a mix row's on / off | Up (or PageUp) writes on, Down (or PageDown) off; at either end they stop and say so. |
| anything else | Ctrl+Shift+Up / Down: nothing on Windows and macOS; on Linux, VS Code's own Add Cursor Above / Below. Ctrl+Shift+PageUp / PageDown: VS Code's own Move Editor Left / Right in Group (nothing on macOS) |
All cursors step in one undo step. The shapes walked are the playable ones — at least
three strings, chord tones only, the root lowest, within four frets and four fingers;
stretch shapes (fretted frets five apart) are left out, save on Ctrl+Shift+PageUp / PageDown with the caret on the shape. Hover a chord to see what it
draws, or what Down would write. In a score whose layout says chordDiagrams all a
name already draws its usual shape, so there Down writes the next one. What a diagram
is and which instrument it is drawn for: Chords and chord
diagrams.
To use other keys, open Keyboard Shortcuts (Ctrl+K
Ctrl+S) and bind lilysharp.stepSemitoneUp / lilysharp.stepSemitoneDown
(a note of the key) or lilysharp.stepUp / lilysharp.stepDown (octave).
10
Completion, hover, fixes
- Lessons. At the top level of a
.lysfile Ctrl+Space offerslesson-01-completion; typelessonfor all twelve — from the completion list and the preview to drums, a band and a jazz chart. Each is a score whose steps are marked in red in the preview (@todo); picking one replaces the file, after asking. The same lessons are on the Learn pages. - Completion (Ctrl+Space) offers what can come next — after
lyrics NAMEit offerson, then the part names in the file; insidelayout { },fonts { }andpaper { }the keys and their values; inside a mix's block the file's lines, then a line's settings, then levels in dB, each with what it comes to (-6dB: 50% of the written level); aftermixat the top level a block that starts with a free name (mix1) to keep or type over, and among a score's items the file's mixes by name. In a section's music it offers the key's chords, and accepting one writes its notes (IIm7in C writes<d f a c>); in achordsrow or an@chord(…)it offers the key's chord names. - Hover names a chord — symbol, degree and pitches (
Dm (IIm) D4 F4 A4) — and shows a chord's diagram, or how to add one. Over a phrase's name it shows the phrase's length, how often the file plays it and its source; a drum phrase adds its beat as a grid, one row per drum. Over a score'smixit says which mix the score sounds with, row by row. - Value words complete too, and completing the keyword opens them at once:
instrument(each preset with the clef and tuning it sets),clef,key,tuning(each with its open strings),transpose(the targets from c, up and down, each with its interval —dup a major second,bes,down one),transposition(8va8vb15ma15mb), andmidiInstrument "the 128 General MIDI sounds. Hovering a preset lists what it sets. - Diagnostics as you type, worded to be acted on, and quick fixes where there
is one obvious repair: a section written at different lengths gets Add bar lines
(pad the shorter parts) and, when one part has cut it into sections, Split Sections to
Match a Part; a name or value that differs from a real one only in case
(
@upbow,X32010) gets Write '@upBow'; a missing brace or rest can be inserted. - Rename a part or a phrase and every reference follows; go to definition, find references, the outline, folding, formatting and semantic colouring work as in any language.
- A CodeLens over each section says how long it is, who writes it and how often each form plays it — or, when the parts disagree, each length and who writes it.
11
The status bar
Rest the caret on something and the status bar says what it is, in one line that stays in view while you type — no hover to wait for:
| The caret on | The status bar says |
|---|---|
| a note or a chord | the part, the bar the page prints, the beat and the pitches — bar 12 · beat 2 + 1/2 · D4; on a transposing part what they sound too (D4 sounds C4 on a clarinet) |
a time or a tempo | what it means — time 6/8: 2 beats of a dotted quarter, how long a beat lasts (a tempo marking with no number is only printed) |
| a dynamic or an articulation | its meaning, and for a dynamic the MIDI velocity it plays at — @staccato: short, detached |
| a setting | what it does — a clef's middle line, a key's sharps or flats and relative key, an octave, a transposition (written C4 sounds C3), a tuning's strings, a midiInstrument's number and family, an instrument preset's defaults, a page size |
a bar line or a section a form names | how often it plays — :|*3 plays 3 times; section A: 8 bars · the 2nd of 3 times this form names it |
12
Commands
In the command palette under Lily#:, and most of them on the editor's right-click menu. Every command that rewrites the file checks the result before it offers it, and applies as one undo step. Each one is described, with examples, on Lily# Studio commands.
| Command | Does |
|---|---|
| New Score · Edit New Score Template · Reset New Score Template | opens a new .lys from a template, with the title selected — a template you can make your own (your paper size, your name as the composer, the parts you always write) |
| Import MusicXML, MIDI or ABC… | turns a .xml / .musicxml / .mxl, a .mid or an .abc into a Lily# file — a faithful starting point, with a report of what was approximated |
| Convert Image/PDF to Lily# (.lys)… · Show Original Scan | reads printed music from a scan or PDF with the Calamo extension (Windows, Beta), the doubtful places marked @todo, and shows the page beside the score to check against |
| Fix OMR Marks with AI… · Edit Bars Beside the Scan | the marked bars of a score read from a scan, fixed by the AI against the scan's picture of each bar — or by hand, in the same panel: Calamo |
| Regroup (by part ⇄ by section) | rewrites the file between part bass { section A { … } } and section A { bass { … } } |
| Split Sections to Match a Part | when one part has cut a section into several (A of 16 bars + B of 121) and the others still write it whole, cuts the others — and the section's chord rows and lyrics — at the same bars, and makes every form play A B where it played A. If parts subdivide it differently it asks which to follow; one confirmation shows the plan. It is checked first — every cut part must sound and count exactly as before — and a slur, tie or hairpin across a cut is carried into the new section. A beam, a pedal or another span across a cut, or a cut mid-bar, is reported instead and nothing changes. Files grouped by part. |
| Convert Octaves to Absolute / to Relative | rewrites the whole file into the other octave mode, every note at the pitch it sounds, checked note by note |
| Extract Phrase from Section | lifts music into a phrase and puts its name in its place — only if it still sounds the same |
| Add Chord Track… | reads the chords the parts of the score in the preview play, beat by beat, and adds them as a chords track above that score's top staff — or harmonizes its melody alone; a starting point to edit |
| Guess Section Key… | reads the notes of the section at the cursor (or every section the selection touches) and offers its likely keys, best first; the one you pick is written as the key the section starts in, then the notes spelled against it are offered for respelling |
| Respell Notes to Key… | respells the section's notes to the key it starts in (fis → ges in G♭ major, or one spelling where fis and ges are mixed); you choose which respellings to apply, and every note keeps its pitch |
| Remove All String Numbers | removes every \1 … \9 from the file, so the tab chooses each string itself — for a book brought over from LilyPond, which needed most of them written |
| Play Note at Cursor · Play Current Measure | Alt+P (hold) · Alt+M |
| Step Up · Step Down in the Key | Ctrl+Shift+Up · Ctrl+Shift+Down — above |
| Step Up · Step Down an Octave | Ctrl+Shift+PageUp · Ctrl+Shift+PageDown — above |
| Open Preview · Open Preview to Side | Ctrl+Shift+V · Ctrl+K V |
| Export as PDF / SVG / PNG / LilyPond / MusicXML / MIDI / WAV / MP3 / MP4 Video / VOCALOID | writes the file's scores |
| Ask AI in Chat · Rewrite with AI… · Compose with AI… · Select AI Model… · Set Up AI Tools for Claude Code | Ctrl+I asks in the chat — below |
13
Settings
In VS Code's Settings under Lily# Studio, in nine groups — Preview, Playback, Export, Editing, AI, Audio, Scans, Music Fonts and Library:
| Setting | Default | Does |
|---|---|---|
lilysharp.preview.openWithScore | true | open the preview beside a .lys file when it is opened (The preview) |
lilysharp.preview.theme | auto | the preview's colours: follow VS Code, light or dark |
lilysharp.preview.deck | black | the look of the header and the mixer: black metal, walnut, or walnutCheeks (black between walnut cheeks) |
lilysharp.playback.audition | true | sound notes as you edit (Audition) |
lilysharp.playback.soundFont | the computer's own | the sound font the preview plays with (Lily#: Choose Sound Font…) — which to install, and how |
lilysharp.playback.MIDIOutput | the preview's synth | a MIDI output port to play through instead (Lily#: Choose MIDI Output…) — a DAW, a VST host, the computer's own synth |
lilysharp.playback.MIDIClock | true | while playing through a MIDI output, send a DAW its sync: the song position, Start, Stop and the clock |
lilysharp.playback.highlightSource | true | while the preview plays, light the text of the notes sounding now in the editor |
lilysharp.playback.prepareSinging | afterEdit | when a sung voice is prepared: after each pause in your typing, or onPlay (on a slow computer) |
lilysharp.export.videoEncoder | ffmpeg on the PATH | the ffmpeg program Export as MP4 encodes with |
lilysharp.editing.typingAids | true | the typing aids above (Typing aids) |
lilysharp.editing.flatSpelling | full | how completion spells flats (both spellings compile) |
lilysharp.ai.editModel · ai.ghostModel | automatic | the models the AI features use (AI) |
lilysharp.ai.ghostCompletion | false | suggest the next measure as ghost text |
lilysharp.recordings.fetchLyrics | ask | whether Convert Audio to Lily# (.lys)… offers to fetch the song's words from LRCLIB first (Audio) |
lilysharp.scans.verifyOnSave | true | on saving a score read from a scan (Ctrl+S, not an auto save), check it against the scan |
lilysharp.fonts.folders | more folders to find SMuFL music fonts in, for fonts { music "…" } | |
lilysharp.library.folders | folders a using "…" is looked for in when its file is not beside the book, before Documents\Lily#\Library |
The score Lily#: New Score starts from is yours to change: Lily#: Edit New Score Template opens it (a copy of the built-in one the first time), and Lily#: Reset New Score Template goes back to the built-in one.
For a server you build yourself, lilysharp.developer.languageServer /
trace.server are not in the Settings screen but work written in
settings.json.
14
Ask AI and the AI features
The AI features use the language models VS Code offers — GitHub Copilot's, or those of another extension that provides models. Lily# Studio keeps no key or account of its own and has no telemetry; what happened is logged to an output channel on your machine.
Ask AI — Ctrl+I
Say what to change, in words and in any language: “add a bass line”, “make bar 5 a fill”, “harmonize the melody in thirds”, “transpose up a fourth”. Press Ctrl+I (Cmd+I) in the editor or the preview, click ✨ in the preview's header, or right-click a note or a bar on the score and choose Ask AI in Chat…: Copilot's chat opens with the file — and the note or bar right-clicked, or the editor's selection — in its input, unsent; finish the request and send. The chat reads the score as it stands, and its change goes into the score at once, as one unsaved edit (Ctrl+Z undoes it). Over the score a strip says AI changed: with a button for each place — ▶ B bars 3–5 plays that stretch — and Before (the score as it was, the notes taken away in red), Undo and ×; the notes added are green. Only what would break the score — it does not compile, a bar that does not add up, a syllable with no note — sends a change back to the chat. Lily#: Rewrite with AI… in the command palette asks Lily# Studio's own way, without the chat: a box for the request, and the candidate panel below, to play before anything is written.
- A selection is a hint of where to look, not a fence. Text selected in the editor, or the note or bar right-clicked on the score, says where; the whole score stays open to change, so a harmony line can bring its new part and its score row with it. With nothing selected, the request is about the whole score.
- The model reads the whole file — up to its input limit — with the Lily# grammar and the file's errors and warnings, and answers with edits: each a passage of the file and what replaces it. It works in absolute octaves, where every pitch says where it sounds; a file in relative octaves gets the change back in its own octaves on Accept.
- Every answer is compiled before you see it. One that does not compile, adds warnings, or puts notes more than an octave away from the ones they replace is sent back with the reason, for up to two repairs. A notification says the step — reading the score, generating, repairing, rendering — and names the model.
- You judge the music. The candidate panel engraves the score as it would be (After) and as it is (Before); switching keeps your place on the page. What the AI changed is green — only the notes it really changed — and 💬 under your request is its own word on what it did and why. ▶ (or Space) plays the side shown, or from a note you click; Ctrl+wheel zooms and a drag scrolls, as in the preview. Text after Accept opens the whole file as Accept would leave it, the changes marked — what is written in green, what goes struck in red — at the first change.
- Ask Again… tells the AI what to change about the candidate, and its answer takes the candidate's place. Nothing changes until you Accept (Enter), and one Ctrl+Z undoes it; Reject (Esc) leaves the file as it is.
Compose with AI
A new piece is composed in Copilot's chat. Ask it there in words — “a jazz piano trio playing a swinging blues”, “a dramatic string quartet in D minor, about 3 minutes, slow – fast – slow” — or choose File › New File… → Lily# Score (.lys)… → Compose with AI… (Lily#: Compose with AI… in the command palette), which asks what to compose and hands it to the chat. You see the model think and try, and you pick the model in the chat's own model menu: with Auto, the chat may take a light model for a short request, so for a piece choose a strong one by name.
- The chat reads how a piece for players is written through Lily#'s guide: an
instrumentfor every part, astaffGroupfor an ensemble, sections that contrast, a melody against its accompaniment, varied rhythm, articulations and dynamics — and how each kind of music is written: concert music, a band with its whole rhythm section, a jazz combo or a lead sheet, a song with its words. - It goes into a new score, named after the piece's title, unsaved, the request and the model at its head. The score you have open stays as it is — the chat is told so, and a new piece sent over another score is turned back.
- It is checked before you see it. A piece that does not compile, a bar that does not add up, a note its instrument cannot play or a word with no note goes back to the chat; once it compiles, it is checked as music once — a part with no instrument, every part in one rhythm — and what is found goes back for one revision.
- Ask for changes in the same chat (“slow it down a little”): each one goes into the piece at once, with the AI changed: strip to play it, see what was there before or undo it. Save the piece to keep it.
Fix the marks of a scan
For a score read from a scan, Fix OMR Marks with AI… proposes a fix for each bar the reader marked, with the scan's picture of the bar shown to the model and each proposal checked against the page before you see it; Edit Bars Beside the Scan opens the same panel to fix bars by hand — Calamo.
Ghost completion
lilysharp.ai.ghostCompletion (off by default) suggests the next measure as
ghost text just after you type a barline; each suggestion is compiled first and shown only if
it is valid. It needs a fast model, so it has its own choice,
lilysharp.ai.ghostModel. Switching it on offers to enable inline suggestions for
.lys files — Lily# Studio keeps them off there by default, because Copilot's own
completion slowed every keystroke in a score.
Choosing the model
Lily#: Select AI Model… picks one for good: lilysharp.ai.editModel for
Lily# Studio's own Rewrite with AI… (the command palette) and Fix OMR Marks, lilysharp.ai.ghostModel
for ghost completion. Without a choice, Ask AI takes the largest model on offer and passes over
the small ones, which write poor Lily#; ghost completion takes a small, fast one. Copilot's chat —
Ask AI in Chat (Ctrl+I) and Compose with AI — uses the model picked in
the chat's own model menu, not this one.
Copilot Chat knows the grammar
Lily# Studio gives Copilot the Lily# grammar as an instructions file for
.lys files, so Copilot Chat, agent mode and inline chat answer in Lily# instead
of guessing LilyPond. (Copilot's as-you-type suggestions do not read instructions files —
that is Copilot's rule.)
15
Other assistants and agents
The grammar Lily# Studio gives its models is a plain file in the repository,
docs/GRAMMAR_FOR_LLM.md:
the whole language, its gotchas and its reserved words, written for a model to read. Give it
to any assistant that writes .lys, and let the compiler close the loop the way
Lily# Studio does — lysc check song.lys prints every error and warning with its
line and column, and exits non-zero on an error. For generated music,
octave absolute keeps a wrong octave from cascading
(Pitches and octaves).
lysc mcp serves Lily#'s tools — the guides, reading a score and its
chords, the review, writing a score, checked first, and the singing voices — as an MCP server on
stdio, with the descriptions and answers Copilot's chat gets: for Claude Code, Codex, Gemini CLI or
a desktop chat. In the editor, Lily#: Set Up AI Tools for Claude Code registers it for you;
by hand, claude mcp add --scope user lilysharp -- <path of lysc> mcp.
16
Scores in Markdown
A fenced block marked lily# in a Markdown file draws its score in VS Code's
built-in Markdown preview, the way a mermaid fence draws a diagram. The fence
holds a complete file — an existing .lys pasted as it is — and draws its default
score (the unnamed one, else the first), laid out as a snippet: one page as tall as the music.
```lily#
part m { clef treble }
section A { m { c'4 d e f | g1 | } }
form { ~A }
score { staff m }
```
17
The lysc command line
The same compiler, for batch work and scripts:
lysc check song.lys // errors and warnings, nothing written lysc svg song.lys // song.svg, plus song-NAME.svg for each named score lysc svg --score tab song.lys // only the score named tab lysc svg --todo lesson.lys // with the @todo rings and memos lysc svg --set music=Bravura song.lys // another music font, over the file's lysc check --todo-as-error song.lys // fail while a @todo is left (--no-todo: say nothing) lysc pdf | png | midi | xml | ly | vsqx | lrc song.lys lysc wav --soundfont GeneralUser.sf2 song.lys // the editor's sound, through a sound font, as song.wav (needs Node.js; else a simpler synth) lysc import score.musicxml // MusicXML to .lys lysc octave --absolute song.lys // rewrite into absolute (or --relative) octaves lysc harmonize song.lys // suggest a diatonic chord track for the melody lysc layout song.lys // where the lines break, bars per system
-d DIR chooses the output folder, and --batch LIST runs a
command over many files in one process. lysc --help lists the rest.