User:MihaiEso/Esoteric formats/Simple Playlist (SPL)

From Esolang
Jump to navigation Jump to search

SPL (.spl), also known as Simple PlayList, is a file format made by Mihai Popa. It's a simple playlist format, like M3U or PLS. I don't hate writing XML or JSON, but I don't need complex, b**ls**t syntax.

Syntax

All SPL files must start with this:

{SPL File}

Comments are allowed, start with a hashtag (#) or double slash (//) then the text. Multi-line ones are also allowed (in C/C++/others syntax). Nesting IS ALSO allowed!

# Comment text (Python/Ruby/TCL/Makefile/others syntax)
// C/C++/C#/others comment syntax
/*
Multi-line
ones are
allowed!
*/
/* Hello! /* Nesting is /* also allowed! */ */ */
{Metadata} # Single-line comment after required part
[1]=example.mp3 /* Multi-line comment
after line!
Hello, world! */

After that, the next part comes (you can put this before the playlist contents or after. The examples and the Mp3tag export template currently exports with metadata part first):

{Metadata}

You can add a title, a generator and of course the number of entries, in this syntax:

[Title]=Simple Playlist
[Generator]=Example
[NumberOfEntries]=3

After that, the next part comes (you can put this before the playlist contents or after. The examples and the Mp3tag export template currently exports with body part after):

{Playlist Body}

That part, is the playlist body. The part is responsible for holding the paths to audio files.

Then, a line like this comes, contains order and audio file path (you can as many lines like this):

[1]=example.mp3

Examples

First example

{SPL File}
{Playlist Body}
[1]=example.mp3
[2]=vocal.wav
[3]=speech.spx

Commented

{SPL File} # This the magic number, must be the first line.
{Playlist Body} # Then the playlist body comes.
/* This is the playlist body.
It will hold paths to audio files. */
[1]=example.mp3 # First file, a MP3 file.
[2]=vocal.wav # Second file, a WAV file.
[3]=speech.spx # Third file, a Speex file.
# End of file!

Second example, with usage of metadata

{SPL File}
{Metadata}
[Title]=A example with metadata
[NumberOfEntries]=5
{Playlist Body}
[1]=example.mp3
[2]=vocal.wav
[3]=speech.spx
[4]=truespeech.wav
[5]=acapella.ogg

Commented

{SPL File} # This the magic number, must be the first line.
{Metadata} # Then the metadata part comes.
/* This is the metadata part.
It will hold simple metadata like:
title, generator and number of entries. */
[Title]=A example with metadata # The playlist title.
[NumberOfEntries]=5 # Number of entries.
{Playlist Body} # Then the playlist body comes.
/* This is the playlist body.
It will hold paths to audio files. */
[1]=example.mp3 # First file, a MP3 file.
[2]=vocal.wav # Second file, a WAV file.
[3]=speech.spx # Third file, a Speex file.
[4]=truespeech.wav # Fourth file, like the third file.
[5]=acapella.ogg # Fifth file, another vocal-only file but in Ogg Vorbis.
# End of file!

Third example, very short

{SPL File}
{Playlist Body}
[1]=file.mp3

Commented

{SPL File} # This the magic number, must be the first line.
{Metadata} # Then the metadata part comes.
/* This is the playlist body.
It will hold paths to audio files. */
[1]=example.mp3 # Just a file only!
# End of file!

Fourth example, generated by Mp3tag

{SPL File}
{Metadata}
[Title]=My Playlist, exported by Mp3tag v3.26
[Generator]=Mp3tag v3.26
[NumberOfEntries]=2
{Playlist Body}
[1]=Instrumental.mp3
[2]=Vocal.mp3

Commented

{SPL File}
# Generated by Mp3tag v3.26
{Metadata}
[Title]=My Playlist, exported by Mp3tag v3.26
[Generator]=Mp3tag v3.26
[NumberOfEntries]=2
{Playlist Body}
[1]=Instrumental.mp3
[2]=Vocal.mp3
# End of file!

Mp3tag Export Templates

With comments

$filename(spl,utf-8){SPL File}
# Generated by %_app%
{Metadata}
'['Title']'=My Playlist, exported by %_app%
'['Generator']'=%_app%
'['NumberOfEntries']'=%_max_counter%
{Playlist Body}
$loop(%_filename_ext%)'['%_counter%']'=%_filename_ext%
$loopend()# End of file!

Without comments

$filename(spl,utf-8){SPL File}
{Metadata}
'['Title']'=My Playlist, exported by %_app%
'['Generator']'=%_app%
'['NumberOfEntries']'=%_max_counter%
{Playlist Body}
$loop(%_filename_ext%)'['%_counter%']'=%_filename_ext%
$loopend()

Also avabile on this page!