Singtuna Karaoke

TunaPack library format

Singtuna doesn't come with songs. You add libraries: links to songs hosted anywhere. Here's how to host one.

There are two ways. A TunaPack library is a few JSON files plus MIDI songs, with song numbers, artists and optional offline packs. A plain folder of .mid or .kar files on any web server works too, with titles taken from the file names.

A TunaPack library

Pick a base address, for example https://example.com/songs. Serve these under it:

PathWhat it is
/info.jsonWhat the library is. Singtuna checks this first.
/library.jsonThe song list.
/song/<number>One song as a standard MIDI file (.mid or .kar data).
/packs/…Optional: compressed packs for offline use.

info.json

{
  "format": "tunapack",
  "version": 1,
  "name": "Ana's songbook",   // shown in the app
  "songs": 1250,              // how many songs
  "packs": false              // true if /packs/packs.json exists
}

format is always "tunapack" and version is 1. Other fields are ignored.

library.json

{
  "singers": ["Gloria Estefan", "Drake"],
  "songs": [
    [38063, "1 2 3", 0],
    [6751, "0 to 100 the Catch Up", 1]
  ]
}

Each song is [number, title, singer], where singer is a position in singers. Song numbers are whole numbers from 1 to 99999 and must be unique; they're what people punch in on the keypad.

/song/<number>

The song's MIDI file. Lyrics come from the file's lyric (or text) events. If they aren't Western (Windows-1252) text, say which encoding they are in an X-Text-Encoding response header, for example X-Text-Encoding: utf-8.

Offline packs (optional)

With packs, people can download the whole library to sing without internet. Packs use TunaPack compression, a lossless format made for karaoke MIDI. Without packs, every song people sing is still kept on their device, so offline packs are optional.

Logins

A library can be open, or need one of these. Singtuna sends it with every request:

Answer 401 when it's missing or wrong. Give each person their own token or login so you can take one away without affecting the others.

Let Singtuna read it

Browsers only let a site read another site when that site says so. Your library must send these headers, and answer OPTIONS requests with them:

Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Authorization
Access-Control-Expose-Headers: X-Text-Encoding

Use https. Browsers block http libraries from an https page, and logins sent over http aren't private.

A plain folder

Any web server with a directory listing (Apache, nginx autoindex, a static host's file browser) works: Singtuna reads the page and adds every link that ends in .mid, .midi or .kar. Name files like this:

00001 Trust in Me - Francesca Beghe.mid
Listen to Me - Buddy Holly.kar

That's an optional song number, the title, then - and the artist. When every file has a unique number, those become the song numbers; otherwise songs are numbered in listing order. The folder needs the same Access-Control-* headers, and can use the same logins.

Sharing it

People add a library in Settings → Libraries → Add a library by pasting its address. Put the login after a # so one link carries everything. Browsers never send that part to servers, so it stays out of logs:

https://example.com/songs#token=TOKEN
https://example.com/songs#user=ana&pass=PASSWORD

To open Singtuna and offer to add the library in one tap, link to:

https://<singtuna address>/add?lib=https%3A%2F%2Fexample.com%2Fsongs&token=TOKEN

Here the login goes in the query, not after a #: chat apps like Messenger drop anything after a # when they open a link. Singtuna takes it out of the address bar as soon as the page opens. A #token=… works too, for links that won't pass through a chat app.

Songs on your own device

No server needed: Add a library → Files on this device imports .mid, .midi or .kar files, or a .zip of them. They stay on that device and work offline.