• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(ChordPro) Scrolling to sections
#1
In ChordPro, song parts may be identified as sections, e.g.

Code:
{start_of_verse Verse1}
...lyrics and chords
{end_of_verse}
{start_of_chorus Chorus}
...chorus...
{end_of_chorus}

Would it be possible (i.e. implementable with not too much effort) to use these sections as jump locations?
What I have in mind is a kind of scroll function that, when pressing the pedal, moves the next section to the top of the page.

As usual, an image tells more than 1000 words.

   

Rationale is that I think it is easier to keep track of where you are on the page, especially if someone else is pressing the pedal for you.

Foreseeable complications:
  • Only applies to ChordPro files that have sections.
  • Selectable per song?
  • Scroll to the next section only if this section is already (partly) visible.

What do you think?
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Reply
#2
Just at a high level, yes, I think it should be possible to make that work. I currently store position information for every single word/chord on the screen, so I should already have the position information for the sections (although I may need to add some additional code to store the section headers separately so that I can easily reference them). When using the vertical scrolling display mode, I already have a method that I can invoke to scroll the page to a certain pixel position. So I would just need to invoke that method with the position of the next section header along with a little bit of a margin so that the word isn't aligned with the very top of the screen. I would also have to add some code to figure out, based on the current scroll position and page number, what the next section header is, which actually would probably be the most amount of work. The other thing I'd have to handle is how to process things when using other display modes (single page, two page, half page), as I should probably still turn pages even if scrolling isn't possible. With the single page display mode, scrolling may be possible if the user has zoomed in or is using the half page display mode. So I'd just have to make sure to support this feature in all modes in whatever way makes sense.

Mike
Reply
#3
Sounds interesting.

In addition (or instead) we could add a special directive to designate a jump location, e.g.

Code:
{mark}
{mark: label}

'Official' defintion: Marks a location in the song. It is up to the viewing and rendering programs to do something sensible with this information.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Reply




Users browsing this thread:
1 Guest(s)


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