-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b29d501
commit e3f551c
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
''' | ||
Specific chart generator for each songs | ||
This is going to be removed when 'Game maker' is developed! | ||
0. Copy the template (entire chart_H2O.py file) and rename filename & class name properly. | ||
1. Add self.song_name. This should be same with the sound file name in /CC_music/ folder! | ||
2. define build_chart function and add patterns as you want! | ||
It must include: (every thing should be safely converted to integer) | ||
- song length [milliseconds] | ||
- song_bpm (calculate it from the online sites!) | ||
- song_difficulty (as you wish ^^) | ||
- total_points or # of nodes (as you wish ^^) | ||
''' | ||
|
||
from chart_patterns import * | ||
|
||
class Chart_DropsOfH2O(): | ||
def __init__(self): | ||
self.song_name = 'Drops of H2O' | ||
|
||
def build_chart(self,full_path): | ||
##################################### fill in | ||
song_length = 315*1000 | ||
song_bpm = 108 | ||
cycle = 4 | ||
song_mpb = ((1000 * 60 / song_bpm)/cycle) # 215 # milli-seconds per beat | ||
song_difficulty = 1 | ||
number_of_nodes = int((song_length / 1000) * (song_bpm / 60)) - 4 | ||
#################################### | ||
|
||
with open("%s" % full_path, "w") as f: | ||
f.write('%d,%d,%d,%d\n' % (song_length, song_bpm, song_difficulty, number_of_nodes)) | ||
################################## fill in | ||
beats = 0 | ||
switch = True | ||
while number_of_nodes > 0: | ||
if beats % cycle == 1: | ||
pattern = '' | ||
if switch: | ||
pattern = basic_strike(beats, song_mpb, 1, 1) | ||
number_of_nodes -= 1 | ||
else: | ||
pattern = basic_hold(beats, song_mpb, 4, 1, 500) | ||
number_of_nodes -= 1 | ||
f.write(pattern) | ||
switch = not switch | ||
beats += 1 | ||
################################## | ||
|