{'fraction_non_alphanumeric': 0.02843743338307397, 'fraction_numerical': 0.009081219356214027, 'mean_word_length': 4.830474770072086, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
AnimeTAB: A new guitar tablature dataset of anime and game music

While guitar tablature has become a popular topic in MIR research, there exists no such a guitar tablature dataset that focuses on the soundtracks of anime and video games, which have a surprisingly broad and growing audience among the youths. In this paper, we present AnimeTAB, a fingerstyle guitar tablature dataset in MusicXML format, which provides more high-quality guitar tablature for both researchers and guitar players. AnimeTAB contains 412 full tracks and 547 clips, the latter are annotated with musical structures (intro, verse, chorus, and bridge). An accompanying analysis toolkit, TABprocessor, is included to further facilitate its use. This includes functions for melody and bassline extraction, key detection, and chord labeling, which are implemented using rule-based algorithms. We evaluated each of these functions against a manually annotated ground truth. Finally, as an example, we performed a music and technique analysis of AnimeTAB using TABprocessor. Our data and code have been made publicly available for composers, performers, and music information retrieval (MIR) researchers alike.


INTRODUCTION
As one of the guitar score notations, tablature can be traced back in 16th century, when it is originally known as Cifra, meaning something written in code in Arabic [1]. Cifra uses numbers on horizontal lines to represent fret positions on guitar fingerboard, and it has gradually evolved into today's guitar tablature. This simple and intuitive way of notation enables beginners to play the instrument easily, without requiring complicated music theory knowledge. Interestingly, we found an overlap between fingerstyle guitar players and Japanese anime fans [2][3][4]. While not a popular field in the world-music pantheon, Japanese pop music, anime, and video games have a surprisingly broad and growing audience among Asia youths especially young guitar players.
In recent years, researchers have also shown interest in guitar music and tablature [5][6][7][8][9][10][11]. However, high-quality symbolic guitar tablature is not easy to obtain, especially for anime music, and this limitation has likely limited the computational study of guitar tablature to date. Table 1 lists all the open-source symbolic guitar score datasets we found [12][13][14][15][16]. Sarmento et al. [12] presented a dataset of about 26,000 band scores in GuitarPro 1  format, named DadaGP. However, the encoding tool they released is only suitable for GuitarPro 3, GuitarPro 4, and GuitarPro 5, which have long since ceased to be used (the latest version has been released to GuitarPro 8), and most tracks of DadaGP are for full bands rather than individual fingerstyle players. Chen et al. [15] proposed a new dataset named EGDB, which contained transcriptions of the electric guitar performance of 240 tablatures rendered with different tones. Xi et al. [13] presented a guitar music transcription dataset: GuitarSET, which including styles of rock, bossa nova and jazz. Burlet et al. [14] compiled two ground-truth datasets for polyphonic transcription and guitar tablature arrangement from manual transcriptions. Kehling et al. [16] presented a novel dataset of electric guitar recordings with extensive annotation of note parameters. As shown above, none of them focus on fingerstyle arrangements for Japanese anime music or provide musical structure annotations. To this end, we propose a new guitar tablature dataset and an accompanying analysis toolkit. Three main contributions are presented in this paper: • We introduce AnimeTAB, a dataset of fingerstyle guitar tablature in MusicXML format, to provide more high-quality guitar tablature for both guitar players and researchers. It contains 412 full tracks of guitar tablature from anime or video game music.
• We choose 202 tablature from all the 412 tracks and segment them into 547 clips, labeling each with a start/end bar number and one of four musical structures: intro, verse, chorus, and bridge. These annotations can be used for a variety of MIR tasks, such as musical structure segmentation, music similarity, and automatic composition.
This paper is structured as follows. Section 2 gives an overview of some published guitar symbolic datasets, section 3 introduces the basic information of our AnimeTAB dataset; section 4 describes the principles and functions of TABprocessor; section 5 details the use of TABprocessor to analyze our dataset for an example, including analysis of notes, harmonies and techniques. Conclusions are presented in section 6. We released all the tracks, demos, and source code in [anonymized], where all the test results can also be found.

ANIMETAB DATASET
AnimeTAB is a structure-labeled guitar tablature dataset of anime and video game music, which can be used as symbolic data for music generation, song classification and recommendation, automatic accompaniment, phrase separation, and other MIR tasks while satisfying the daily practice needs of anime fingerstyle guitar players. The dataset consists of 412 scores and 547 labeled clips from anime episodes and video game theme songs from the 1990s to present. All tracks are collected from open-source scores on the Internet, most of which are written and voluntarily shared by the guitar players in anime fans community. Anime lovers always have an exceptional enthusiasm to share their preferences and productions, but the overall quality of their sharing are sometimes unstable. We manually checked every score to ensure the quality and consistency, and corrected the wrong note, illegal notations, inappropriate format, and other mistakes. Metamessages like Due to the requirements of different tasks, the Ani-meTAB dataset is divided into full scores, score clips, and encoded scores, which will each be introduced in detail.

Part 1:Full Scores
The first part is a set of about 412 full scores. These are derived from GuitarPro's native GTP format and were exported to MusicXML format using GuitarPro 7. We faithfully recorded and retained all the aspects of these tracks including special tunings, capo positions, and time signatures for special requirements in the future. Since many of the notations are specific for guitar techniques in GuitarPro software, to reproduce the complete track information, we do not recommend using other score editing software like Musescore to open them.

Part 2:Score Clips
Instead of entire tracks, specific music phrases like verses or chorus are more suitable in some special applications, for example, soundtracks for short videos or game scenes. The authors and another five students with background in music have selected 202 from all 412 scores, extracting specific music structures-intro, verse, bridge, and chorusand labeled them with their structure types and starting/ending bar numbers. There are 4-16 measures in each of these slices, meta messages from the origin songs were retained. For the sake of data consistency in subsequent analysis, we set the capo 2 frets to zero for all clips while maintaining the fingering. More specific information is given in Table 2. Due to our careful selection, these score clips can also serve as practice tracks for guitar players.  Table 2. Information of musical structure clips.

Part 3:Preprocessed Scores
Well-known natural language processing (NLP) models used in MIR fields, such as Transformer [17], BERT [18],and GPT-2 [19], can regard encoded musical tokens as actual texts for further processing. Moreover, Encoded data can take up less space and circumvent copyright issues. Precisely for these reasons, We extracted the pitch, beats, and fingering information from the 547 clips and designed this into the following format.
• Pitch. In every note in MusicXML files, the step, octave, and alter nodes under the pitch node represent the tone name, octave, and whether there is an accidental, respectively. We encode notes into string form, and the ascending C of the fourth octave can then be encoded as "C4#" or "4C#", while all rests are encoded as "R". Simultaneously sounded notes are connected by spaces from high to low to form a note cluster in string form. With note encoding, users can directly put scores into the embedding layer just like actual texts in English.
• Beats. Note duration is recorded in MusicXML in an entirely different form than in MIDI. The number of beats of a note is determined by the ratio of its duration node and the bar's division node for a given BPM 3 . We record this ratio as a time stamp and put it into the time list as a float32 format.
• Finger positions. GuitarPro 7 creates a backup for each bar with fret and string nodes under the technical node by default. Similar to pitch, a finger position is represented by (string, fret)(rests are '(R,R)'). Simultaneously sounded finger positions are connected by spaces from high to low to form a cluster of finger positions. The final result is as shown in Figure 2.
• Special tunings. Certain strings may be tuned down a few semitones to simplify the chords and fingering in some tracks, for example in drop D 4 or open D 5 . This is called special tuning. We record the number of semitones by which string is raised or lowered in 3 Beats per minute 4 Lower the sixth string a whole tone 5 Adjust the six strings to D, A, D, F#, A, D the tuning list to avoid mismatches between the pitch and fingering.
Each of the above text tags can be automatically converted by our toolkit-TABprocessor, and we will introduce this the next section.

TABPROCESSOR TOOLKIT
Currently, there are MIR toolkit like music21 [20] that can extract information from musicXML files, but music21 is more oriented towards MuseScore, Finale, or Sibelius but not Guitarpro. However, due to the highly customizable character of MusicXML, it can behave completely differently when generated by different software, and we have found that a large part of scores in AnimeTAB cannot be opened by music21. That's exactly why we created our own One-click data transfer and analysis toolkit: TABprocessor.
Written in Python, TABprocessor is a lightweight MIR toolkit for information extraction, processing, and analysis functions that is specifically oriented to guitar Mu-sicXML scores generated by GuitarPro. It is designed to allow even code beginners or musicians who do not have strong coding skills get started quickly and have fun with it. A short line of pitchset, fingerset, timesigset, tunings = readTAB(path) is all that is required to convert the pitches, finger positions, and note beats of an entire MusicXML score into the encoded format mentioned above. To meet the researcher's need for data analysis, We have also added other practical methods to TABprocessor for different research tasks and model frameworks, and these are introduced below.

Bassline and Melody Notes Extraction
Melodies and basslines are common objects in MIR research, but manual annotation of large databases is a tedious task. Thus, we provide methods for bassline and melody extraction in TABprocessor. These can be used as both an MIR analysis tool and a fingering simplification method for guitar beginners when faced with complicated scores. Due to the principle and structure of the guitar arrangement, we chose a simple but efficient rule for our extract function: • Bassline extraction. When a single note or the lowest note of a note cluster is lower than the fifth string, it will be considered to be a bassline note; if fewer than two bassline notes have been extracted, the fourth-string notes will also be regarded as bassline notes to avoid a lack of low frequencies.
• Melody extraction. When a single note is on the first or second string, it will be considered a melody note. A note with a fret higher than five will be considered one string higher until the fret drops below 5. The highest note of a note cluster is considered a melodic tone regardless of its string.
A simple demonstration is shown in Figure 2. Here, we chose a song with 50 bars and manually labeled the bassline and melody for testing. The results are shown in Table 3. As can be seen, this method performs well on melody notes, and it sacrifices accuracy for higher recall of bassline notes, of which it is better to have an excess than a shortage. Taken together, this can produce satisfactory extraction from most guitar scores.

Key Detection and Transfer
The functions of key detection and transfer are provided by other similar symbolic algorithms [21][22][23][24], but in our software, we have adopted an easier and faster approach. First, the tones are differentiated by the maximum of the twelve S n values: where S n represents the total number of tones of pitch n, and K C represents all in-key tones in the key of C. Major and minor are differentiated by the number of fifths and sixths of the scale. This can be useful when analyzing chord degrees or rebuilding fingerings in other keys. We created a key-labeled validation set of 45 tracks, in which our method only took about 0.06 ms for each track, while music21 took about 20 ms, and we achieved a 95.5% correct rate in tone differentiation and 74.4% in major/minor differentiation. We analyzed some of the error samples, and the results showed that the keys of most of the error samples were blurred and difficult to classify as strictly major or minor. This method greatly accelerates the operation speed while still being precise enough for conformist genres such as anime fingerstyle.

Rule-based Chord Recognition
Chords are an important part of symbolic music. Compared with the complex spectral information that is examined for deep-learning methods using audio signals, identifying chords in symbolic music is much easier. We provide a method for detecting the type and root note of a chord by the intervals of the arranged in-chord tones. A similar function is provided by GuitarPro, but this cannot be accessed by an independent function call. Our method only considers the notes on the third, fourth, fifth, and sixth strings, because melody notes are often distributed on the first and second strings. The applicable chord types and their loop sections are listed in  Table 4. Distinguishing chords by the intervals occurring. A chord's root is the pitch after the bold number (except in augmented chords). For example, a C chord (C, E, G, C) will give intervals of 4, 3, and 5 semitones, representing a major triad, and the pitch after 5 is the chord's root.

Special Event Detection
The guitar has a wealth of playing techniques that can greatly enrich the listening experience. We provide a function to detect chords, rests, triplets, legato lines, and techniques such as muting, artificial or natural harmonics, and glides by checking each note node in a bar. Users can change the dictionary to analyze other techniques if required.

Ligato Lines and Multi-voice Processing
In fingerstyle performance, performers always hold notes especially bass notes sustain as long as possible to gain a fuller sound effect until the next note on the same string. This results in many ligato lines between note clusters being practically useless. Thus we provide a function to clean the useless ligato lines while keeping tracks sounding the same. Also, Guitarpro allows users to edit one soundtrack in different voices so that users can write root notes, melody, and filling notes separately, but may be unreadable for other scorewriter software. we provide a method that integrate different voices or even different tracks into one. These two functions have been integrated into readXML(), but can be called separately.

Conversion Function
We provide a variety of functions to convert between the string formats, MIDI values, and guitar finger positions mentioned above. This will be helpful when faced with a mismatch between notes and fingering, such as the use of a capo or special tunings. The same MIDI value may have multiple positions on the fretboard, so this method will return multiple values from lower to higher tones. All of the above features are designed to be as simple, intuitive, and fast as possible. We hope that our toolkit is simple and efficient enough to lower the barrier for anime and guitar enthusiasts, and that it might attract more talented people to join MIR research. For more information, please visit [anonymized]

ANALYSIS
In this section, we present the use of some of the functions in the TABprocessor toolkit to analyze the 560 score clips of AnimeTAB as a demonstration. The results, figures, and code can be found in our GitHub repository. The keys and notes appearing in all tracks as extracted by key_detect are shown in Figure 3(b) and Figure 3(c). As shown, the most commonly used keys in capo = 0 are C, G, D, and F, which are the lower degrees of the circle of fifths with the simplest fingering and few barre chords. Figure 3(c) shows the distribution of all the notes appearing, and the C natural major scale makes up a large proportion of these. Figure 3(d) shows the intervals in all note clusters, which are mainly harmonious intervals such as first, fifth, and fourth, and these are followed by major and minor thirds. Figure 3(e) shows the distribution of the beats of notes, most of which are eighth notes.

Notes on the Fingerboard
Pink circles in Figure 4 show the probability of distribution of notes played at different positions on the guitar fretboard when standardized into capo = 0 (the first column is for open-string notes). As we can see, the second and third string are more often used than the others. The overall distribution on the fingerboard has an inverted right-angle trapezoid shape, which is related to the posture of the performer's left hand: when holding the guitar neck, the left thumb and index finger are roughly in the same fret position, while the remaining three fingers reach out from the first-string side of the neck to press the higher frets. Most of the notes are concentrated in the first four frets, since four frets with 24 pitches can completely encompass all the notes of a natural major scale while also avoiding excess finger movements.

Natural Harmonics on the Fingerboard
The yellow diamonds in Figure 4 show the distribution of all the natural harmonics on the fingerboard. Obviously, the natural harmonics are distributed strictly at standingwave node points such as half the string length (12th fret), one third of the string length (seventh or 19th fret), and a quarter of the string length (fifth fret). Higher harmonics are rarely used. More harmonic techniques can be seen to appear on the first and second strings, which we suspect has an explanation from a materials science perspective: the third, fourth, fifth, and sixth strings generally use a high-carbon steel string core wrapped in copper or alloy wire, but the first and second strings (and the third string of an electric guitar) have no wire wrapping and the string core remains exposed; this results in harmonics sounding clearer.

Slides on the Fingerboard
The blue arcs in Figure 4 show all the positions at which the sliding technique appears; the lower semicircles indicate sliding from low to high, and the upper semicircles indicate sliding from high to low. The blue arcs are found mainly on the high strings and between the third and sixth frets; this indicates that most of the slide techniques are used for melodic or filler notes by the middle or ring finger. The most common distances of the slides are two or four frets, but there are a few longer slides, such as from the second to the seventh fret of the third string, and these are mostly found at a point when the melody changes quickly between verse and chorus.

Use Case: Music Generation
Music generation tasks especially those using deeplearning methods have attracted widespread attentions of countless MIR researchers in recent years. From the basic Perceptron to the state-of-the-art NLP models, the utilization of deep-learning in music generation tasks has be-come a trend, and has been proved success in many previous study. Huang et al. [25] demonstrated a Transformer model with a modified relative attention mechanism to generate minute-long compositions on a given motif. Yang et al. [26] pioneered the application of convolutional neural networks (CNNs) to symbolic-domain music generation task, making it possible to generate melodies both from a chord sequence from scratch or from previous notes by conditioning. Obviously, new high-quality data is never too much for deep-learning models.

Use Case: Music Structure Analysis
Music elements can range from local/short-term levels (like motif) to long-term levels (like segments). Longer temporal scales like verse or chorus may contain underlying messages that could be useful in various tasks. There have been some muisc audio segmentation tasks like [27][28][29]. The performance these segmentation algorithms has been shown to be dependent on the audio features chosen to represent the audio, but annotated audio datasets are time consuming and occupies more space than symbolic datasets. In [30], Guan et al. deployed various neural network architectures on symbolic representation of music to detect different segments. Experiment results show that the CNN-CRF architecture performs the best. Sawada et al. [31] presented an unsupervised note sequences segmentation method using a language model based on a nonparametric Bayesian model. Treating music as a language, the model can conduct melody sequences without annotations. Our dataset can be used as a labeled ground truth in future similar researches.

Use Case: Humanities and Multimodal Research of ACG Culture
Cultural diversity is the source of creativity for MIR community. Despite being considered as a niche area, but with the fast development of media and information technology, the anime, comic and game , a.k.a ACG culture, is becoming increasingly popular during the past decades. In [32], by content analysis and comparing, Lu et al. explain the impact by Japanese anime on Chinese youth, and the influence of new media and technologies on its spread; In [33], Yamato et al. have analyzed the data from in-depth interviews of nine Malaysians that have been involved in ACG music and other events for more than five years. Followup cultural communication researchers can deploy Multimodal analysis based on our data and metamessage. We hope through our tireless efforts, this minority culture can be passed on for one generation to another.

CONCLUSION
In this paper, we present AnimeTAB, an anime guitar song dataset based on the MusicXML and GTP formats. This contains: (1)412 complete songs; (2)547 score clips from the 110 best-quality tracks, each of which is labeled with a start/end bar number and one of four musical structures (verse, chorus, bridge, or intro); (3) encoded notes. This dataset fills the gap relating to the lack of structure-labeled anime guitar tablature dataset in the MIR field. We also present TABprocessor, our data-encoding toolkit for guitar MusicXML files. This includes practical functions such as data encoding, key and chord detection, and root and melody extraction. We have tested the performance of these functions and presented a sample analysis. In future studies, we intend that we will gradually improve the user guide and add more functions to this system while also updating the dataset.