Giter Site home page Giter Site logo

williewillus / touhou-song-sorter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from relick/touhou-song-sorter

0.0 0.0 0.0 2.54 MB

Manually merge sort your favourite touhou songs at https://kasha.dev/song/

Home Page: https://kasha.dev/song/

License: MIT License

JavaScript 83.37% CSS 5.55% HTML 11.08%

touhou-song-sorter's Introduction

touhou-song-sorter

manually merge sort your favourite touhou songs

Developer notes

All of the song data is found at src/fnc_data_song.js, defined in the array ary_SongData. Each song's data is an array with a specific number of elements; for example:

[1, "The Sky Where Cherry Blossoms Flutter Down", [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0], "hsifs.png", "3B207i_YzE0", "Hidden Star in Four Seasons", "HSiFS", "Title Screen", 0, 0]

The elements, in order, are as follows:

  1. Nothing useful, but we just have 1 here by convention.
  2. Song title.
  3. A 1:1 mapping to ary_TitleData. If the element at index i is 1, then it belongs to the game/album with the title ary_TitleData[i].
  4. The filename within the images/ folder for the game/album to which the song belongs.
  5. YouTube video ID.
  6. Game/album full title.
  7. Game/album abbreviated title.
  8. Where the song plays, or whose theme it is.
  9. 0 if original song, 1 if arrangement.
  10. 1 if a boss-only theme, 2 if a stage-only theme, 3 if both, or 0 otherwise.

Adding new games/albums

  • Add its title to ary_TitleData.
  • Add its image to the images folder (180x180 preferably).

The data storage is currently suboptimal, and thus every single song's data array is required to change whenever a new game/album is added.

If we wish to add a new game, then a 0 element must be appended to the large integer array of that song, and for each song that belongs to the new game, its integer array must have the same number of items as the other songs, and the last item of that array must be 1.

Because of the massive number of lines that must be changed in this process, manually updating them is tedious, so there are some Bash commands that can save a lot of time; however, they require the integer arrays to be in a consistent format.

How to add something:

  • between the 3rd and 4th games/albums: sed -E -i '' 's/(\[([01],){3})/\10,/g' src/fnc_data_song.js
  • between the 6th and 7th last games/albums: sed -E -i '' 's/((,[01]){6}\])/,0\1/g' src/fnc_data_song.js
  • to the end of the list of games/albums: sed -E -i '' 's/(\[([01]+,)+[01]+)\]/\1,0]/g' src/fnc_data_song.js

Then, finally add the new song data.

touhou-song-sorter's People

Contributors

relick avatar dsinn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.