06 Tutorial for music composing method "ABC"

Published: Feb. 18, 2026, 1:12 a.m. UTC / Updated: Feb. 18, 2026, 1:51 a.m. UTC
๐Ÿ‘ 0
๐Ÿ”– 0 Bookmarks
English

Embed sheet music in your articles. Write it as text, play it in your browser.

  • In PinotWalk, you can write sheet music using ABC notation, a text-based format.
  • It may look complicated, but you can learn the basics in just a few minutes. You can also ask the Secretary Muse to create it for you.

Muse01


๐ŸŽต What is ABC Notation?

ABC notation is an international standard format for representing sheet music as text.

X:1
T:Twinkle Twinkle Little Star
M:4/4
L:1/4
K:C
C C G G | A A G2 | F F E E | D D C2 |

โ†“ This displays and plays as sheet music like this:

X:1
T:Twinkle Twinkle Little Star
M:4/4
L:1/4
K:C
C C G G | A A G2 | F F E E | D D C2 |
  • Easy to copy, paste, and edit since it's text
  • Muse (AI Secretary) can compose automatically
  • Instant sheet music display + MIDI playback in your browser

๐Ÿ“ How to Write in PinotWalk

In the article editor, specify music as the language for the code block:

```music
X:1
T:Title
M:4/4
L:1/4
K:C
C D E F | G A B c |
```

That's all it takes to display sheet music and play it with the โ–ถ Play button.


๐Ÿ—๏ธ How to Write Headers

Write "header" information at the beginning of your sheet music.

Field Meaning Example Required
X: Tune number (sequence number) X:1 โœ…
T: Title T:Twinkle Twinkle โœ…
M: Time signature M:4/4 โœ…
L: Default note length L:1/4 โœ…
K: Key signature K:C โœ…
C: Composer C:John Smith โ€”
Q: Tempo (BPM) Q:1/4=120 โ€”

Minimal Header Example

X:1
T:Untitled
M:4/4
L:1/4
K:C

๐ŸŽผ How to Write Notes

Basic Note Names

C D E F G A B

Lowercase letters are one octave higher:

c d e f g a b   โ† Higher octave

For even higher octaves, add ' after the note name:

c' d' e'   โ† Even higher octave

To go one octave lower, add ,:

C, D, E,   โ† Lower octave

Note Length

When L:1/4 (default length = quarter note):

Notation Length Note Type
C 1x (default) Quarter note
C2 2x Half note
C4 4x Whole note
C/2 1/2x Eighth note
C3/2 1.5x Dotted quarter note

Rests

z   โ† 1-beat rest
z2  โ† 2-beat rest
Z   โ† Full measure rest

Bar Lines and Separators

C D E F | G A B c |   โ† | is a bar line

๐ŸŽน Common Time Signatures

M:4/4   โ† 4/4 time (most common)
M:3/4   โ† 3/4 time (waltz)
M:2/4   โ† 2/4 time (march)
M:6/8   โ† 6/8 time
M:C     โ† Common time (same as 4/4)

๐ŸŽต Key Signature

K:C     โ† C major (no sharps or flats)
K:G     โ† G major (1 sharp)
K:D     โ† D major (2 sharps)
K:F     โ† F major (1 flat)
K:Am    โ† A minor (no sharps or flats)
K:Em    โ† E minor (1 sharp)

Adding Accidentals to Notes

^C   โ† C# (sharp)
_E   โ† Eb (flat)
=F   โ† F natural (cancels previous accidental)

๐Ÿ”„ Repeats

|: C D E F | G A B c :||   โ† Repeat this section

|: C D E F :|: G A B c :|  โ† Two sections, each repeated

First and Second Endings

|: C D E F |1 G A B c :|2 G G G2 ||
               โ†‘1st time   โ†‘2nd time

โšก Tempo

Q:1/4=120   โ† Quarter note = 120 BPM (standard tempo)
Q:1/4=60    โ† Slow
Q:1/4=180   โ† Fast

๐ŸŽป Instrument Selection

You can specify General MIDI instruments using %%MIDI program.

%%MIDI program 0    โ† Piano (default)
%%MIDI program 40   โ† Violin
%%MIDI program 41   โ† Viola
%%MIDI program 42   โ† Cello
%%MIDI program 73   โ† Flute
%%MIDI program 56   โ† Trumpet
%%MIDI program 24   โ† Acoustic Guitar
%%MIDI program 19   โ† Church Organ

Place it in the header (before K:):

X:1
T:Air on the G String (style)
%%MIDI program 42
M:4/4
L:1/8
K:G
D4 G3 A | B3 A B d | e4 d3 c |

๐ŸŽน Writing Multiple Voices / Ensemble Parts

