Include song chords when downloading a song in OpenLyrics format
Is your feature request related to a problem? Please describe.
Currently, the feature for downloading a song in OpenLyrics format ignores all chords and only includes the song's lyrics. However, OpenLP has the ability to read chords in ChordPro format inside OpenLyrics files and display them in the "chord view" so musicians can see them live on their own devices.
Describe the solution you'd like
It would be great if SongDrive included chords when downloading songs in OpenLyrics format.
Additional context
Here is an example of a song stored in OpenLP with chords in Chordpro format:
---[Verse:1]---
Ala[A/E]be[E]mos [B/E]al Se[A]ñor
Con un [D/E]cántico [A/E]nuevo [E]
Procla[A/E]me[E]mos [B/E]a una [E]voz
Que [D/E]suya es la [A/E]salva[E]ción
---[Coro:1]---
Porque [A]Él es el más [E/G#]grande, [C#m]digno de ala[B]bar
[A]No hay ninguno [E/G#]co[A]mo Él[B]
[C#m]Él [G#m]es [A]fuerte y glo[E/G#]rioso, [B]y goberna[C#m]rá
[B]Con jus[A]ticia y [B]con ver[E]dad
And this is the content of a OpenLyrics file exported from OpenLP:
<?xml version='1.0' encoding='UTF-8'?>
<song xmlns="http://openlyrics.info/namespace/2009/song" version="0.8" createdIn="OpenLP 3.1.7" modifiedIn="OpenLP 3.1.7" modifiedDate="2025-06-21T22:36:17">
<properties>
<titles>
<title>Alabemos al Señor</title>
</titles>
<verseOrder>v1 c1</verseOrder>
<authors>
<author>No definido</author>
</authors>
</properties>
<lyrics>
<verse name="v1">
<lines>Ala<chord name="A/E"/>be<chord name="E"/>mos <chord name="B/E"/>al Se<chord name="A"/>ñor<br/>Con un <chord name="D/E"/>cántico <chord name="A/E"/>nuevo <chord name="E"/><br/>Procla<chord name="A/E"/>me<chord name="E"/>mos <chord name="B/E"/>a una <chord name="E"/>voz<br/>Que <chord name="D/E"/>suya es la <chord name="A/E"/>salva<chord name="E"/>ción</lines>
</verse>
<verse name="c1">
<lines>Porque <chord name="A"/>Él es el más <chord name="E/G#"/>grande, <chord name="C#m"/>digno de ala<chord name="B"/>bar<br/><chord name="A"/>No hay ninguno <chord name="E/G#"/>co<chord name="A"/>mo Él<chord name="B"/><br/><chord name="C#m"/>Él <chord name="G#m"/>es <chord name="A"/>fuerte y glo<chord name="E/G#"/>rioso, <chord name="B"/>y goberna<chord name="C#m"/>rá<br/><chord name="B"/>Con jus<chord name="A"/>ticia y <chord name="B"/>con ver<chord name="E"/>dad</lines>
</verse>
</lyrics>
</song>
Thanks for this request, I agree this would be a nice addition! This would take some time though, I'm open for PRs if you're up for that.
I don't have previous experience with Vue.js or JavaScript, as my specialty is Python. However, I can look into the solution if you guide me on which sections of the code are key to this functionality. I would appreciate your guidance.
Hi Christian! Sorry for coming back to this only now - I'm currently pretty busy with things 😅 So if you're still interested in creating a PR for this, here are some pointers:
- You can find the current OpenLyrics XML generation in this function: https://github.com/devmount/SongDrive/blob/69adfca87c73e60baa45885f2a12026605cda121/frontend/src/utils.js#L336
- You'd need to set the
showChordsparameter of theparseContentfunction to true to get the chord lines: https://github.com/devmount/SongDrive/blob/69adfca87c73e60baa45885f2a12026605cda121/frontend/src/utils.js#L357 - And then you'd need a check, if the current line is a chord line (you can use the existing
isChordLinefunction) and if yes, merge it with the following line (if that is not empty) according to the OpenLyrics format
I hope this helps for the first steps. Let me know if you need further guidance.