• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ChordPro & ABC
#46
You definitely do not want grid sections inside of abc sections. Those are entirely separate things. Separate that out and put the grid after or before the abc section, depending on what you want. In your example, the ABC section has no content other than the grid, so I would recommend removing all the ABC stuff and just having the grid part, meaning:

Code:
{title: Too Sweet} {artist:Hozier} {composer:Hozier} {album:Unheard} {key:Gm} {copyright:2024} {start_of_grid} |Gm...|Gm..F/A|A#...|A#.CmD#| {end_of_grid} {start_of_part:Intro} | Gm | Gm F/A | A# | A# Cm D#/D | | D# | D# | F  | D7 | {end_of_part}

If you want text above the grid, you can add a label like {start_of_grid label="My Label"}, or just add the text on the line above the grid. You can use pango markup syntax to change the appearance of that text if desired.

Mike
Reply
#47
Hello Eddie, 
You're confusing ChordPro and ABC. Grids are a ChordPro extension, ABC is a simple format for standard notation. 
I really recommend to read about extended ChordPro syntax at https://www.chordpro.org/beta/chordpro-directives/

What you want to write would probably look like this:
(note the blanks that I inserted into the grid section, they are mandatory for counting the beats)

Code:
{title: Too Sweet} {artist:Hozier} {composer:Hozier} {album:Unheard} {key:Gm} {copyright:2024} {start_of_grid} | Gm . . . | Gm . . F/A | A# . . . | A# . Cm D# | {end_of_grid} {start_of_part:Intro} | Gm | Gm F/A | A# | A# Cm D#/D | | D# | D# | F  | D7 | {end_of_part}


This is a typical header for an ABC tune:

X:1
T:Too Sweet
M:4/4
K:Gm 

{start_of_abc} / {end_of_abc} are the ChordPro directives to embed ABC code into ChordPro
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#48
To add to possible confusion: There is a grid function in ABC, too (or rather in abc2svg). It's used with %% grid or %%grid2 within the ABC source and generates also a grid but from the ABC source. Just so you know.
Reply
#49
(03-13-2026, 05:35 AM)BRX Wrote: To add to possible confusion: There is a grid function in ABC, too (or rather in abc2svg). It's used with %% grid or %%grid2 within the ABC source and generates also a grid but from the ABC source. Just so you know.

Yes, that's what was confusing me: the similar functionality inside of abcnotation, inside of ChordPro, inside of Mobile Sheets. I will try the suggestions above.
Reply
#50
Ok, thanks to @itsme, I've finally gotten grip on it. The blank spaces they are using were critical to eliminating the formatting problems I kept seeing. I need to study this and understand the syntax of the blank spaces. I had already tried spaces and periods, and nothing seemed to present well, on top of my confusion on where to use the {start_of_grid}/{end_of_grid} directives. I've been looking through the Mobile Sheets manual, ChordPro directives, and internet searches, and was unable to find something as useful as their comment. Gratitude!


Code:
{title: Grid Test} {artist:Hernandez} {composer:Hernandez} {album:Unheard} {key:Gm} {copyright:2026} {comment: from me} {start_of_grid} |Gm...|Gm..F/A|A#...|A#.CmD#| {end_of_grid} {comment: from Mobile Sheets forum} {start_of_grid} | Gm . . . | Gm . . F/A | A# . . . | A# . Cm D# | |Gm|GmF/A |A#|A#CmD#| {end_of_grid} {start_of_part:Intro} | Gm | Gm F/A | A# | A# Cm D#/D | | D# | D# | F  | D7 | {end_of_part}
Reply
#51
The official explanation of ChordPro grids is here: https://www.chordpro.org/chordpro/directives-env_grid/
A first step to understand what's going: the grid divides the width of the page into a number of cells with equal width.
Basic syntax is 
Code:
{start_of_grid left + measures x beats + right}

good to know: {start_of_grid} without any parameters as in your example defaults to {start_of_grid 1 + 4 x 4 + 1}

I like to use the left margin to note the form (e.g. Intro A A B A Outro) of a tune.
So your example might be extended to 
Code:
{title: Too Sweet} {artist:Hozier} {composer:Hozier} {album:Unheard} {key:Gm} {copyright:2024} {start_of_grid 3 + 4 x 4 + 1} Intro | Gm . . . | Gm . . F/A | A# . . . | A# . Cm D# |       | D# . . . | D# . . . | F . . . | D7 . . . | {end_of_grid}
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#52
Thank you. Yes, I had started with that documentation page, but unfortunately:
  1. my initial attempt had buried this example inside of {start_of_abc}/{end_of_abc}. I didn't learn that was a mistake right away
  2. I had overlooked the key information "The grid input lines consist of space-separated tokens, which are either valid chords or special symbols...."
  3. By the time I had realized I needed to move it outside of  {start_of_abc}/{end_of_abc} and into {start_of_grid}/{end_of_grid }, I had lost the rabbit

After tweaking my code character by character, slowly walking it to your code, I realized how important space-separated is!

Thank you very much for your help, as I don't think I would have been able to crawl out of the hole I had dug myself into.

Eddie H
Reply




Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2026 MyBB Group.