Database Format¶
Introduction¶
The MeloSpy library supports storing and retrieving melody data from SQL databases. Different formats are planned, currently only SQLITE3 is supported.
However, the format are only due to SQL syntax differences, the central structure is always the same (cf. Table: Overview of tables). Main table is the melody
-table (Table: melody).
All melodies are sequences of events and stored in a single table, where each row represents one melody event. Each event has an unique eventid
and melid
which is used to cross-reference across the database.
The database is designed to hold different melody types, which basically differ only in the available metadata. The type of a melody is stored in the table melody_type
(Table: melody_type).
Currently three types are supported: Weimar Jazz Database (WJD), EsAC and POP-type. The first types are used in the WJD and the EsAC-DB deployed with the MeloSpySuite/GUI.
POP songs are implemented for future use.
WJD type melodies use the tables transcription_info
(Table: transcription_info (WJD)),
record_info
(Table: record_info (WJD)), composition_info
(Table: composition_info (WJD)) and solo_info
(Table: solo_info (WJD)) for meta data. The structure of the metadata reflects
the fact that a solo is part of some track, which can contain more than one solo. Tracks are contained on some record, which can contain several tracks with solos included in the WJD.
Atrack and hence each solo taken from this track is based on some composition, which might be also used for other tracks, e.g., a jazz standard such as “Body and Soul”.
EsAC-type melodies use esac_info
(Table: esac_info (ESAC)), which contains the metadata originally used for EsAC folk songs. POP song type melodie use (Table: popsong_info (POP))
for storing rather sparse metadata for pop songs. In future, there might be an extension or alternative solution to this. For EsAC and POP melodies, only phrase sections in table sections
(Table: sections) are used.
The beats
table (Table: beats (WJD)) is solely used for WJD-type melodies to store (tapped) beats along with chord, form, bass pitch and other annotations.
Description of SQLite3 database tables¶
Table: Overview of tables¶
Table name |
Description |
---|---|
|
Table for beat annotation of WJD melodies, referenced by |
|
Infos regarding the underlying composition of a WJD solo, referenced by |
|
Information regarding the distributed database file like version information, license, etc |
|
EsAC infos for EsAC melodies, referenced by |
|
Main table for all melody events |
|
Indicated type of melody: WJD solos or EsAC (Folk songs using Essen Associative Code), referenced by |
|
Pop song infos, referenced by |
|
Infos regarding the specific audio recording of a WJD solo was taken from, referenced by |
|
All sections (phrase, chorus, form, chords, etc.), referenced by |
|
Solo infos for WJD solos, referenced by |
|
Information specific to a track on a record (or CD) |
|
Transcription infos for WJD solos, referenced by |
Table: beats
(WJD)¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
Unique ID of beat event, |
|
INTEGER |
References |
|
REAL |
Onset (in secs) of beat |
|
INTEGER |
Number of bar |
|
INTEGER |
Number of beat in a bar |
|
TEXT |
Signature of this and all subsequent beats and bars, resp. |
|
TEXT |
Accompanying chord |
|
TEXT |
Form part of this and all subsequent beats (e.g. A1, B2) |
|
INTEGER |
Bass pitch (fractional MIDI) of the beat |
|
INTEGER |
Number of chorus this and all subsequent beats are belonging to |
Table: composition_info
(WJD)¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
Unique ID of composition_info, |
|
TEXT |
Title of the composition |
|
TEXT |
Composer(s) of the underlying tune |
|
TEXT |
Basic form the song (e.g. AABA), including labels and length (in bars) |
|
TEXT |
Template |
|
TEXT |
Tonality type of the song. Possible values: |
|
TEXT |
Genre of the solo. Possible values: |
Table: db_info
¶
Field |
Type |
Description |
---|---|---|
|
TEXT |
Descriptive name for the database |
|
TEXT |
Person/project who created the database |
|
INTEGER |
Major version of database schema |
|
INTEGER |
Minor version of database schema |
|
TEXT |
Release version of database content |
|
TEXT |
Date and time of the creation of the database |
|
TEXT |
License text |
|
TEXT |
Current status of the database content. (Possible values: |
Table: esac_info
(ESAC)¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
References |
|
TEXT |
Folk song collection of an EsAC-type melody (orignally first line in a EsAC file) |
|
TEXT |
Title of an EsAC-type melody (orignal CUT-field) |
|
TEXT |
Original EsAC ID of an EsAC-type melody |
|
TEXT |
Original key of an EsAC-type melody (from KEY-field) |
|
TEXT |
Original base rhythmical unit for of an EsAC-type melody (from KEY-field) |
|
TEXT |
Original signature of an EsAC-type melody (from KEY-field) |
|
TEXT |
Original REG-field of an EsAC-type melody |
|
TEXT |
Original FCT/FKT-field of an EsAC-type melody |
|
TEXT |
Original CMT-field of an EsAC-type melody |
|
TEXT |
Original SRC-field of an EsAC-type melody |
|
TEXT |
Original CNR-field of an EsAC-type melody |
|
TEXT |
Deducted tune family of an EsAC-type melody (derived from orignal EsAC ID) |
|
TEXT |
Original TEXT-field of an EsAC-type melody |
|
TEXT |
Original MEL-field of an EsAC-type melody |
|
INTEGER |
Least common multiple of all beat divisions |
Table: melody
¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
Unique ID of a melody event, PRIMARY KEY, Event IDs must be incrementally increasing with respect to the onsets of the melody they belong to. |
|
INTEGER |
Unique ID of the melody containing the event |
|
REAL |
Onset (in sec) of the event |
|
REAL |
Pitch (fractional MIDI) of the event |
|
REAL |
Duration (in sec) of the event |
|
INTEGER |
Period of the metrical context of the event |
|
INTEGER |
Division of current beat of the event |
|
INTEGER |
Bar number of the event |
|
INTEGER |
Beat number of the event |
|
INTEGER |
Tatum number of the event |
|
INTEGER |
Subtatum number of the event |
|
INTEGER |
Numerator of orginal signature of the metrical context of the event |
|
INTEGER |
Denominator of orginal signature of the metrical context of the event |
|
TEXT |
Beat proportions of the metrical context of the event. Text of form |
|
REAL |
Duration of the current beat (in secs) |
|
TEXT |
Tatum proportions of the current beat. Text of form |
|
REAL |
Maximum of loudness per tone |
|
REAL |
Median of loudness per tone |
|
REAL |
Standard deviation of loundess per tone |
|
REAL |
Relative position of loudness peak |
|
REAL |
Normalized temporal centroid of loudness per tone |
|
REAL |
Signal-to-background ratio of loudness |
|
TEXT |
Annonated modulation per tone. One of the following values |
|
REAL |
Modulation range in cents |
|
REAL |
Modulation frequency in Hertz |
|
REAL |
Median deviation of the fundamental frequency from standard 12-tone equal tempered pitch (corrected for overall tuning) |
Table: melody_type
¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
References |
|
TEXT |
Type of melody. Valid types: |
Table: popsong_info
(POP)¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
References |
|
TEXT |
Name of the artist |
|
TEXT |
Title of the song |
|
REAL |
Average tempo (BPM) of the solo as determined by the Sonic Visualiser project file |
|
TEXT |
Rough classification of tempo of the solo. Possible values. |
|
TEXT |
Signature(s) of the solo. |
|
TEXT |
Key of the solo (if applicable) or tonal center. See Key for more information. |
|
TEXT |
Filename of melody source |
|
TEXT |
Chord changes |
|
INTEGER |
Year |
|
TEXT |
Country of artist/performer |
|
TEXT |
Style/genre of the song |
Table: record_info
(WJD)¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
Unique ID of record_info, |
|
TEXT |
Name of the artist of the record containing the track with the solo |
|
TEXT |
Title of the record containing the track with the solo |
|
TEXT |
Record label |
|
TEXT |
Discographic entry for the record |
|
TEXT |
MusicBrainz Identifier for the track containing the solo |
|
TEXT |
Date of release of the record |
Table: sections
¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
References |
|
TEXT |
Type of section. Valid types: |
|
INTEGER |
ID of first event in section (relative to the corresponding melody, not |
|
INTEGER |
ID of last event in section (relative to the corresponding melody, not |
|
TEXT |
Value of section. Valid values are : |
Table: solo_info
(WJD)¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
References |
|
INTEGER |
References |
|
INTEGER |
References |
|
INTEGER |
References |
|
TEXT |
Performer for WJD type melodies |
|
TEXT |
Title of tune for WJD type melodies |
|
TEXT |
Additional information appended to the title |
|
INTEGER |
Number of solo of corresponding track |
|
TEXT |
Instrument used in the solo |
|
TEXT |
Style of the solo. Possible values: |
|
FLOAT |
Average tempo (BPM) of the solo as determined by the beat track of the Sonic Visualiser project file |
|
TEXT |
Rough classification of tempo of the solo. Possible values. |
|
TEXT |
Basic rhythmic groove of the solo. Possible values: |
|
TEXT |
Key of the solo (if applicable) or tonal center. See Key for more information. |
|
TEXT |
Signature(s) of the solo |
|
TEXT |
Chord changes of solo (as a compact string, as defined by one chorus) |
|
INTEGER |
Number of choruses played |
Table: track_info
(WJD)¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
Unique ID of track_info, |
|
INTEGER |
References |
|
INTEGER |
References |
|
TEXT |
Filename of the track |
|
TEXT |
Lineup |
|
TEXT |
MusicBrainz Identifier for the track containing the solo |
|
INTEGER |
Number of the track on the record |
|
TEXT |
Date of recording |
Table: transcription_info
(WJD)¶
Field |
Type |
Description |
---|---|---|
|
INTEGER |
References |
|
INTEGER |
References |
|
TEXT |
Name of the originating Sonic Visualiser file for WJD type melodies |
|
TEXT |
Name of the solo cut from the original track (internal use only) |
|
TEXT |
Start/Endtime of the solo in the original track; Format mm:ss-mm:ss |
|
FLOAT |
Start of the solo in seconds with nanoseconds resolution |
|
TEXT |
Status of the Sonic Visualiser file. Valid values: |