Notations and some important data structures used in Habbo Hotel
Habbo Music Notation (HMN) v1 is a standard for the text-based notation designed to represent music compositions in the Traxmachine system of Habbo Hotel. It encodes structured data for music layers, sample references, and durations as a single-line string.
While HMN v1 reflects how Habbo Hotel interprets music tracks, it is not an official Sulake notation, and future changes may not be adopted by Sulake.
This specification exists to formalize and document how Habbo encodes Traxmachine music for storing purposes. It is:
HMN v1 is a textual representation of layered musical data that enables:
This document is aimed at developers, researchers, archivists, and enthusiasts involved in the Habbo Hotel community, particularly those working on tools for music playback, preservation, and analysis of Traxmachine compositions. It also serves as a common reference for understanding, implementing, and manipulating the Habbo Music Notation (HMN), which can be used for tasks such as developing interoperable software, emulators, and documentation for fan-driven projects. The audience also includes data scientists who may utilize this notation in music-related research or analysis. Familiarity with basic programming concepts, string manipulation, and digital audio representation is recommended but not required.
HMN v1.0 defines the a known structure for how Traxmachine music compositions used to be stored, based on the original implementation in Habbo Hotel.
HMN is a community-maintained. While efforts are made to ensure accuracy, Sulake may change the format at any time. Future extensions will aim to preserve backward compatibility whenever possible.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
An implementation is considered HMN v1.0 compliant if it adheres to the syntax, processing rules, and constraints defined in this document. A conforming parser implementation:
A valid HMN v1.0 string MUST:
An HMN v1 string represents a sequence of musical layers, each comprising a list of samples defined by identifiers and durations.
The following Extended Backus-Naur Form (EBNF) defines the syntax of HMN v1.0:
<layerList> ::= <layer>+
<layer> ::= <layerId> ":" <sampleList> ":"
<layerId> ::= [1-4]
<sampleList> ::= <sample> (";" <sample>)*
<sample> ::= <sampleId> "," <duration>
<sampleId> ::= 0 | <posIntUpTo648>
<duration> ::= <posIntUpTo150>
Field | Type | Range | Description |
---|---|---|---|
layerId |
Integer | 1-4 |
Identifier for each musical layer |
sampleId |
Integer | 0-648 |
Reference to global sound sample’s identifier (0 = silence) |
duration |
Integer | 1-150 |
Time in units of 2 seconds |
The following regular expression can be used to validate the general structure of an HMN v1.0 string:
/^(?:(\d+):(?:(\d+),(\d+))(;(?:(\d+),(\d+)))*:)+$/
0
(zero) MUST be treated as silence and ignored in audio playback.Error Code | Description |
---|---|
ERR_SAMPLE_ID_RANGE | sampleId is outside the valid range 0-648 . |
ERR_INVALID_DURATION | duration is outside the valid range 1-150 . |
ERR_FORMAT_SYNTAX | Missing or misplaced delimiters (: , ; , , ). |
ERR_EMPTY_LAYER | Layer is declared but contains no samples. |
An HMN-compliant parser MUST reject invalid files and return an appropriate error.
The following is an example of a valid HMN v1.0 string:
1:12,4;34,2;0,1;56,6:2:22,3;45,2;67,4:3:0,5;31,3;44,2:4:12,6;34,4:
Explanation:
1
: 12,4
(sample ID 12
, duration 4
), 34,2
(sample ID 34
, duration 2
), 0,1
(silence for 1
unit), 56,6
(sample ID 56
, duration 6
).2
: 22,3
, 45,2
, 67,4
.3
: 0,5
(silence for 5
units), 31,3
, 44,2
.4
: 12,6
, 34,4
.This example is a more complex sequence from the music “Habbowood” by Michael Bauble:
1:280,4;265,4;264,4;263,8;0,16:2:262,4;263,8;266,4;267,4;264,12;262,4:3:0,4;268,8;269,4;270,4;268,8;282,4;285,4:4:0,20;74,4;75,3;81,3;0,6:
Check more examples at Traxmachine - Demos.
The following extensions MAY be introduced in future versions:
Future revisions will maintain backward compatibility wherever feasible, and such extensions will be versioned appropriately.
While HMN is purely textual and does not involve code execution, parsers MUST:
Important
This notation DOES NOT have any user-specific information, so by itself it DOES NOT ensures that the user owns the sample pack that contains the sample that was used. It is meant to be this way so that the playback can use the same entry without exposing information about the song’s author. It is important to understand this if you’re saving user generated content, where the user is not meant to have access to all samples.