Skip to content

Commit

Permalink
Merge pull request #2 from thomasasfk/highest-bpm
Browse files Browse the repository at this point in the history
Use highest bpm always & feet saber WIP
  • Loading branch information
thomasasfk authored Sep 29, 2023
2 parents 855941e + a9bb17a commit ff14012
Show file tree
Hide file tree
Showing 83 changed files with 22,081 additions and 22,070 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ Generate full DD Beat Map from json files in repository (no --song-id does all)
```bash
.venv/Scripts/python drs2dd.py --song-id 187
```

Generate full DD Beat Map from Feet Saber directory (WIP)

```bash
.venv/Scripts/python fs2dd.py ... # WIP when I have time.
```
13 changes: 9 additions & 4 deletions drs2dd.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ def create_dd_tracks_from_DRSSongData(drs_song_data: DRSSongData, target_dir: st
if not target_dir:
target_dir = f'{DEFAULT_TRACK_DIR}/{create_valid_filename(drs_song_data.info.title_name)}/'

dd_bmp = int(drs_song_data.info.bpm_max / 100)
dd_bps = dd_bmp / 60
highest_bpm = max(
drs_song_data.difficulties.difficulty_1a.track.info.bpm_info, key=lambda x: x.bpm,
).bpm
# note we don't use drs_song_data.info.bpm_max as it is not always correct... sometimes higher bpms exist.
# not sure why.
dd_bpm = int(highest_bpm / 100)
dd_bps = dd_bpm / 60

folder_path = TRACK_ID_TO_PATH.get(drs_song_data.song_id)
song_path, song_length = get_drs_ogg_and_duration(folder_path)
Expand Down Expand Up @@ -212,7 +217,7 @@ def create_dd_tracks_from_DRSSongData(drs_song_data: DRSSongData, target_dir: st
lineNodes=line_notes,
roadBlockNodes=road_block_notes,
),
BPM=dd_bmp,
BPM=dd_bpm,
NPS=str(round(total_note_count / song_length_f, 2)),
)

Expand All @@ -236,7 +241,7 @@ def create_dd_tracks_from_DRSSongData(drs_song_data: DRSSongData, target_dir: st
SongName=drs_song_data.info.title_name,
SongLength=song_length,
SongAuthorName=drs_song_data.info.artist_name,
Bpm=str(dd_bmp),
Bpm=str(dd_bpm),
SongPath=os.path.basename(song_path),
CoverPath=os.path.basename(song_cover_path or '') or None,
DRS_Easy=os.path.basename(easy_no_blocks),
Expand Down
Loading

0 comments on commit ff14012

Please sign in to comment.