Skip to main content

QRPLAY

QRPLAY V3


A music box that fits in a QR code. Source on Codeberg.

scanning a code

making music

notes and commands

samples

$𝑥...* saves a sample in slot 𝑥. For instance, $0RSDDI+D-A* would save the Megalovania riff into slot 0. you then play the sample like a note, with 0.

the characters 012456789YZ and space are QR-friendly and are reserved for storing samples. If you run out, you can also use [\]^_`{|}~, newline, lowercase letters, or any UTF16 code unit. note that 3 is missing as it is already used for triplets.

special case: if a sample ends with the letter V, it will play asynchronously with the main track. for instance, you could play a chord like this: $0CV*0 G. This would play the C from the sample and the G from the main track at the same time.

samples keep separate octave and note length from the main track, but setting volume or tempo within a sample will change it globally when played.

samples can save and play samples, including themselves. if a sample plays itself it will loop. to prevent browser crashes, recursion and loops are capped at 100 iterations, and the limit decreases each time it is reached. if a sample saves into its own slot, you won't be able to play it again.

if a sample uses an incompatible character, then it cannot be played. you can use this to write comments, like $:TITLE: MY COOL SONG*. you can nest samples/other comments in your comment, but you can't use $ * as ordinary text. you can also write lowercase letters as comments if no samples are written for them, such as at the top, before your song.

making a QR code

Your code will compress the best if it only uses the QR Alphanumeric subset. This means 0-9A-Z $%*+-./:. There are no newlines or lowercase letters.

Zint allows you to mix data of different types, so you don't have to write your entire song this way, but it will save space if you do.

on a linux machine, with qrencode installed, you can use make SONG=<filepath> to do this automatically, or use make SONG= to make a QR code with no song.

conversion

QRPLAY is based on ZZM, which itself based on the ZZT Music Format. To convert from ZZT Ultra or ZZM to QRPLAY:

to choose a slot for immediately played async samples:

There is no equivalent of some ZZT ultra commands. You should remove them to avoid confusion.

thanks