-
Notifications
You must be signed in to change notification settings - Fork 6
tja
This is the parser for the TJA format, following the documentation of IID's TJA.md. The implementation follows the song_parser format.
There are two ways to parse events in a TJA:
class Note:
A note constitutes anything that can be visually seen and interacted with. Don/Kat notes, drumrolls, balloons, kusudamas, etc. This also includes barlines as type 0. This class is sortable (by hit_ms) and hashable.
- hit_ms is the time in milliseconds in which the player hits the note. This is calculated at parsing.
- load_ms is the time in milliseconds in which the note appears on the screen. This is calculated at runtime.
- unload_ms is the time in milliseconds in which the note disappears from the screen. This is calculated at runtime.
class TimelineObject:
A TimelineObject is cannot be interacted with, but can be read from during its start_time to end_time. This includes things such as BPM changes, branch sections, lyrics, delay, gogo time, and #JPOSSCROLL changes.
A NoteList is a struct to contain all of this information. It consists of notesand a timeline.
Each course has its own CourseData, which contains course specific information such as the star count (LEVEL), balloon counts, and SCOREINITs. SCOREINIT and SCOREDIFF are currently unused in the default scoring mode and only apply to gen3 scoring.
Each parsed TJA file has a TJAMetadata, which contains all possible metadata for the file. Importantly, TITLEs and SUBTITLEs are stored in this section as std::maps, where the country code corresponds to a title. For example, if I wanted to access the Korean name of a song, I would do this via title["ko"].
Finally, TJAEXData is available for metadata that is not apart of the TJA format. This includes marking whether it is new audio or old audio (derived from the song title), or if it is a limited time song (Yokuderu 15300 or Jingle Bell 765)
There are number of useful functions outside of the actual note parsing that can be used:
int calculate_base_score(const NoteList& notes);This returns the equivalent of a SCOREINIT for shinuchi scoring. This was tested against all official charts and only derives on two songs.
std::string test_encodings(const std::filesystem::path& file_path);This will return the encoding of a given file, with the options being:
- UTF-8 with BOM
- UTF-16 LE
- UTF-16 BE
- SHIFT-JIS
There are also many modifiers that can be applied to already parsed NoteLists:
void modifier_moji(NoteList& notes);Generates the 口唱歌 (Note phoneticization) for each note.
void modifier_speed(NoteList& notes, float value);Changes the scroll speed of each note, generally ranging from 1-10-40 (0.1 - 1.0 - 4.0).
void modifier_display(NoteList& notes);Disables the display of all notes (Doron)
void modifier_inverse(NoteList& notes);Inverts the colors of all notes (Abekobe)
void modifier_random(NoteList& notes, int value);Randomizes the colors of all notes based on value. a value of 1 will randomize 20% of the notes (Kimagure) and a value of 2 will randomize 50% of the notes (Detarame)
Building
libs
- animation
- audio
- config
- filesystem
- global_data
- input
- logging
- ray
- scores
- screen
- script
- song_parser
- text
- texture
- video
- webcam
libs/parsers
objects
objects/game
- player
- background
- gauge
- judgment
- combo
- branch_indicator
- ending_animations
- gogo_time
- fireworks
- song_info
- transition
- result_transition
- judge_counter
- score_counter
- score_counter_animation
- balloon_counter
- drumroll_counter
- kusudama_counter
- drum_hit_effect
- lane_hit_effect
- gauge_hit_effect
- combo_announce
- note_arc
objects/global
objects/title
objects/entry
objects/settings
objects/result
objects/song_select
- player
- navigator
- box_base
- box_song
- box_folder
- neiro
- modifier
- ura_switch
- diff_sort
- search_box
- dan_transition
- genre_bg
- score_history
- song_select_script
scenes