### Clairnote Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/clair.html Demonstrates enabling Clairnote notation with '%%clairnote 1'. This example shows basic note sequences in Clairnote. ```abc X:1 T:Clairnote notation M:C L:1/4 K:C V:1 %%clairnote 1 CDEF|GABc|^C_E^F_A|_BCcc'| V:2 CDEF|GABc|^C_E^F_A|_BCcc'| ``` -------------------------------- ### Example: Banjo Tablature with strtab Source: http://moinejf.free.fr/abcm2ps-doc/strtab.html This example demonstrates the use of `%%strtab` for a banjo, specifying string tunings and octave settings. It includes musical notation and tablature for a piece in C major. ```abc X:1 T:Banjo B:https://wim.vree.org/js2/tabDrumDoc.html B:original http://moinejf.free.fr/abcm2ps-doc/banjo.xhtml %%pagewidth 18cm M:4/4 L:1/4 V:1 treble-8 V:2 tab strings=G4,D3,G3,B3,D4 octave=-1 nostems K:C % V:1,2 z[B!5!g][c!5!g][^c!5!g] \ |: ^c/[dd]/ !5!g/!2!d/ d/!5!g/ !2!d/d/ | B/d/ B/d/ A/d/ G/d/ | E/c/ G/d/ !5!g/G/ d/!5!g/ | G/e/ !5!g/G/ e/G/ E/e/ | D/d/ !5!g/G/ d/!5!g/ B/d/ | ``` -------------------------------- ### ABC Music Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/breakoneoln.html A simple ABC music notation example demonstrating basic note sequences. ```abc X:1 M:C L:1/4 K:C cccc | ccc/ c/c | ``` -------------------------------- ### Example: Pure strtab Syntax for Banjo Source: http://moinejf.free.fr/abcm2ps-doc/strtab.html This example demonstrates using `%%strtab` with pure syntax for a banjo, specifying string tunings and overriding the default font for fret numbers. It includes a simple melody line. ```abc X:3 T:You are my sunshine T:pure %%strtab syntax G:banjo %%pagewidth 19cm %%tabfont sans-serifBold 10 M:none L:1/4 %%score 1 2 V:2 octave=-1 %%strtab GD,G,B,D K:G V:1,2 zDGA|B2B2-|BB^AB|G2G2-|GGAB|c2e2-| V:1 w:You are my sun-shine_ my on-ly sun-shine_ You make me hap-py ``` -------------------------------- ### abcm2ps Tune Filtering Example Source: http://moinejf.free.fr/abcm2ps-doc/types.xhtml This example demonstrates filtering tunes by title using a regular expression and clipping the output to specific measures. ```bash abcm2ps tune2.abc --tune 'T:Gloria' --clip -3 --tune end ``` -------------------------------- ### Grid with Column Count, Repeat Break, and Measure Inclusion Source: http://moinejf.free.fr/abcm2ps-doc/grid.html Example using %%grid with a specific column count (4), 'repbrk' to start new lines on repeats, and 'include=1-16' to define the grid from measures 1 to 16. ```abc X:2 %%grid 4 repbrk include=1-16 %%pagewidth 20cm %%measurenb 1 I:linebreak $ %%bstemdown 1 T:(I'll Be Glad When You're Dead) T:You Rascal You C:Words and music by Sam Theard (1931) M:4/4 L:1/4 K:Bb G B |: "Gm"d2 ^c d | B G "D7"B A | "Gm"G4- | G2 G B | $ w:I'll be glad when you're dead you ras-cal you_ I'll be w:** you in my home, you ras-cal you_ I'll trust d2 B d | g d g g | "D7"d4- | d2 G B | $ w:glad when you're dead you ras-cal you_ When you're w:you in my home you wouldn't leave my wife a-lone, I'll be "Gm"d2 d d | "D7"c2 c c | "Eb"B c B c | "D7"A2 G B | $ w:dead in your grave no more wo-men will you crave, I'll be w:glad when you're dead you ras-cal ***you._ "Gm"d2 ^c d | B D "D7"B A |["1." "Gm"G2 z2 | "D7"z2 G B :|["last" yyy"Gm"G4- | G2 z2 |] w:glad when you're dead you ras-cal you. I trust ``` -------------------------------- ### Example ABC file with infoline enabled Source: http://moinejf.free.fr/abcm2ps-doc/infoline.html This example demonstrates a complete ABC file structure with the infoline option enabled, showing how metadata like title, rhythm, and area are presented. ```abc X:1 T:tune title R:Gavotte A:Bretagne M:C L:1/4 %%infoline 1 K:C cccc | ``` -------------------------------- ### Font Declaration Examples Source: http://moinejf.free.fr/abcm2ps-doc/types.xhtml Examples demonstrate how to declare fonts with optional encoding and size parameters. The asterisk '*' can be used to retain the current font or size. ```abc %%vocalfont Arial 12 % Arial utf-8 12pt ``` ```abc %%vocalfont Times-Roman % Times-Roman utf-8 12pt ``` ```abc %%vocalfont * 13 % Times-Roman utf-8 13pt ``` ```abc %%vocalfont UKaiCN-UTF8-H native % UKaiCN-UTF8-H native 13pt ``` -------------------------------- ### Example ABC Notation Source: http://moinejf.free.fr/abcm2ps-doc/ss-pref.html This is a basic example of abc notation, demonstrating the structure of a musical piece with multiple voices. ```abc X:1 M:C L:1/4 K:Eb V:1 nm="Sax en Ut" EFGA | Bcde | V:2 nm="Sax en Mib" EFGA | Bcde | ``` -------------------------------- ### Basic Music Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/tieheight.html A simple music notation example in ABC format without any specific tie height configuration. ```abc X:1 M:C L:1/4 K:C c-cB-B | ``` -------------------------------- ### txtmus Repeated Sequence Playback Example Source: http://moinejf.free.fr/abcm2ps-doc/txtmus.html This example demonstrates txtmus's handling of explicit variants in repeated sequences using non-standard music extensions. ```abc |: A |1 B |2 C ]| D |3 E :| F |] ``` -------------------------------- ### Parameter Override Example with Lock Source: http://moinejf.free.fr/abcm2ps-doc/overview.html Demonstrates how parameters set via command line with the 'lock' keyword take precedence over pseudo-comments. ```abc %%vocalfont Times-Roman * % <- ignored %%vocalfont Helvetica * lock % <- vocalfont = 'Helvetica 13' ``` -------------------------------- ### Basic ABC Music Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/squarebreve.html A simple ABC notation example demonstrating basic note durations and key signature. This serves as a baseline for applying options. ```abc X:1 M:4/2 L:1/2 K:C c2c2 | c4 | c4 | ``` -------------------------------- ### Example: Mountain Dulcimer Tablature with strtab and diafret Source: http://moinejf.free.fr/abcm2ps-doc/strtab.html This example showcases `%%strtab` with the 'diafret' keyword for a mountain dulcimer, indicating diatonic frets. It includes specific string tunings and octave settings for multiple voices. ```abc X:2 T:Abide with me C:Arranged for Mountain Dulcimer & ©2008 by Alan R. Barnarsd B:https://www.dulcimer.net/wp-content/uploads/2017/08/abide_with_me2.pdf B:https://wim.vree.org/js2/tabDrumDoc.html %%pagewidth 20cm %%score (A C B) (1 2 3) M:4/4 L:1/4 I:linebreak $ K:D V:1,2,3 tab octave=-1 strings=D4,A3,D3 diafret % V:A,B,C %%pos orn hidden % [V:1,A] f2 f e | d2 a2 | b a a g | f3 z | [V:2,B] D D !1!A G | z F F2 | G E E E | !1!A3 z | [V:3,C] A2 c c | B2 d c | d c c A | d d c B | % [V:1,A] f2 g a | b2 a2 | g e f !2!^g | a4 | [V:2,B] D D D F | G G F2 | E E D B | E4 | [V:3,C] A2 B d | d2 d d | B A A d | c2 g2 | % [V:1,A] f2 f e | d2 a2 | a g g f | e4 | [V:2,B] D !1!A !1!A G | F F F2 | G2 D2 | z G F E | [V:3,C] A2 c c | B2 d c | B2 B2 | B4 | % [V:1,A] e2 f g | f e d g | f2 e > d | d4 |] [V:2,B] z E D E | D E F E | D D2 G | F2 D2 |] [V:3,C] A2 A A | A A B B | A2 A2 | A4 |] ``` -------------------------------- ### Slash Notes Mapping Example Source: http://moinejf.free.fr/abcm2ps-doc/slash.html Demonstrates mapping slash notes to specific glyphs (sl1, sl2, sl4) and printing them with a stem down. This example uses a custom map for slash notes. ```abc %%show_source * X:1 T:slash notes M:4/4 L:1/4 %%maxshrink 0 U: s=!stemless! %%map sl f heads=sl1,sl2,sl4 print=A K:none map=sl %%pos stem down "G"sfsfsfsf | "D"sfsf "A"sfsf | z/"D"f/ z/"A"f/ sf2 | "G"f4 y2 |] ``` -------------------------------- ### ABC Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/tabac2.html Example of a traditional song in ABC notation format. Ensure the ABC notation parser is enabled. ```abc X:1 T:J'ai du bon tabac C:Trad. M:2/4 L:1/8 Q:1/4=120 %%linebreak $ K:C CDEC|D2DE|F2F2|E2E2|CDEC|D2DE|F2G2|C4:| G2GF|E2DE|F2G2|F2E2|G2GF|E2DE|F2G2|D4| CDEC|D2DE|F2F2|E2E2|CDEC|D2DE|F2G2|C4|| ``` -------------------------------- ### Abcm2ps/abc2svg Music Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/partsspace.html A basic ABC notation example demonstrating tune title, meter, and part definition. This serves as a template for music content. ```abc X:1 T:title of tune M:C L:1/4 P:AA(2) K:C P:A CDEF | GABc || ``` -------------------------------- ### abcm2ps Regular Expression Example Source: http://moinejf.free.fr/abcm2ps-doc/types.xhtml This example shows how to use regular expressions with abcm2ps to filter voices by name and transpose music. ```bash abcm2ps tune1.abc --voice Bb --transpose 2 --voice end ``` -------------------------------- ### Set up abc2svg document Source: http://moinejf.free.fr/abcm2ps-doc/center.html Basic setup for an abc2svg document including font and page dimensions. ```abc %abc-2.2 %%musicfont url(../js/abc2svg.ttf) %%pagewidth 14cm %%rightmargin 0.8cm %%leftmargin 0.8cm %%topspace 0 ``` -------------------------------- ### Disabling Keywarn Source: http://moinejf.free.fr/abcm2ps-doc/keywarn.html This example shows how to disable the %%keywarn directive by setting it to 0. No cautionary key signature is added when the key changes from G to F. ```abc X:2 M:C L:1/4 K:G %%keywarn 0 GGGG | GGGG | K:F FFFF | ``` -------------------------------- ### Playswing Example with Default Values Source: http://moinejf.free.fr/abcm2ps-doc/swing.html This snippet demonstrates ABC notation without explicitly setting the playswing parameter, showing default behavior. ```abc X:1 M:C L:1/4 K:Gm "Gm6"d/d/c/B/"E7b"AG|"A7b9"=EG/^F/-"D7b9"F2| ``` -------------------------------- ### Standard Music Notation (SMN) Example Source: http://moinejf.free.fr/abcm2ps-doc/mdnn.html Shows the standard music notation (SMN) output for the same lullaby. This serves as a comparison to the MDNN format. ```abc X:2 T:Lullaby of birdland T:(SMN) C:G. Shearing M:C L:1/4 K:Gm d/d/c/B/AG|=E/>G/- G/^F/-F2| D/>A/- A/G/-G2|E/>d/- d/c/-c2| f/f/e/d/cB|G/>d/- d/c/ ^F/>d/- d/c/| F2z/>c/- c/B/|E/>B/- B/A/D2| ``` -------------------------------- ### Timewarn Directive Example Source: http://moinejf.free.fr/abcm2ps-doc/timewarn.html This example demonstrates the %%timewarn 1 directive, which enables the addition of a cautionary time signature at the end of the previous line when a time signature change occurs at the beginning of a new line. The music notation changes from C to 3/4. ```abc X:2 M:C L:1/4 K:C %%timewarn 1 cccc | cccc | M:3/4 ccc | ``` -------------------------------- ### Basic ABC Notation with Words Source: http://moinejf.free.fr/abcm2ps-doc/wordsspace.html A simple ABC notation example with lyrics. This snippet demonstrates the basic structure for including words. ```abc X:1 M:C L:1/4 K:C cccc | cccc | W:Here are the words W:At end of tune ``` -------------------------------- ### Gamelan Notation Example 2 Source: http://moinejf.free.fr/abcm2ps-doc/gamelan.html This snippet demonstrates the gamelan notation in a second ABC file, showing the same musical content with the gamelan parameter enabled. ```abc X:2 %%composerfont sans-serif 13 %%historyfont sans-serif 13 %%gchordfont sans-serifBold 14 %%tempofont sans-serif 13 %%titlefont sans-serif 30 %%vocalfont serif 12 %%stretchlast 1 T:Dia C:Song by : Anja C:Transcribed : Dede Suwanda %scale N:1=C Q:"Tempo : Slow" M:4/4 L:1/4 %%titleformat T,N-1Q-1M-1C1C1 K:C ||zzz/c/ B/c/|"F"a3b/c'/|"C"g2z/c/ B/c/| "F"a3b/c'/|"G7"d'3z/c/| w:|||||*Di| ||:"C"e(3d/c/B/ d/c/ B/A/|"Am"c(3B/A/G/ "Am7/G"E/D/- D/-D//E//| "F"F/G/ A/c/ "C/E"B/A//G//- G/-G//E//|"Dm"F/G/ A/c/ "G7"c/d//d//- d/-d//c//| w:sua-tu ha-ri am-pa se-nga-ja ki-ta ber-te-mu_* +:A-ku yang per-nah ter-lu-ka_* Kem-ba-li me-nge-nal cin-ta_* Ha w:uh wak-tu ber-ja-lan ki-ta la-lu-I ber-sa-ma_* +:Be-ta-pa di-se-tiap ha-ri_* Ku-ja-tuh cin-ta pa-da-nya_* Di ``` -------------------------------- ### Standard Lyric Spacing Source: http://moinejf.free.fr/abcm2ps-doc/vocalspace.html A basic ABC notation example demonstrating standard lyric spacing. ```abc X:1 M:C L:1/4 K:C ccc2 | w:nor-mal space ``` -------------------------------- ### ABC music notation with breaklimit set Source: http://moinejf.free.fr/abcm2ps-doc/breaklimit.html An ABC notation example demonstrating the use of the %%breaklimit parameter to adjust line breaks. ```abc X:2 M:3/4 L:1/4 %%breaklimit 0.9 K:C c/c/cc | ccc | c/c/cc | c/c/cc | c3 | ``` -------------------------------- ### Default autoclef behavior Source: http://moinejf.free.fr/abcm2ps-doc/autoclef.xhtml This example demonstrates the default behavior where autoclef is enabled, and clefs are initialized to 'auto'. ```abc X:2 M:C L:1/4 K:C cGEC | E,G,Cc | ``` -------------------------------- ### abc2svg Configuration for Graceword Example Source: http://moinejf.free.fr/abcm2ps-doc/graceword.html This snippet shows the necessary abc2svg directives to enable and configure the graceword feature for music generation. ```abc %%musicfont url(../js/abc2svg.ttf) %%singleline 1 %%rightmargin 0.8cm %%leftmargin 0.8cm %%topspace 0 %%titleleft 1 ``` -------------------------------- ### MDNN Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/mdnn.html Demonstrates the Modernised Diatonic Numerical Notation (MDNN) output for a lullaby. This format is enabled by the %%mdnn 1 directive. ```abc X:1 T:Lullaby of birdland T:(MDNN) C:G. Shearing M:C L:1/4 %%mdnn 1 K:Gm d/d/c/B/AG|=E/>G/- G/^F/-F2| D/>A/- A/G/-G2|E/>d/- d/c/-c2| f/f/e/d/cB|G/>d/- d/c/ ^F/>d/- d/c/| F2z/>c/- c/B/|E/>B/- B/A/D2| ``` -------------------------------- ### Set Parameter via Pseudo-Comment Source: http://moinejf.free.fr/abcm2ps-doc/overview.html Use pseudo-comments starting with '%%' to set parameters directly within ABC files. This method is straightforward for inline configuration. ```abc %%parameter_name new_value ``` -------------------------------- ### Basic ABC Music Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/tm-readme.html A simple ABC music notation sequence representing a C scale. This can be pasted into the txtmus editor. ```abc X:1 T:C scale M:C L:1/4 K:C CDEF|GABc| ``` -------------------------------- ### Basic ABC Music Notation with Title and Subtitle Source: http://moinejf.free.fr/abcm2ps-doc/subtitlespace.html A simple ABC notation example demonstrating a title and a subtitle. This serves as a base for applying directives like subtitlespace. ```abc X:1 T:Title M:C L:1/4 K:C cccc | T:Subtitle cccc | ``` -------------------------------- ### Clairnote with Auto Clefs Source: http://moinejf.free.fr/abcm2ps-doc/clair.html Example of '%%clairnote 1' with automatic clef detection. The system infers the appropriate clef based on the notes being played. ```abc X:3 T:auto clefs M:C L:1/4 K:C %%clairnote 1 cGEC|CG,E,C,|c'4|C,,4|| ``` -------------------------------- ### Setting barsperstaff to 4 Source: http://moinejf.free.fr/abcm2ps-doc/barsperstaff.html This example demonstrates how to use the %%barsperstaff directive to set the number of bars per staff to 4. This is useful for controlling the visual density of the music. ```abc X:2 M:C L:1/4 %%barsperstaff 4 K:C cccc | cccc | cccc | cccc | cccc | cccc | cccc | cccc | ``` -------------------------------- ### Set Measure Number in abc2ps Source: http://moinejf.free.fr/abcm2ps-doc/setbarnb.html Use %%setbarnb in the tune header to set the starting number for measures. This example sets the first measure to number 10 and starts the music. ```abc X:1 M:C L:1/4 %%setbarnb 10 %%measurenb 1 K:C cccc | cccc | cccc | ``` -------------------------------- ### Graceword Feature Example in abc2svg Source: http://moinejf.free.fr/abcm2ps-doc/graceword.html Demonstrates the %%graceword 1 directive to shift lyric words to the starting grace note. This is useful for aligning lyrics with grace notes in musical notation. ```abc X:1 T:with %% graceword %%graceword 1 K:Db {/!~(!D}y!~)!G2 G2 G2 !~(!G2 y{/!~)!!~(!E}y!~)!F2 !~(!F2!~)! D2 D2 D2 D2 D2 A2 w:Ra-ma-chan-dra, Krish-na pra-bhur Ni-mai pan-dit ``` -------------------------------- ### Basic ABC Music Notation with Grace Notes Source: http://moinejf.free.fr/abcm2ps-doc/graceslurs.html Demonstrates a simple ABC music notation example featuring grace notes. Grace notes are indicated by curly braces. ```abc X:1 M:C L:1/4 K:C {G}c4 | {GAB}c4 | ``` -------------------------------- ### Demonstrate shiftunison directive in abc2svg Source: http://moinejf.free.fr/abcm2ps-doc/shiftunison.html Demonstrates the different modes of the shiftunison directive (0, 1, 2, 3) with corresponding musical notation examples. ```abc X:1 M:C L:1/4 %%score (1 2) K:C V:1 "Default"yc3/c/ c2 | c V:2 c/G3/c/G/G | c V:1 %%shiftunison 1 "shift 1"yc3/c/ c2 | c V:2 c/G3/c/G/G | c V:1 %%shiftunison 2 "shift 2"yc3/c/ c2 | c V:2 c/G3/c/G/G | c V:1 %%shiftunison 3 "shift 3"yc3/c/ c2 | c V:2 c/G3/c/G/G | c ``` -------------------------------- ### Voice Combine Examples Source: http://moinejf.free.fr/abcm2ps-doc/voicecombine.html Demonstrates the effect of different voicecombine values (-1, 0, 1, 2, 3) on combining notes and rests between two voices. ```abc X:1 M:C L:1/4 K:C %%score (1 2) V:1 P:voicecombine -1 %%voicecombine -1 c2cz | c2 c2 | c2 z2 | V:2 CEGz | z2 _B2 | c2 z2 | V:1 P:voicecombine 0 %%voicecombine 0 c2cz | c2 c2 | c2 z2 | V:2 CEGz | z2 _B2 | c2 z2 | V:1 P:voicecombine 1 %%voicecombine 1 c2cz | c2 c2 | c2 z2 | V:2 CEGz | z2 _B2 | c2 z2 | V:1 P:voicecombine 2 %%voicecombine 2 c2cz | c2 c2 | c2 z2 | V:2 CEGz | z2 _B2 | c2 z2 | V:1 P:voicecombine 3 %%voicecombine 3 c2cz | c2 c2 | c2 z2 | V:2 CEGz | z2 _B2 | c2 z2 | ``` -------------------------------- ### Default Keywarn Behavior Source: http://moinejf.free.fr/abcm2ps-doc/keywarn.html This example demonstrates the default behavior of %%keywarn when it is enabled. A cautionary key signature is implicitly added at the end of the first line when the key changes from G to F. ```abc X:1 M:C L:1/4 K:G GGGG | GGGG | K:F FFFF | ``` -------------------------------- ### Playswing Example with Custom Values Source: http://moinejf.free.fr/abcm2ps-doc/swing.html This snippet shows the 'playswing' parameter set to 66 0 34, altering the duration of two eight notes and inserting silence. ```abc X:2 M:C L:1/4 %%playswing 66 0 34 K:Gm "Gm6"d/d/c/B/"E7b"AG|"A7b9"=EG/^F/-"D7b9"F2| ``` -------------------------------- ### Set up page dimensions and margins Source: http://moinejf.free.fr/abcm2ps-doc/clip.html Configure page layout settings like width and margins. These settings affect the overall presentation of the generated music. ```abc %%musicfont url(../js/abc2svg.ttf) %%pagewidth 10cm %%rightmargin 0.8cm %%leftmargin 0.8cm %%topspace 0 ``` -------------------------------- ### Conditional Generation with ss-pref Source: http://moinejf.free.fr/abcm2ps-doc/ss-pref.html This example shows how to use the --ss-pref command-line option with abcm2ps to generate output for a specific voice (Alto only) by changing the StyleSheet prefix to '%A'. ```abc - tune.abc: X:1 ... K:C % % default 4 staves %Fstaves [(S A) (T B)] % 2 staves %Sstaves S % Soprano only %Astaves A % Alto only V:S ... V:A ... V:T ... V:B ... ``` ```bash abcm2ps --ss-pref %A tune.abc # generate alto only ``` -------------------------------- ### Alda Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/tabac2.html Example of a musical piece in Alda notation format. Alda requires specific tempo and bar formatting. ```alda M:2/4 % needed for automatic bars %%alda 1 (tempo! 120) sq = c8dec|d4d8e|f4f|ee|c8dec|d4d8e|f4g|c2| o4 [sq]*2 g4g8f|e4d8e|f4g|fe|g4g8f|e4d8e|f4g|d2| sq %%alda 0 ``` -------------------------------- ### Single Line Rendering with Max Shrink Source: http://moinejf.free.fr/abcm2ps-doc/singleline.html This example shows single-line rendering combined with the %%maxshrink parameter to control the minimum shrinkage factor. The page width is adjusted to fit the tune on one line. ```abc X:3 M:C L:1/4 %%maxshrink 0.8 K:C C/C/C/C/ D/D/D/D/|E/E/E/E/ F/F/F/F/|G4| C/C/C/C/ D/D/D/D/|E/E/E/E/ F/F/F/F/|G4| ``` -------------------------------- ### Set maxshrink to 0.65 Source: http://moinejf.free.fr/abcm2ps-doc/maxshrink.html Demonstrates setting the maxshrink parameter to 0.65 for automatic music line compression. This value allows for moderate shrinking. ```abc X:1 T:maxshrink 0.65 M:C L:1/4 K:C cccc | cccc | cccc | cccc | cccc | cccc | ``` -------------------------------- ### Set maxshrink to 0.9 Source: http://moinejf.free.fr/abcm2ps-doc/maxshrink.html Illustrates setting the maxshrink parameter to 0.9, resulting in significant horizontal compression of music lines. This is useful for fitting more content on a line. ```abc X:2 T:maxshrink 0.9 %%pagewidth 9cm M:C L:1/4 K:C %%maxshrink 0.9 cccc | cccc | cccc | cccc | cccc | cccc | ``` -------------------------------- ### Dump Remaining Source with show_source Source: http://moinejf.free.fr/abcm2ps-doc/show_source.html Use `%%show_source *` to dump the remaining music source after the last `%%show_source` command. This is useful for including the end of the source file. ```abc %%show_source *
``` -------------------------------- ### Basic ABC Music Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/straightflags.html A simple ABC notation example demonstrating a melody line in the key of Highland Pipe (HP). ```abc X:1 M:2/4 L:1/4 K:HP G/ c/ e/ g/| ``` -------------------------------- ### Standard ABC Music Notation Example Source: http://moinejf.free.fr/abcm2ps-doc/grid2.html A standard ABC notation example for the song 'Lullaby of Birdland'. This serves as a baseline for comparison with grid notation. ```abc X:1 T:Lullaby of birdland C:George Shearing (1919 - 2011) M:C L:1/4 K:Gm "Gm6"d/d/c/B/"E7b"AG|"A7b9"=EG/^F/-"D7b9"F2| "Gm6"DA/G/-"E7b"G2|"Cm7"Ed/c/-"F9"c2| "Bb7"f/f/e/d/"Gm7"cB|"Cm7"G/d/c/^F/- "F7b9"F/d/c/=F/-| "Bb7"F2z/c/B/E/-|"Eb9"E/B/A/D/-"D7"D2| w:Lu-lla-by of bird-land that's what I_ al-ways hear* when you sigh;_ +:Ne-ver in my word land could there be ways* to re-veal_ in a phrase* how I feel._ ``` -------------------------------- ### Handle Tenuto Decoration with abc2pscompat Source: http://moinejf.free.fr/abcm2ps-doc/abc2pscompat.xhtml This example shows how to use abc2pscompat to interpret 'M' as a tenuto decoration and adjust octave for bass clef. This is useful for rendering older tunes that relied on this behavior. ```abc X:2 M:C L:1/4 U: M = !tenuto! K:C bass octave=-2 Mabc'd' | ``` -------------------------------- ### abc2svg Text Block Example Source: http://moinejf.free.fr/abcm2ps-doc/lineskipfac.html An example demonstrating the use of %%begintext and %%endtext directives to include multi-line text within an abc2svg score. This shows the default line spacing. ```abc X:1 M:C L:1/4 K:G %%begintext First line. Second line. %%endtext ``` -------------------------------- ### Demonstrate %%repbra directive behavior Source: http://moinejf.free.fr/abcm2ps-doc/repbra.html Shows the default behavior of repeat brackets and how to disable them using %%repbra 0 in a specific voice. ```abc X:1 T:no % staves M:C L:1/4 K:C V:1 "Default"cccc |1 cccc :|2 c4 || V:2 cccc |1 cccc :|2 c4 || V:1 "%%repbra 0 in V:2"cccc |1 cccc :|2 c4 || V:2 %%repbra 0 cccc |1 cccc :|2 c4 || ``` -------------------------------- ### SVG Setup for Slash Notes Source: http://moinejf.free.fr/abcm2ps-doc/slash.html Defines SVG styles and glyphs for custom note heads using the Bravura font. This setup is required before using slash notes with custom mappings. ```svg %%show_source * % get the note heads from the font Bravura %%beginsvg%%endsvg %%page-format 1 ``` -------------------------------- ### ABC Notation Example with Title Source: http://moinejf.free.fr/abcm2ps-doc/titletrim.html A simple ABC notation example demonstrating a title with a trailing comma and space, 'clair de la lune, Au'. This format is relevant for testing the titletrim functionality. ```abc X:1 T:clair de la lune, Au M:C L:1/4 K:C cccd | e2d2 | cedd | c4 | ``` -------------------------------- ### Using %%capo and %%capofont in ABC Notation Source: http://moinejf.free.fr/abcm2ps-doc/capo.html This example demonstrates how to use the %%capo directive to set the capo position and %%capofont to specify the font for chord symbols. The argument for %%capo is the fret number. ```abc X:1 T:Amazing grace M:3/4 L:1/4 %%capo 1 %%capofont Bookman-LightItalic 14 K:F C/F/|"F"F2(3A/>G/F/|A2A/G/|"Bb"F2D|"F"C2 C/F/|"F"F2(3A/>G/F/|A2G/A/|"C"c3|x2 ``` -------------------------------- ### Example Usage of Chord Aliases in ABC Notation Source: http://moinejf.free.fr/abcm2ps-doc/chordalias.html This example demonstrates how defined chord aliases like 'CMaj' and 'AMin' are rendered in ABC notation. Ensure the `%%musicfont` directive is present for proper rendering. ```abc X:1 T:example %%diagram 1 M:4/4 L:1/4 K:C "CMaj"CEGc-|"AMin"cBAG|"DMin"A2"G"B2|"CMaj"c4|] ``` -------------------------------- ### Embed Free Text Within Music Source: http://moinejf.free.fr/abcm2ps-doc/begintext.html Illustrates embedding free text directly within the music notation section. Empty lines within this block start new paragraphs, and lines starting with '%%' are treated specially. ```abc %%begintext %%Text inside the music. %% The previous line is empty. %%endtext ``` -------------------------------- ### Jianpu Notation Example: Hàn Tiān Léi Source: http://moinejf.free.fr/abcm2ps-doc/jianpu.html An example of the song 'Hàn Tiān Léi' (旱天雷) written in ABC notation with Jianpu output enabled. This snippet demonstrates complex melodic lines and rhythmic variations within the Jianpu system. It includes MIDI program settings for playback. ```abc X:2 T:Hàn Tiān Léi T:旱天雷 %%jianpu 1 M:2/4 L:1/4 Q:1/4=120 %%MIDI program 110 % Fiddle K:C shift=CG z2S|!f!G,G|G,/z/ A//G//E//G//|DG,|D/z/z|!mp!G>A| B,/>D/ B,/A,/|G,G,/>A,/|!mf!G,/GA/|B,/>d/ B//d//B//A//| G/c/ E/G/|AA/>B/| !f!A/AG/|CC/>A,/|C/D/ A//G//E//G//|D/z/D/z/|D/z/z|z/C/ z/C/| z/C/ z/C/|z/D/ D/>E/|D/DE/|!f!G c/A/|G/>A/ G/E/O| D/z/z|z/z| A,/>C/ D//G//E//D//|B,/>D/ A,/C/|!>(!G,2-!>)!| G,z/PA/|G/>A/ c/>B/|A//c//A//G// F/E/| G>PA|G/>A/ c/B/|A/z//c// A//c//A//G//| E//D//E//G// A//G//A//c//|G>PA|!>(!G/G!>)!c/| A/z/z|zz|zz|zz/E//G//|!mf!D/>E/ C/>A,/|D/>E/ A//c//A//G//| E2-|EG/>E/|D/>E/ D//E//D//B,//|A,/E/ G,/A,/| C/A,/!<(!C-|!<)!C!>(!G//D//E//!>)!B,//| !mp!A,/G,G/|E/z//F// E//F//E//D//|C>G|G,//G//G//G// G,//G//G//G//| !mf!A,/>C/ D//G//E//D//|B,/>D/ A,//G,//A,//C//|G,2-| G,A//G//E//G//O!D.S.!||!<(!D//G//G//G// E//G//G//G//| !<)!A,//G//G//G// G,//G//G//G//H| A/>c/ d/e/|B/d/ A/Hc/|HG2 & !<(!x!<)!!>(!x!>)!|] ``` ```abc X:3 T:Hàn Tiān Léi T:旱天雷 M:2/4 L:1/4 Q:1/4=120 %%MIDI program 110 % Fiddle K:C shift=CG z2S|!f!G,G|G,/z/ A//G//E//G//|DG,|D/z/z|!mp!G>A| B,/>D/ B,/A,/|G,G,/>A,/|!mf!G,/GA/|B,/>d/ B//d//B//A//| G/c/ E/G/|AA/>B/| !f!A/AG/|CC/>A,/|C/D/ A//G//E//G//|D/z/D/z/|D/z/z|z/C/ z/C/| z/C/ z/C/|z/D/ D/>E/|D/DE/|!f!G c/A/|G/>A/ G/E/O| D/z/z|z/z| A,/>C/ D//G//E//D//|B,/>D/ A,/C/|!>(!G,2-!>)!| G,z/PA/|G/>A/ c/>B/|A//c//A//G// F/E/| G>PA|G/>A/ c/B/|A/z//c// A//c//A//G//| E//D//E//G// A//G//A//c//|G>PA|!>(!G/G!>)!c/| A/z/z|zz|zz|zz/E//G//|!mf!D/>E/ C/>A,/|D/>E/ A//c//A//G//| E2-|EG/>E/|D/>E/ D//E//D//B,//|A,/E/ G,/A,/| C/A,/!<(!C-|!<)!C!>(!G//D//E//!>)!B,//| !mp!A,/G,G/|E/z//F// E//F//E//D//|C>G|G,//G//G//G// G,//G//G//G//| !mf!A,/>C/ D//G//E//D//|B,/>D/ A,//G,//A,//C//|G,2-| G,A//G//E//G//O!D.S.!||!<(!D//G//G//G// E//G//G//G//| !<)!A,//G//G//G// G,//G//G//G//H| A/>c/ d/e/|B/d/ A/Hc/|HG2 & !<(!x!<)!!>(!x!>)!|] ``` -------------------------------- ### Build Font JavaScript File Source: http://moinejf.free.fr/abcm2ps-doc/tm-readme.html Build the font.js file if you need to change or add music glyphs. This requires base64 and fontforge. ```bash samu -v font.js ``` -------------------------------- ### Define and Display Information Fields Source: http://moinejf.free.fr/abcm2ps-doc/infoname.html Use %%infoname to specify which information fields to display and their labels. Ensure the field is also enabled in %%writefields. ```abc %%infoname G "Group: " % display the group %%infoname N % notes at the end %%infoname N "Notes: " %%writefields GN 1 ``` -------------------------------- ### Set General Parameters with %%chordkit Source: http://moinejf.free.fr/abcm2ps-doc/chord.html Configure general accompaniment parameters like instrument ('instr' or 'prog') and volume ('vol'). The 'oct' parameter can raise or lower the chord by one octave. ```abc %%chordkit instr="guit nyl" vol=40 % (acoustic guitar nylon) ``` -------------------------------- ### Sample ABC music notation Source: http://moinejf.free.fr/abcm2ps-doc/breaklimit.html A basic ABC notation example for a musical piece in C major. ```abc X:1 M:3/4 L:1/4 K:C c/c/cc | ccc | c/c/cc | c/c/cc | c3 | ``` -------------------------------- ### Apply options to a specific tune using %%tune Source: http://moinejf.free.fr/abcm2ps-doc/tune.xhtml Use %%tune with a regular expression to target specific tunes. Options are applied until %%tune end. This example targets tunes matching 'Bach' and modifies margins, scale, and staves. ```abc %%tune Bach %%leftmargin 1cm lock %%rightmargin 1cm lock %%scale 0.7 %%staves {(1 2) (3 4)} %%staves {(1 2) (3 4)} %%staves {(1 2) (3 4)} %%tune end %%abc-include sample5.abc ``` -------------------------------- ### Basic ABC Music Notation Source: http://moinejf.free.fr/abcm2ps-doc/composerspace.html A standard ABC notation example for a tune, including title, composer, meter, and key. ```abc X:1 T:tune title C:this is the composer M:C L:1/4 K:C cccc | cccc | ``` -------------------------------- ### Set French Chordnames and Null Chord Source: http://moinejf.free.fr/abcm2ps-doc/chordnames.html Configures French chord names and defines a replacement string '0___' for null chords using the %%chordnames directive. This example also demonstrates a 3/4 time signature. ```abc X:3 M:3/4 L:1/4 %%chordnames Do,Ré,Mi,Fa,Sol,La,Si,0___ % French K:F "N.C."C | "F"F2A | "C"G2A | "F"F2 |] ``` -------------------------------- ### Disable autoclef Source: http://moinejf.free.fr/abcm2ps-doc/autoclef.xhtml When %%autoclef 0 is used, clefs are initialized to treble clefs. This example shows a sequence with disabled autoclef. ```abc X:1 M:C L:1/4 %%autoclef 0 K:C cGEC | E,G,Cc | ``` -------------------------------- ### Embed Music Source with show_source Source: http://moinejf.free.fr/abcm2ps-doc/show_source.html Use `%%show_source` to embed the music source as HTML ` ` elements. The 'b' option places the source before the music, and 'a' places it after. Both music and source elements are styled with `display:inline-block`. ```abc %%show_source bX:1 T:First tune M:4/4 L:1/4 K:C CDEF|GABc| ``` ```abc %%show_source aX:1 T:First tune M:4/4 L:1/4 K:C CDEF|GABc| ``` -------------------------------- ### Dynalign -1, 0, and 1 in Multi-Staff Source: http://moinejf.free.fr/abcm2ps-doc/dynalign.html Illustrates the behavior of dynalign settings -1, 0, and 1 across multiple staves, showing how dynamic marks are positioned relative to different voices. ```abc X:2 %%sysstaffsep 80 L:1/4 %%pos dyn below K:C V:1 "^dynalign 1" !f!G,CEG | !>(!Bdg!>)!G | !p!c4 | V:2 C,4 | G,4 | C4 | %%dynalign 0 V:1 "^dynalign 0" !f!G,CEG | !>(!Bdg!>)!G | !p!c4 | V:2 C,4 | G,4 | C4 | %%dynalign -1 V:1 "^dynalign -1" !f!G,CEG | !>(!Bdg!>)!G | !p!c4 | V:2 C,4 | G,4 | C4 | ``` -------------------------------- ### Demonstrate Topspace with Different Values Source: http://moinejf.free.fr/abcm2ps-doc/topspace.html Illustrates the effect of the %%topspace directive with positive, zero, and negative values in abc2svg. Note that negative values may not render as expected in abc2svg. ```abc X:1 T:1 M:C L:1/4 K:C cccc | cccc | ``` ```abc X:2 T:2 M:C L:1/4 K:C cccc | cccc | ``` ```abc X:3 T:3 %%topspace 2cm M:C L:1/4 K:C cccc | cccc | ``` ```abc X:4 T:4 %%topspace -1cm M:C L:1/4 K:C cccc | cccc | ``` -------------------------------- ### Build txtmus Files with Shell Script Source: http://moinejf.free.fr/abcm2ps-doc/tm-readme.html If ninja or samurai are not available, build txtmus files using the provided shell script. This script must be run in a Posix-compatible shell. ```bash ./build ```