Jump to content

Adding a QR code

From LilyPond wiki

Starting with LilyPond 2.25.3, you can use the \qr-code markup command to insert a QR code, for example to provide a link to the composer's or the music editor's website.

\version "2.25.3"

\markup \qr-code #10 "https://lilypond.org"

For older versions, you can use the following code.

LilyPond rendering error

No release of LilyPond 2.24 found.

This code does not actually encode the URL into the QR code; you will have to provide a grid of "black" and "white" values instead of a URL. The following short Python snippet can be used to convert a URL to a grid:

>>> import pyqrcode; print(pyqrcode.create("https://lilypond.org").text(quiet_zone=0))

This requires the pyqrcode module.