Versions and remixes
A version is anything that says which take of a song this is: a remix, a VIP, a radio edit, a live
recording, a remaster, a sped-up TikTok cut. trackparse reads them from brackets and from dash
suffixes, and puts each one in versions, left to right
(R9.3). The fields are listed under
Version in the reference.
{ type: VersionType; // 'remix', 'vip', 'radio', … raw: string; // the text as written, without brackets: 'Sub Focus VIP Remix' artists: Artist[]; // remixers, role 'remixer' modifiers: VersionType[]; // other type words that didn't win: [ 'extended' ] descriptor: string | null; // leftover words: "Taylor's", 'at Wembley' year: number | null; unknownArtist: boolean; // 'ID Remix' delimiter: "(" | "[" | "{" | "-";}Version( type: VersionType, # 'remix', 'vip', 'radio', … raw: str, # the text as written, without brackets: 'Sub Focus VIP Remix' artists: tuple[Artist, ...], # remixers, role 'remixer' modifiers: tuple[str, ...], # other type words that didn't win: ('extended',) descriptor: Optional[str], # leftover words: "Taylor's", 'at Wembley' year: Optional[int], unknown_artist: bool, # 'ID Remix' delimiter: VersionDelimiter, # "(" | "[" | "{" | "-")pub struct Version { pub version_type: VersionType, // Remix, Vip, Radio, … pub raw: String, // the text as written, without brackets: "Sub Focus VIP Remix" pub artists: Vec<Artist>, // remixers, role Remixer pub modifiers: Vec<String>, // other type words that didn't win: ["extended"] pub descriptor: Option<String>, // leftover words: "Taylor's", "at Wembley" pub year: Option<u32>, pub unknown_artist: bool, // "ID Remix" pub delimiter: VersionDelimiter, // Paren | Square | Curly | Dash}type Version struct { Type VersionType // VersionTypeRemix, VersionTypeVIP, VersionTypeRadio, … Raw string // the text as written, without brackets: "Sub Focus VIP Remix" Artists []Artist // remixers, role RoleRemixer Modifiers []string // other type words that didn't win: ["extended"] Descriptor *string // leftover words: "Taylor's", "at Wembley" Year *int UnknownArtist bool // "ID Remix" Delimiter Delimiter // DelimiterParen | DelimiterSquare | DelimiterCurly | DelimiterDash}typedef struct trackparse_version { trackparse_version_type type; /* TRACKPARSE_VERSION_REMIX, _VIP, _RADIO, … */ trackparse_str type_name; /* the type's name: "remix", "vip", "radio", … */ trackparse_str raw; /* the text as written, without brackets: "Sub Focus VIP Remix" */ const trackparse_artist *artists; /* remixers, role TRACKPARSE_ROLE_REMIXER */ size_t artists_count; const trackparse_str *modifiers; /* other type words that didn't win: "extended" */ size_t modifiers_count; const trackparse_str *descriptor; /* leftover words: "Taylor's", "at Wembley"; or NULL */ const int *year; /* or NULL */ bool unknown_artist; /* "ID Remix" */ trackparse_delimiter delimiter; /* TRACKPARSE_DELIMITER_PAREN, _BRACKET, _BRACE, _DASH */} trackparse_version;title never includes versions. fullTitle (full_title in Python, Rust and C, FullTitle in Go) is the title with them
put back, in their original brackets.
In Rust the type is the field version_type, because type is a reserved word, and its values are
variants of the enum VersionType (VersionType::Remix,
VersionType::SpedUp). as_str() gives the names used on this
page ("remix", "spedUp"), and so does Display. modifiers holds those names as strings.
delimiter is the enum VersionDelimiter: Paren, Square,
Curly or Dash.
In Go the field is Type, of the string type VersionType. Its constants
(trackparse.VersionTypeRemix, trackparse.VersionTypeSpedUp) hold the names used on this page, so
they print as remix and spedUp. Delimiter is a string type too, holding the delimiter itself:
trackparse.DelimiterParen is "(". Descriptor and Year are pointers, nil when absent.
In C the type is the enum trackparse_version_type (TRACKPARSE_VERSION_REMIX,
TRACKPARSE_VERSION_SPED_UP), and type_name holds its name as a string ("remix", "spedUp").
Print type_name: it differs from trackparse_version_type_name(type) only for a name that
keywords.versionHeads introduced, where type is
TRACKPARSE_VERSION_VERSION. modifiers holds names as strings. delimiter is the enum
trackparse_delimiter, and trackparse_delimiter_name() gives the delimiter itself ("(").
descriptor and year are pointers, NULL when absent. The structs are in
trackparse.h.
The 27 types
Section titled “The 27 types”| Group | Types |
|---|---|
| Rework by someone else | remix bootleg vip edit flip refix rework mashup blend dub mix |
| Length and format | extended radio club original instrumental acapella |
| Recording | live acoustic remaster demo reprise cover version |
| Speed | spedUp slowed nightcore |
The keywords behind them are in
version-keywords.json.
In Rust, VersionType::ALL lists the 27
variants and VersionType::from_name("spedUp") reads a name back. In Go,
trackparse.AllVersionTypes() lists them, and since the type is a string,
trackparse.VersionType("spedUp") is a conversion. In C,
trackparse_version_type_from_name("spedUp", TRACKPARSE_NUL_TERMINATED, &type) reads a name back
and returns false for an unknown one.
Generic words borrow their meaning
Section titled “Generic words borrow their meaning”"Mix", "Edit" and "Version" don't say much on their own. trackparse looks at the word in front (R5.7 in the spec). Click an input to open it in the playground:
| Input | type |
Why |
|---|---|---|
(Radio Edit) |
radio |
"Radio" decides; "Edit" is generic |
(Extended Mix) |
extended |
same idea |
(Levela Mix) |
remix, by Levela |
a name before "Mix" means a remix by that name |
(Extended VIP Mix) |
vip, modifiers [extended] |
the strongest word wins, the rest become modifiers |
(Taylor's Version) |
version, descriptor "Taylor's" |
nothing to borrow, so the words are kept as a descriptor |
import { parse } from "trackparse";
parse("Pendulum - Watercolour (Extended VIP Mix)").versions[0];// { type: 'vip', raw: 'Extended VIP Mix', artists: [], modifiers: [ 'extended' ],// descriptor: null, year: null, unknownArtist: false, delimiter: '(' }from trackparse import parse
parse("Pendulum - Watercolour (Extended VIP Mix)").versions[0]# Version(type='vip', raw='Extended VIP Mix', artists=(), modifiers=('extended',),# descriptor=None, year=None, unknown_artist=False, delimiter='(')use trackparse::parse;
&parse("Pendulum - Watercolour (Extended VIP Mix)").versions[0];// Version { version_type: Vip, raw: "Extended VIP Mix", artists: [], modifiers: ["extended"],// descriptor: None, year: None, unknown_artist: false, delimiter: Paren }import ( "fmt"
"github.com/4matic/trackparse/go")
v := trackparse.Parse("Pendulum - Watercolour (Extended VIP Mix)").Versions[0]fmt.Println(v.Type) // vipfmt.Printf("%q\n", v.Raw) // "Extended VIP Mix"fmt.Println(len(v.Artists)) // 0fmt.Printf("%q\n", v.Modifiers) // ["extended"]fmt.Println(v.Descriptor == nil, v.Year == nil, v.UnknownArtist) // true true falsefmt.Println(v.Delimiter) // (#include <trackparse.h>
trackparse_track *t = trackparse_parse("Pendulum - Watercolour (Extended VIP Mix)", TRACKPARSE_NUL_TERMINATED);const trackparse_version *v = &t->versions[0];printf("%s\n", v->type_name.ptr); // vipprintf("%s\n", v->raw.ptr); // Extended VIP Mixprintf("%zu\n", v->artists_count); // 0printf("%zu %s\n", v->modifiers_count, v->modifiers[0].ptr); // 1 extendedprintf("%d %d %d\n", v->descriptor == NULL, v->year == NULL, v->unknown_artist); // 1 1 0printf("%s\n", trackparse_delimiter_name(v->delimiter)); // (trackparse_track_free(t);Several versions
Section titled “Several versions”Two groups give two versions. So does a slash inside one group (R5.6; try it):
parse("Avicii - Levels (Skrillex Remix) [Radio Edit]").versions.map((v) => v.type);// [ 'remix', 'radio' ]
parse("Dimension - Offshore (Mefjus Remix / Noisia Remix)").versions.map((v) => v.artists[0].name);// [ 'Mefjus', 'Noisia' ][v.type for v in parse("Avicii - Levels (Skrillex Remix) [Radio Edit]").versions]# ['remix', 'radio']
[v.artists[0].name for v in parse("Dimension - Offshore (Mefjus Remix / Noisia Remix)").versions]# ['Mefjus', 'Noisia']parse("Avicii - Levels (Skrillex Remix) [Radio Edit]") .versions.iter().map(|v| v.version_type).collect::<Vec<_>>();// [Remix, Radio]
parse("Dimension - Offshore (Mefjus Remix / Noisia Remix)") .versions.iter().map(|v| &v.artists[0].name).collect::<Vec<_>>();// ["Mefjus", "Noisia"]for _, v := range trackparse.Parse("Avicii - Levels (Skrillex Remix) [Radio Edit]").Versions { fmt.Println(v.Type)}// remix// radio
for _, v := range trackparse.Parse("Dimension - Offshore (Mefjus Remix / Noisia Remix)").Versions { fmt.Println(v.Artists[0].Name)}// Mefjus// Noisiat = trackparse_parse("Avicii - Levels (Skrillex Remix) [Radio Edit]", TRACKPARSE_NUL_TERMINATED);for (size_t i = 0; i < t->versions_count; i++) printf("%s\n", t->versions[i].type_name.ptr);// remix// radiotrackparse_track_free(t);
t = trackparse_parse("Dimension - Offshore (Mefjus Remix / Noisia Remix)", TRACKPARSE_NUL_TERMINATED);for (size_t i = 0; i < t->versions_count; i++) { printf("%s\n", t->versions[i].artists[0].name.ptr);}// Mefjus// Noisiatrackparse_track_free(t);Dash suffixes
Section titled “Dash suffixes”Streaming services often write versions after a second dash. Those are read too, and the
delimiter is - (VersionDelimiter::Dash in Rust, trackparse.DelimiterDash in Go, TRACKPARSE_DELIMITER_DASH in C;
try it):
const t = parse("The Beatles - Hey Jude - Remastered 2015");t.title; // 'Hey Jude't.versions[0];// { type: 'remaster', raw: 'Remastered 2015', artists: [], modifiers: [],// descriptor: null, year: 2015, unknownArtist: false, delimiter: '-' }t = parse("The Beatles - Hey Jude - Remastered 2015")t.title # 'Hey Jude't.versions[0]# Version(type='remaster', raw='Remastered 2015', artists=(), modifiers=(),# descriptor=None, year=2015, unknown_artist=False, delimiter='-')let t = parse("The Beatles - Hey Jude - Remastered 2015");&t.title; // "Hey Jude"&t.versions[0];// Version { version_type: Remaster, raw: "Remastered 2015", artists: [], modifiers: [],// descriptor: None, year: Some(2015), unknown_artist: false, delimiter: Dash }t := trackparse.Parse("The Beatles - Hey Jude - Remastered 2015")fmt.Printf("%q\n", t.Title) // "Hey Jude"v = t.Versions[0]fmt.Println(v.Type, *v.Year, v.Delimiter) // remaster 2015 -fmt.Printf("%q\n", v.Raw) // "Remastered 2015"t = trackparse_parse("The Beatles - Hey Jude - Remastered 2015", TRACKPARSE_NUL_TERMINATED);printf("%s\n", t->title.ptr); // Hey Judev = &t->versions[0];printf("%s %d %s\n", v->type_name.ptr, *v->year, trackparse_delimiter_name(v->delimiter));// remaster 2015 -printf("%s\n", v->raw.ptr); // Remastered 2015trackparse_track_free(t);A dash suffix that isn't a version stays in the title. In a tracklist the rule is stricter, because there the first dash is almost always the separator. The suffix rules are R6.2 and R8.2.
Unknown remixers
Section titled “Unknown remixers”(ID Remix) is a remix by someone not yet announced. You get the version with
unknownArtist: true (unknown_artist in Python, Rust and C, UnknownArtist in Go) and no artists. There is no artist
called "ID". Unknown artists has an example, and
the playground shows it.
Your own words
Section titled “Your own words”If your catalog uses a word trackparse doesn't know, add it with
keywords.versionHeads (version_heads in Python,
KeywordOptions::version_head in Rust,
Keywords.VersionHeads in Go,
trackparse_parse_options_add_version_head in C). The playground has no field for keywords, so this
one runs only in code:
import { createParser } from "trackparse";
const parser = createParser({ keywords: { versionHeads: { rerub: "rework" } } });parser.parse("Chase & Status x Camo & Krooked - Track (Alix Perez Rerub)").versions[0].type;// 'rework'from trackparse import create_parser
parser = create_parser(keywords={"version_heads": {"rerub": "rework"}})parser.parse("Chase & Status x Camo & Krooked - Track (Alix Perez Rerub)").versions[0].type# 'rework'use trackparse::{KeywordOptions, ParseOptions, Parser, VersionType};
let keywords = KeywordOptions::new().version_head("rerub", VersionType::Rework);let parser = Parser::new(&ParseOptions::new().keywords(keywords));parser.parse("Chase & Status x Camo & Krooked - Track (Alix Perez Rerub)").versions[0].version_type;// Reworkparser := trackparse.NewParser(trackparse.ParseOptions{ Keywords: trackparse.Keywords{ VersionHeads: []trackparse.VersionHead{{Key: "rerub", Type: trackparse.VersionTypeRework}}, },})fmt.Println(parser.Parse("Chase & Status x Camo & Krooked - Track (Alix Perez Rerub)").Versions[0].Type)// reworktrackparse_parse_options *options = trackparse_parse_options_new();trackparse_parse_options_add_version_head(options, "rerub", TRACKPARSE_NUL_TERMINATED, "rework", TRACKPARSE_NUL_TERMINATED);trackparse_parser *parser = trackparse_parser_new(options);trackparse_parse_options_free(options); /* the parser keeps its own copy */
t = trackparse_parser_parse(parser, "Chase & Status x Camo & Krooked - Track (Alix Perez Rerub)", TRACKPARSE_NUL_TERMINATED);printf("%s\n", t->versions[0].type_name.ptr); // reworktrackparse_track_free(t);trackparse_parser_free(parser);Keywords only add to the built-in vocabulary. They can't remove words. See Options.
See also
Section titled “See also”Versionin the reference for the field list.- Artists and credits for the credits outside versions.
- Formatting to write versions back, or leave them out.
allArtiststo get artists and remixers in one list.