Using the V: (Voice) field, you can write multiple voices or instruments in a single score.

Basic Syntax

Declare voices in the header, then switch between them using [V:1] [V:2] in the body.

X:1
T:ใ‚ฟใ‚คใƒˆใƒซ
M:4/4
L:1/4
K:C
V:1 name="Violin"
V:2 name="Cello"
[V:1] c2 B2 | c4 |
[V:2] C,2 G,2 | C,4 |

Piano Right Hand + Left Hand

X:1
T:Piano Piece
M:4/4
L:1/4
K:C
V:1 clef=treble name="Right Hand"
V:2 clef=bass name="Left Hand"
[V:1] e2 d2 | c4 | d2 c2 | B4 |
[V:2] C,2 G,2 | C,4 | G,,2 G,2 | G,,4 |
  • clef=treble specifies treble clef, clef=bass specifies bass clef
  • Left hand uses lower notes, so C, (comma lowers by one octave) is used

Violin + Cello Ensemble

X:1
T:String Duo
M:3/4
L:1/4
K:G
V:1 name="Violin"
V:2 name="Cello"
[V:1] d2 B | G3 | A2 G | D3 |
[V:2] G,2 D | G,3 | D2 D | G,3 |

โš ๏ธ Risks with Per-Voice Instrument Assignment

When you want different instruments for each voice (e.g., separate sounds for violin and cello),
you can write %%MIDI program for each voice, but behavior is unstable.

Syntax you can try (not guaranteed to work):

[V:1] %%MIDI program 40
d2 B | G3 |
[V:2] %%MIDI program 42
G,2 D | G,3 |

Risk Details:

Risk Description
Per-voice settings ignored All voices may play as the same instrument (piano)
Non-standard syntax %%MIDI is not part of the official ABC v2.1 spec; depends on ABCJS implementation
Browser differences Behavior may vary between Chrome / Firefox / Safari
Score layout impact %%MIDI lines may affect sheet music layout

Practical Solutions:

  • If you don't need different sounds per voice, use a single %%MIDI program in the header for all voices
  • If sound is important, write each instrument in separate score blocks (separate ```music blocks)

Example of Separate Blocks:

Violin Part:

```music
X:1
T:String Duo (Violin)
%%MIDI program 40
M:3/4
L:1/4
K:G
d2 B | G3 | A2 G | D3 |
```

Cello Part:

```music
X:1
T:String Duo (Cello)
%%MIDI program 42
M:3/4
L:1/4
K:G
G,2 D | G,3 | D2 D | G,3 |
```

๐ŸŽผ Practical Examples

Twinkle Twinkle Little Star

X:1
T:Twinkle Twinkle Little Star
M:4/4
L:1/4
Q:1/4=120
K:C
C C G G | A A G2 | F F E E | D D C2 |
G G F F | E E D2 | G G F F | E E D2 |
C C G G | A A G2 | F F E E | D D C2 |

G Major Melody (Violin)

X:1
T:G Major Piece
C:Muse (PinotWalk)
%%MIDI program 40
M:3/4
L:1/8
Q:1/4=100
K:G
D2 G2 A2 | B4 AG | A2 B2 c2 | d6 |
e2 d2 B2 | G4 AB | c2 B2 A2 | G6 |

C Minor Piece

X:1
T:C Minor Piece
M:4/4
L:1/8
K:Cm
G2 ^F2 G2 =B2 | c4 G4 | _E2 D2 C4 | G,8 |

โ–ถ Playback Controls

How to use the buttons displayed below the sheet music:

Button Function
โ–ถ Play Start playback
โ–  Stop Stop (click to return to โ–ถ Play)

๐Ÿค– Let Muse (AI Assistant) Create It for You

If writing it yourself is difficult, call Muse from the editor toolbar and simply request what you want.

Request examples:

  • "Create a simple 8-bar melody in C major"
  • "A slow, sad melody for violin in 4/4 time"
  • "Transpose Twinkle Twinkle Little Star to G major"

Muse generates sheet music in ABC notation and inserts it directly into your article.


โ“ FAQ

Q: No sound is playing
โ†’ Check if your browser has audio permissions enabled. A browser confirmation dialog may appear on first playback.

Q: Sheet music isn't displaying
โ†’ There may be a syntax error in the ABC notation. Make sure all headers (X:, T:, M:, L:, K:) are present.

Q: Note pitches are wrong
โ†’ Uppercase (Cโ€“B) and lowercase (cโ€“b) indicate different octaves. Verify you're using the intended octave.

Q: I want to change the key signature mid-piece
โ†’ Write [K:G] in the body to change the key signature partway through.



Last updated: 2026-02-17 (Added multiple voices / ensemble section)

Comments

None